diff options
author | Peiwei Hu <jlu.hpw@foxmail.com> | 2022-05-24 22:57:53 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-05-27 07:57:43 +0200 |
commit | 8d9fec1781751d2106d899c6076eeb3da6930bfe (patch) | |
tree | deec4da4593daac6aecf5cf605efaf1fd936a73b /crypto/evp | |
parent | 7e5e91176b770a68bdaf73a5c647f1fc0d7f2900 (diff) |
Fix the incorrect checks of EVP_CIPHER_CTX_set_key_length
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18397)
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/p_open.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/p_open.c b/crypto/evp/p_open.c index b08f271642..92fd20f6aa 100644 --- a/crypto/evp/p_open.c +++ b/crypto/evp/p_open.c @@ -50,7 +50,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, if (EVP_PKEY_decrypt(pctx, key, &keylen, ek, ekl) <= 0) goto err; - if (!EVP_CIPHER_CTX_set_key_length(ctx, keylen) + if (EVP_CIPHER_CTX_set_key_length(ctx, keylen) <= 0 || !EVP_DecryptInit_ex(ctx, NULL, NULL, key, iv)) goto err; |