diff --git a/src/crypto/crypto_aes.cc b/src/crypto/crypto_aes.cc index 5f84e21fc23763..c1c5bf762a765f 100644 --- a/src/crypto/crypto_aes.cc +++ b/src/crypto/crypto_aes.cc @@ -556,7 +556,10 @@ Maybe AESCipherTraits::AdditionalConfig( } params->cipher = EVP_get_cipherbynid(cipher_nid); - CHECK_NOT_NULL(params->cipher); + if (params->cipher == nullptr) { + THROW_ERR_CRYPTO_UNKNOWN_CIPHER(env); + return Nothing(); + } if (params->iv.size() < static_cast(EVP_CIPHER_iv_length(params->cipher))) {