RT4002: check for NULL cipher in p12_crpt.c
[openssl.git] / crypto / pkcs12 / p12_crpt.c
index 08be40c61ffd486703e5f371cd1c4423af3174d8..e7d5ac9f6bd7317504b22b6091db8ce96bd173a0 100644 (file)
@@ -76,6 +76,9 @@ int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
     unsigned char *salt;
     unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH];
 
+    if (cipher == NULL)
+        return 0;
+
     /* Extract useful info from parameter */
 
     pbe = ASN1_TYPE_unpack_sequence(ASN1_ITEM_rptr(PBEPARAM), param);