support NULL MAC properly

This commit is contained in:
Christian Grothoff
2009-01-24 02:19:46 +00:00
parent 0dafbfbb95
commit 4866ea1fef
+2 -1
View File
@@ -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;