diff options
author | Darshan Sen <raisinten@gmail.com> | 2022-01-22 13:26:05 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-01-26 17:15:52 +0100 |
commit | 1d28ada1c39997c10fe5392f4235bbd2bc44b40f (patch) | |
tree | 14c32dd7ef4cf57393d59a39d4d332fc83706549 /crypto/pem/pem_pk8.c | |
parent | Fix invalid malloc failures in PEM_write_bio_PKCS8PrivateKey() (diff) | |
download | openssl-1d28ada1c39997c10fe5392f4235bbd2bc44b40f.tar.xz openssl-1d28ada1c39997c10fe5392f4235bbd2bc44b40f.zip |
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/pem_pk8.c')
-rw-r--r-- | crypto/pem/pem_pk8.c | 2 |
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; } |