updates
authorPekka Riikonen <priikone@silcnet.org>
Tue, 28 May 2002 11:56:23 +0000 (11:56 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 28 May 2002 11:56:23 +0000 (11:56 +0000)
CHANGES
lib/silcclient/client_prvmsg.c

diff --git a/CHANGES b/CHANGES
index 1b82b5d85579d8113e0d6fb054fff71eb0b8ab2b..3f38c5edae6f43ab454fe40e892532eaf448bca0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+Tue May 28 13:56:26 CEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+       * 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 <priikone@silcnet.org>
 
        * When resuming client, remove the old client entry from
index 439fe0e32d3853877fa8b3346b41dec2cf3598e8..647790b552505ce485d55613ed299197870be9d5 100644 (file)
@@ -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;