summaryrefslogtreecommitdiffstats
path: root/crypto/pem
diff options
context:
space:
mode:
authorDarshan Sen <raisinten@gmail.com>2022-01-22 17:56:05 +0530
committerTomas Mraz <tomas@openssl.org>2022-01-26 17:15:52 +0100
commit1d28ada1c39997c10fe5392f4235bbd2bc44b40f (patch)
tree14c32dd7ef4cf57393d59a39d4d332fc83706549 /crypto/pem
parent59ccb72cd5cec3b4e312853621e12a68dacdbc7e (diff)
Allow empty passphrase in PEM_write_bio_PKCS8PrivateKey_nid()
Signed-off-by: Darshan Sen <raisinten@gmail.com> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17507)
Diffstat (limited to 'crypto/pem')
-rw-r--r--crypto/pem/pem_pk8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/pem/pem_pk8.c b/crypto/pem/pem_pk8.c
index 4742f02fef..60ff09354b 100644
--- a/crypto/pem/pem_pk8.c
+++ b/crypto/pem/pem_pk8.c
@@ -136,7 +136,7 @@ static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder, int nid,
if (enc || (nid != -1)) {
if (kstr == NULL) {
klen = cb(buf, PEM_BUFSIZE, 1, u);
- if (klen <= 0) {
+ if (klen < 0) {
ERR_raise(ERR_LIB_PEM, PEM_R_READ_KEY);
goto legacy_end;
}