From: Nikos Mavrogiannopoulos Date: Fri, 29 Jun 2012 23:42:14 +0000 (+0200) Subject: only block ciphers need 1 byte padding. X-Git-Tag: gnutls_3_0_21~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cf64fa749890eefae3201b403de6b4c1e565ba7f;p=thirdparty%2Fgnutls.git only block ciphers need 1 byte padding. --- diff --git a/lib/gnutls_dtls.c b/lib/gnutls_dtls.c index bd3c6371dd..02b37a9339 100644 --- a/lib/gnutls_dtls.c +++ b/lib/gnutls_dtls.c @@ -617,6 +617,9 @@ int total = 0, ret, iv_size; total += MAX_PAD_SIZE; else total += iv_size; /* iv_size == block_size */ + + /* We always pad with at least one byte; never 0. */ + total++; } else { @@ -635,9 +638,6 @@ int total = 0, ret, iv_size; if (params->compression_algorithm != GNUTLS_COMP_NULL) total += EXTRA_COMP_SIZE; - - /* We always pad with at least one byte; never 0. */ - total++; return total; }