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-Tag: openssl-3.0.17~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f4a94e2289edc8cd8c194db179b0500e0351d3d;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) (cherry picked from commit 3edb1f09c62c058edf4039587ef35f6b074e0870) --- diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index 8bb7089292d..614eb5b8359 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; }