]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Corrected size check in block encrypted records.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 10 Mar 2011 23:15:55 +0000 (00:15 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 10 Mar 2011 23:15:55 +0000 (00:15 +0100)
lib/gnutls_cipher.c

index d3551519d05152f5cd930700b2fcc9f489ccfe97..deef202948f26447eb72c8d25beae43190fc0f0c 100644 (file)
@@ -519,7 +519,7 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
 
       break;
     case CIPHER_BLOCK:
-      if ((ciphertext.size < blocksize+tag_size) || (ciphertext.size % blocksize != 0))
+      if (ciphertext.size < MAX(blocksize, tag_size) || (ciphertext.size % blocksize != 0))
         return gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
 
       /* ignore the IV in TLS 1.1+