mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Don't set ctx->cipher until after a successful fetch
If an implict EVP_CIPHER_fetch fails then ctx->cipher should not be set otherwise strange things will happen when trying to free the ctx. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9531)
This commit is contained in:
parent
e9c116ebcb
commit
7f612b1f04
@ -197,9 +197,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
|
||||
ctx->flags = flags;
|
||||
}
|
||||
|
||||
if (cipher != NULL)
|
||||
ctx->cipher = cipher;
|
||||
else
|
||||
if (cipher == NULL)
|
||||
cipher = ctx->cipher;
|
||||
|
||||
if (cipher->prov == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user