From: Nikos Mavrogiannopoulos Date: Mon, 29 Jul 2013 14:22:16 +0000 (+0200) Subject: corrected overhead calculation in AEAD ciphers. X-Git-Tag: gnutls_3_2_3~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc8c2bf60193c9c4d9bc58898fce3d335558daae;p=thirdparty%2Fgnutls.git corrected overhead calculation in AEAD ciphers. --- diff --git a/lib/gnutls_dtls.c b/lib/gnutls_dtls.c index 754c97277b..009b63cd2d 100644 --- a/lib/gnutls_dtls.c +++ b/lib/gnutls_dtls.c @@ -601,9 +601,7 @@ int t, ret; if (mac->id == GNUTLS_MAC_AEAD) { - t = _gnutls_cipher_get_iv_size(cipher); - total += t; - + total += AEAD_EXPLICIT_DATA_SIZE; total += _gnutls_cipher_get_tag_size(cipher); } else diff --git a/tests/mini-overhead.c b/tests/mini-overhead.c index b4d90f63fd..1802079461 100644 --- a/tests/mini-overhead.c +++ b/tests/mini-overhead.c @@ -348,7 +348,7 @@ doit (void) /* 13 + 20(sha1) + 16(iv) + 16(max pad) */ start("NONE:+VERS-DTLS1.0:+AES-128-CBC:+SHA1:+SIGN-ALL:+COMP-NULL:+RSA", 65); /* 13 + 16(tag) + 4(iv) */ - start("NONE:+VERS-DTLS1.0:+AES-128-GCM:+AEAD:+SIGN-ALL:+COMP-NULL:+RSA", 33); + start("NONE:+VERS-DTLS1.0:+AES-128-GCM:+AEAD:+SIGN-ALL:+COMP-NULL:+RSA", 37); /* 13 + 20(tag) */ start("NONE:+VERS-DTLS1.0:+SALSA20-256:+SHA1:+SIGN-ALL:+COMP-NULL:+RSA", 33); /* 13 + 12(tag) */