From: Christian Hohnstaedt Date: Sun, 22 Mar 2020 08:41:30 +0000 (+0100) Subject: i2b_PVK_bio: don't set PEM_R_BIO_WRITE_FAILURE in case of success X-Git-Tag: openssl-3.0.0-alpha2~152 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=80b94a5adb461f94629d36db351a051b0a890856;p=oweals%2Fopenssl.git i2b_PVK_bio: don't set PEM_R_BIO_WRITE_FAILURE in case of success but in case of an error CLA: trivial Reviewed-by: Richard Levitte Reviewed-by: Bernd Edlinger Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11380) --- diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c index 6896cc4e4c..1a24ce755a 100644 --- a/crypto/pem/pvkfmt.c +++ b/crypto/pem/pvkfmt.c @@ -882,9 +882,9 @@ int i2b_PVK_bio(BIO *out, const EVP_PKEY *pk, int enclevel, wrlen = BIO_write(out, tmp, outlen); OPENSSL_free(tmp); if (wrlen == outlen) { - PEMerr(PEM_F_I2B_PVK_BIO, PEM_R_BIO_WRITE_FAILURE); return outlen; } + PEMerr(PEM_F_I2B_PVK_BIO, PEM_R_BIO_WRITE_FAILURE); return -1; }