summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_pbe.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2000-05-04 00:08:35 +0000
committerDr. Stephen Henson <steve@openssl.org>2000-05-04 00:08:35 +0000
commita331a305e9c9c5353bd42db6dbda78a418285708 (patch)
treed43a47f9dc244b7e04ea05547286b42053cc587d /crypto/evp/evp_pbe.c
parent316e6a66f2c4f28f8705636921825c467a5ceef3 (diff)
Make PKCS#12 code handle missing passwords.
Add a couple of FAQs.
Diffstat (limited to 'crypto/evp/evp_pbe.c')
-rw-r--r--crypto/evp/evp_pbe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/evp/evp_pbe.c b/crypto/evp/evp_pbe.c
index 353c3ad667..486b8880ce 100644
--- a/crypto/evp/evp_pbe.c
+++ b/crypto/evp/evp_pbe.c
@@ -92,7 +92,8 @@ int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
ERR_add_error_data(2, "TYPE=", obj_tmp);
return 0;
}
- if (passlen == -1) passlen = strlen(pass);
+ if(!pass) passlen = 0;
+ else if (passlen == -1) passlen = strlen(pass);
pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i);
i = (*pbetmp->keygen)(ctx, pass, passlen, param, pbetmp->cipher,
pbetmp->md, en_de);