From 4866ea1fef107ddca0f5aa3dcb187c6fd7f4afe1 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 24 Jan 2009 02:19:46 +0000 Subject: [PATCH] support NULL MAC properly --- src/daemon/https/tls/gnutls_cipher.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/daemon/https/tls/gnutls_cipher.c b/src/daemon/https/tls/gnutls_cipher.c index 6edc0efe..5004d13c 100644 --- a/src/daemon/https/tls/gnutls_cipher.c +++ b/src/daemon/https/tls/gnutls_cipher.c @@ -479,7 +479,8 @@ MHD_gtls_ciphertext2compressed (MHD_gtls_session_t session, /* HMAC was not the same. */ - if (memcmp (MAC, &ciphertext.data[length], hash_size) != 0) + if ( (td != GNUTLS_MAC_FAILED) && + (memcmp (MAC, &ciphertext.data[length], hash_size) != 0) ) { MHD_gnutls_assert (); return GNUTLS_E_DECRYPTION_FAILED;