Only initialize cipher ctx if cipher is not NULL.
This commit is contained in:
parent
14e14ea68c
commit
19cc0f0ab4
1 changed files with 2 additions and 1 deletions
|
@ -77,7 +77,8 @@ void EVP_CIPHER_CTX_init(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_init(ctx);
|
||||
if (cipher)
|
||||
EVP_CIPHER_CTX_init(ctx);
|
||||
return EVP_CipherInit_ex(ctx,cipher,NULL,key,iv,enc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue