From: Andrey Tsygunka Date: Thu, 20 Mar 2025 14:45:23 +0000 (+0300) Subject: Fix return value of the i2d_ASN1_bio_stream() call X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3edb1f09c62c058edf4039587ef35f6b074e0870;p=thirdparty%2Fopenssl.git Fix return value of the i2d_ASN1_bio_stream() call If the flags argument does not contain the SMIME_STREAM bit, the i2d_ASN1_bio_stream() function always returns 1, ignoring the result of the ASN1_item_i2d_bio() call. Fix the return value to the result of the ASN1_item_i2d_bio() call for this case. CLA: trivial Signed-off-by: Andrey Tsygunka Reviewed-by: Nicola Tuveri Reviewed-by: Paul Yang Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27106) --- diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index b3778226f9a..105e35fb768 100644 --- a/crypto/asn1/asn_mime.c +++ b/crypto/asn1/asn_mime.c @@ -96,7 +96,7 @@ int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, * internally */ else - ASN1_item_i2d_bio(it, out, val); + rv = ASN1_item_i2d_bio(it, out, val); return rv; }