summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12/p12_crpt.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-06-07 21:00:19 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-06-07 21:00:19 +0000
commit97e4a932451188508b6f865b1a16f2e670a1c315 (patch)
treee93a777cf6aa89efd78048bf40df25bd105b040b /crypto/pkcs12/p12_crpt.c
parent3928b6bf4815d5f9d9cf1af10dea84e27a74ccb2 (diff)
This is the main PKCS#5 v2.0 key generation function, it parses the ASN1
structure and decides what key to generate (if any). Not currently added to the PBE algorithm list because it is largely untested.
Diffstat (limited to 'crypto/pkcs12/p12_crpt.c')
-rw-r--r--crypto/pkcs12/p12_crpt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/pkcs12/p12_crpt.c b/crypto/pkcs12/p12_crpt.c
index ae516eeb8d..d94265403a 100644
--- a/crypto/pkcs12/p12_crpt.c
+++ b/crypto/pkcs12/p12_crpt.c
@@ -92,8 +92,8 @@ int PKCS12_PBE_keyivgen (EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
/* Extract useful info from parameter */
pbuf = param->value.sequence->data;
- if (!(pbe = d2i_PBEPARAM (NULL, &pbuf,
- param->value.sequence->length))) {
+ if (!param || (param->type = V_ASN1_SEQUENCE) ||
+ !(pbe = d2i_PBEPARAM (NULL, &pbuf, param->value.sequence->length))) {
EVPerr(PKCS12_F_PKCS12_PBE_KEYIVGEN,EVP_R_DECODE_ERROR);
return 0;
}