summaryrefslogtreecommitdiffstats
path: root/crypto/pem/pvkfmt.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/pvkfmt.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/pvkfmt.c')
-rw-r--r--crypto/pem/pvkfmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c
index 72ae5ab257..281c6cd95a 100644
--- a/crypto/pem/pvkfmt.c
+++ b/crypto/pem/pvkfmt.c
@@ -686,7 +686,7 @@ static EVP_PKEY *do_PVK_body(const unsigned char **in,
inlen = cb(psbuf, PEM_BUFSIZE, 0, u);
else
inlen = PEM_def_callback(psbuf, PEM_BUFSIZE, 0, u);
- if (inlen <= 0) {
+ if (inlen < 0) {
PEMerr(PEM_F_DO_PVK_BODY, PEM_R_BAD_PASSWORD_READ);
goto err;
}