From: Pekka Riikonen Date: Tue, 28 May 2002 11:56:23 +0000 (+0000) Subject: updates X-Git-Tag: silc.toolkit.0.9.2~26 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=ce725773f771316f496a0165a5f34e8c4e9e052c;p=silc.git updates --- diff --git a/CHANGES b/CHANGES index 1b82b5d8..3f38c5ed 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +Tue May 28 13:56:26 CEST 2002 Pekka Riikonen + + * If private message key is not set, but the flag is set in + the packet, ignore the packet since it cannot be decrypted. + Affected file lib/silcclient/client_prvmsg.c. + Thu May 23 12:00:14 CEST 2002 Pekka Riikonen * When resuming client, remove the old client entry from diff --git a/lib/silcclient/client_prvmsg.c b/lib/silcclient/client_prvmsg.c index 439fe0e3..647790b5 100644 --- a/lib/silcclient/client_prvmsg.c +++ b/lib/silcclient/client_prvmsg.c @@ -150,6 +150,7 @@ void silc_client_private_message(SilcClient client, SilcMessageFlags flags; unsigned char *message; SilcUInt32 message_len; + SilcCipher cipher = NULL; if (packet->src_id_type != SILC_ID_CLIENT) goto out; @@ -178,10 +179,15 @@ void silc_client_private_message(SilcClient client, return; } + cipher = remote_client->receive_key; + if (packet->flags & SILC_PACKET_FLAG_PRIVMSG_KEY && !cipher) { + silc_free(remote_id); + return; + } + /* Parse the payload and decrypt it also if private message key is set */ payload = silc_private_message_payload_parse(packet->buffer->data, - packet->buffer->len, - remote_client->receive_key); + packet->buffer->len, cipher); if (!payload) { silc_free(remote_id); return;