+Sun Sep 16 12:32:58 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
+
+ * Assure that the packet length digged from the actual packet
+ is something sensible in the silc_packet_decrypt_rest_special
+ in lib/silccrypt/silcpacket.c.
+
Sat Sep 15 13:29:17 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
* Check that the public key exists in the GETKEY command before
len1 = (truelen + padlen) - (SILC_PACKET_MIN_HEADER_LEN - 2);
silc_buffer_pull(buffer, SILC_PACKET_MIN_HEADER_LEN - 2);
+ if (len1 - 2 > buffer->len) {
+ SILC_LOG_DEBUG(("Garbage in header of packet, bad packet length, "
+ "packet dropped"));
+ return FALSE;
+ }
+
cipher->cipher->decrypt(cipher->context, buffer->data + 2,
buffer->data + 2, len1 - 2,
cipher->iv);