From: Pekka Riikonen Date: Sat, 13 Dec 2008 19:27:01 +0000 (+0200) Subject: Packet engine: do not do the padding length check for CTR mode. X-Git-Tag: silc.toolkit.1.1.9~9 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=2d53ba023e9b2eb6dbc52765b880090aa9354cf8 Packet engine: do not do the padding length check for CTR mode. --- diff --git a/lib/silccore/silcpacket.c b/lib/silccore/silcpacket.c index 9a44f87c..767ec927 100644 --- a/lib/silccore/silcpacket.c +++ b/lib/silccore/silcpacket.c @@ -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);