diff options
Diffstat (limited to 'lib/gnutls_dtls.c')
-rw-r--r-- | lib/gnutls_dtls.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/gnutls_dtls.c b/lib/gnutls_dtls.c index 4ad513afc6..5e5b80ffe5 100644 --- a/lib/gnutls_dtls.c +++ b/lib/gnutls_dtls.c @@ -601,11 +601,9 @@ int total = 0, ret, iv_size; if (ret < 0) return gnutls_assert_val(ret); - /* requires padding */ - iv_size = _gnutls_cipher_get_iv_size(params->cipher_algorithm); - if (_gnutls_cipher_is_block (params->cipher_algorithm) == CIPHER_BLOCK) { + iv_size = _gnutls_cipher_get_iv_size(params->cipher_algorithm); *blocksize = iv_size; total += iv_size; /* iv_size == block_size in DTLS */ @@ -623,7 +621,12 @@ int total = 0, ret, iv_size; total += 2; if (params->mac_algorithm == GNUTLS_MAC_AEAD) - total += _gnutls_cipher_get_tag_size(params->cipher_algorithm); + { + iv_size = _gnutls_cipher_get_iv_size(params->cipher_algorithm); + total += iv_size; + + total += _gnutls_cipher_get_tag_size(params->cipher_algorithm); + } else { ret = _gnutls_hmac_get_algo_len(params->mac_algorithm); |