summaryrefslogtreecommitdiffstats
path: root/crypto/pem/pem_pkey.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-05-04 14:19:44 +0200
committerRichard Levitte <levitte@openssl.org>2018-05-12 10:19:51 +0200
commitc82c3462267afdbbaa53e11da0508ce4e03c02b3 (patch)
tree68fe4c26a3262a1bb641e9ac74dd6c43eb68f629 /crypto/pem/pem_pkey.c
parent34e4a964afacb48414e37a5b205ce9a349259e6b (diff)
In cases where we ask PEM_def_callback for minimum 0 length, accept 0 length
Fixes #4716 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6173)
Diffstat (limited to 'crypto/pem/pem_pkey.c')
-rw-r--r--crypto/pem/pem_pkey.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c
index 8730a78913..aa032d2b1c 100644
--- a/crypto/pem/pem_pkey.c
+++ b/crypto/pem/pem_pkey.c
@@ -60,7 +60,7 @@ EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
klen = cb(psbuf, PEM_BUFSIZE, 0, u);
else
klen = PEM_def_callback(psbuf, PEM_BUFSIZE, 0, u);
- if (klen <= 0) {
+ if (klen < 0) {
PEMerr(PEM_F_PEM_READ_BIO_PRIVATEKEY, PEM_R_BAD_PASSWORD_READ);
X509_SIG_free(p8);
goto err;