+Sat Nov 10 21:39:22 EET 2001 Pekka Riikonen <priikone@silcnet.org>
+
+ * If the incoming packet type is REKEY or REKEY_DONE process
+ that packet always synchronously. Fixes yet another MAC
+ failed error on slow (dialup) connections. Affected file
+ lib/silcclient/client.c and silcd/server.c.
+
Thu Nov 8 22:21:09 EET 2001 Pekka Riikonen <priikone@silcnet.org>
* Call check_version SKE callback for initiator too. Affected
o WHOIS shows the formatted nickname wrong in some circumstances.
+ o Set incrorrect key and /MSG him, screen gets screwed.
+
+ o Crashes if lots of concurrent /PING's.
+
o JOIN command's argument handling is buggy. See the XXX in the code.
process all packets synchronously, since there might be packets in
queue that we are not able to decrypt without first processing the
packets before them. */
- if (sock->protocol && sock->protocol->protocol &&
- (sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_KEY_EXCHANGE ||
- sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_REKEY)) {
+ if ((parser_context->packet->type == SILC_PACKET_REKEY ||
+ parser_context->packet->type == SILC_PACKET_REKEY_DONE) ||
+ (sock->protocol && sock->protocol->protocol &&
+ (sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_KEY_EXCHANGE ||
+ sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_REKEY))) {
silc_server_packet_parse_real(server->schedule, 0, sock->sock,
parser_context);
(*channel_ids)[i] = NULL;
silc_server_announce_get_channel_users(server, channel,
channel_users,
- channel_users_modes[i]);
+ &(*channel_users_modes)[i]);
(*channel_ids)[i] = channel->id;
i++;
SilcPacketContext *packet = parser_context->packet;
SilcPacketType ret;
- if (conn && conn->hmac_receive)
+ if (conn && conn->hmac_receive && conn->sock == sock)
conn->psn_receive = parser_context->packet->sequence + 1;
/* Parse the packet immediately */
process all packets synchronously, since there might be packets in
queue that we are not able to decrypt without first processing the
packets before them. */
- if (sock->protocol && sock->protocol->protocol &&
- (sock->protocol->protocol->type == SILC_PROTOCOL_CLIENT_KEY_EXCHANGE ||
- sock->protocol->protocol->type == SILC_PROTOCOL_CLIENT_REKEY)) {
+ if ((ret == SILC_PACKET_REKEY || ret == SILC_PACKET_REKEY_DONE) ||
+ (sock->protocol && sock->protocol->protocol &&
+ (sock->protocol->protocol->type == SILC_PROTOCOL_CLIENT_KEY_EXCHANGE ||
+ sock->protocol->protocol->type == SILC_PROTOCOL_CLIENT_REKEY))) {
/* Parse the incoming packet type */
silc_client_packet_parse_type(client, sock, packet);
{
SilcPacketParserContext *parse_ctx;
int packetlen, paddedlen, mac_len = 0;
- int block_len = cipher ? silc_cipher_get_block_len(cipher) : 0;
bool cont = TRUE;
/* Do not process for disconnected connection */
parse_ctx = silc_calloc(1, sizeof(*parse_ctx));
parse_ctx->packet = silc_packet_context_alloc();
parse_ctx->packet->buffer = silc_buffer_alloc(paddedlen + mac_len);
+ parse_ctx->packet->type = sock->inbuf->data[3];
parse_ctx->packet->padlen = sock->inbuf->data[4];
parse_ctx->packet->sequence = sequence++;
parse_ctx->sock = sock;
paddedlen + mac_len);
SILC_LOG_HEXDUMP(("Incoming packet (%d) (%dB decrypted), len %d",
- sequence - 1, block_len, paddedlen + mac_len),
+ sequence - 1, SILC_PACKET_MIN_HEADER_LEN,
+ paddedlen + mac_len),
sock->inbuf->data, paddedlen + mac_len);
/* Check whether this is normal or special packet */
* Packet flags. Flags are defined above.
*
* unsigned char *src_id
- * uint16 src_id_len
+ * uint8 src_id_len
* unsigned char src_id_type
*
* Source ID, its length and type. On packet reception retuned ID's
* are always the hash values of the ID's from the packet.
*
* unsigned char *dst_id;
- * uint16 dst_id_len;
+ * uint8 dst_id_len;
* unsigned char src_id_type;
*
* Destination ID, its length and type. On packet reception retuned
* ID's are always the hash values of the ID's from the packet.
*
* uint16 truelen
- * uint16 padlen
+ * uint8 padlen
*
* The true lenght of the packet and the padded length of the packet.
* These may be set by the caller before calling any of the