Packet engine: do not do the padding length check for CTR mode.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 13 Dec 2008 19:27:01 +0000 (21:27 +0200)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 13 Dec 2008 19:27:01 +0000 (21:27 +0200)
lib/silccore/silcpacket.c

index 9a44f87c9f74948fce9202b1fcfc43bbcf6fba14..767ec927a4712a9f24575571cea1a4a45de51724 100644 (file)
@@ -2198,7 +2198,8 @@ static void silc_packet_read_process(SilcPacketStream stream)
     SILC_PACKET_LENGTH(header, packetlen, paddedlen);
 
     /* Padding sanity checks */
-    if (cipher && (paddedlen % block_len) != 0) {
+    if (cipher && silc_cipher_get_mode(cipher) != SILC_CIPHER_MODE_CTR &&
+       (paddedlen % block_len) != 0) {
       SILC_LOG_DEBUG(("Packet length %d not multiple by cipher block length",
                      paddedlen));
       silc_mutex_unlock(stream->lock);