From 2d53ba023e9b2eb6dbc52765b880090aa9354cf8 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 13 Dec 2008 21:27:01 +0200 Subject: [PATCH] Packet engine: do not do the padding length check for CTR mode. --- lib/silccore/silcpacket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.24.0