mirror of
https://github.com/openssl/openssl.git
synced 2024-11-24 10:34:12 +08:00
EVP_CIPHER_CTX_get_key_length(): Add null check of ctx->cipher
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22964)
This commit is contained in:
parent
f3b988dc29
commit
46f55238d2
@ -670,6 +670,9 @@ int EVP_CIPHER_get_key_length(const EVP_CIPHER *cipher)
|
||||
|
||||
int EVP_CIPHER_CTX_get_key_length(const EVP_CIPHER_CTX *ctx)
|
||||
{
|
||||
if (ctx->cipher == NULL)
|
||||
return 0;
|
||||
|
||||
if (ctx->key_len <= 0 && ctx->cipher->prov != NULL) {
|
||||
int ok;
|
||||
OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
|
||||
|
Loading…
Reference in New Issue
Block a user