mirror of
https://github.com/openssl/openssl.git
synced 2025-01-12 13:36:28 +08:00
Only reset the ctx when a cipher is given
This restores the 1.0.2 behaviour Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Benjamin Kaduk <bkaduk@akamai.com> GH: #4613
This commit is contained in:
parent
79204b9cd7
commit
ffd2320993
@ -50,7 +50,8 @@ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx)
|
||||
int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
|
||||
const unsigned char *key, const unsigned char *iv, int enc)
|
||||
{
|
||||
EVP_CIPHER_CTX_reset(ctx);
|
||||
if (cipher != NULL)
|
||||
EVP_CIPHER_CTX_reset(ctx);
|
||||
return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user