diff options
Diffstat (limited to 'src/lib/libcrypto/evp/p5_crpt2.c')
-rw-r--r-- | src/lib/libcrypto/evp/p5_crpt2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/p5_crpt2.c b/src/lib/libcrypto/evp/p5_crpt2.c index 27a2c518be..717fad68ca 100644 --- a/src/lib/libcrypto/evp/p5_crpt2.c +++ b/src/lib/libcrypto/evp/p5_crpt2.c | |||
@@ -86,7 +86,8 @@ int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, | |||
86 | HMAC_CTX hctx; | 86 | HMAC_CTX hctx; |
87 | p = out; | 87 | p = out; |
88 | tkeylen = keylen; | 88 | tkeylen = keylen; |
89 | if(passlen == -1) passlen = strlen(pass); | 89 | if(!pass) passlen = 0; |
90 | else if(passlen == -1) passlen = strlen(pass); | ||
90 | while(tkeylen) { | 91 | while(tkeylen) { |
91 | if(tkeylen > SHA_DIGEST_LENGTH) cplen = SHA_DIGEST_LENGTH; | 92 | if(tkeylen > SHA_DIGEST_LENGTH) cplen = SHA_DIGEST_LENGTH; |
92 | else cplen = tkeylen; | 93 | else cplen = tkeylen; |