RT4002: check for NULL cipher in p12_crpt.c
The NULL cipher case can't actually happen because we have no EVP_PBE_CTL combinations where cipher_nid is -1 and keygen is PKCS12_PBE_keyivgen. But make the code more obviously correct. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 394f7b6fcc38132b8ccff0a3253b9dd15640cfc0)
This commit is contained in:
parent
5f623eb616
commit
59793f5c1e
@ -77,6 +77,9 @@ int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
|||||||
const unsigned char *pbuf;
|
const unsigned char *pbuf;
|
||||||
unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH];
|
unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH];
|
||||||
|
|
||||||
|
if (cipher == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Extract useful info from parameter */
|
/* Extract useful info from parameter */
|
||||||
if (param == NULL || param->type != V_ASN1_SEQUENCE ||
|
if (param == NULL || param->type != V_ASN1_SEQUENCE ||
|
||||||
param->value.sequence == NULL) {
|
param->value.sequence == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user