Only initialize cipher ctx if cipher is not NULL.
authorDr. Stephen Henson <steve@openssl.org>
Fri, 15 Feb 2002 01:01:36 +0000 (01:01 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 15 Feb 2002 01:01:36 +0000 (01:01 +0000)
crypto/evp/evp_enc.c

index eb39539ca63a34570716328fa624cb83e2dd0a46..9c65a553d39ed66302d96afa777b3e385f8de09d 100644 (file)
@@ -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);
        }