|
|
@@ -34,8 +34,12 @@ SSL_AEAD_CTX *SSL_AEAD_CTX_new(enum evp_aead_direction_t direction, |
|
|
|
const uint8_t *mac_key, size_t mac_key_len, |
|
|
|
const uint8_t *fixed_iv, size_t fixed_iv_len) { |
|
|
|
const EVP_AEAD *aead; |
|
|
|
size_t discard; |
|
|
|
if (!ssl_cipher_get_evp_aead(&aead, &discard, &discard, cipher, version)) { |
|
|
|
size_t expected_mac_key_len, expected_fixed_iv_len; |
|
|
|
if (!ssl_cipher_get_evp_aead(&aead, &expected_mac_key_len, |
|
|
|
&expected_fixed_iv_len, cipher, version) || |
|
|
|
/* Ensure the caller returned correct key sizes. */ |
|
|
|
expected_fixed_iv_len != fixed_iv_len || |
|
|
|
expected_mac_key_len != mac_key_len) { |
|
|
|
OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); |
|
|
|
return 0; |
|
|
|
} |
|
|
|