summaryrefslogtreecommitdiffstats
path: root/crypto/evp/p5_crpt2.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/p5_crpt2.c
parent316e6a66f2c4f28f8705636921825c467a5ceef3 (diff)
Make PKCS#12 code handle missing passwords.
Add a couple of FAQs.
Diffstat (limited to 'crypto/evp/p5_crpt2.c')
-rw-r--r--crypto/evp/p5_crpt2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/evp/p5_crpt2.c b/crypto/evp/p5_crpt2.c
index 27a2c518be..717fad68ca 100644
--- a/crypto/evp/p5_crpt2.c
+++ b/crypto/evp/p5_crpt2.c
@@ -86,7 +86,8 @@ int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
HMAC_CTX hctx;
p = out;
tkeylen = keylen;
- if(passlen == -1) passlen = strlen(pass);
+ if(!pass) passlen = 0;
+ else if(passlen == -1) passlen = strlen(pass);
while(tkeylen) {
if(tkeylen > SHA_DIGEST_LENGTH) cplen = SHA_DIGEST_LENGTH;
else cplen = tkeylen;