X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilccore%2Fsilcpacket.c;h=fe76866208d8dc32890bca3bee5092cc69c94e71;hb=cdedc07c65bab8467f6f5b1ef4b38982c2c77571;hp=c6cba515af1b558f8ad96060113a9c574fd56b5b;hpb=2878ba34b8d864f89cfb785448e95cdd42297ee0;p=crypto.git diff --git a/lib/silccore/silcpacket.c b/lib/silccore/silcpacket.c index c6cba515..fe768662 100644 --- a/lib/silccore/silcpacket.c +++ b/lib/silccore/silcpacket.c @@ -141,9 +141,10 @@ bool silc_packet_assemble(SilcPacketContext *packet, SilcRng rng, /* Calculate the length of the padding. The padding is calculated from the data that will be encrypted. */ if (!packet->padlen) { - packet->padlen = (packet->long_pad ? - SILC_PACKET_PADLEN_MAX(packet->truelen) : - SILC_PACKET_PADLEN(packet->truelen, block_len)); + if (packet->long_pad) + SILC_PACKET_PADLEN_MAX(packet->truelen, block_len, packet->padlen); + else + SILC_PACKET_PADLEN(packet->truelen, block_len, packet->padlen); } /* Now prepare the outgoing data buffer for packet sending and start