]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
only block ciphers need 1 byte padding.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 29 Jun 2012 23:42:14 +0000 (01:42 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 29 Jun 2012 23:42:44 +0000 (01:42 +0200)
lib/gnutls_dtls.c

index bd3c6371dd5d2dfda34441e5e4357c995e5a95f7..02b37a9339a18445ebc8f6b135982920209bf572 100644 (file)
@@ -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;
 }