From 8f4a94e2289edc8cd8c194db179b0500e0351d3d Mon Sep 17 00:00:00 2001 From: Andrey Tsygunka Date: Thu, 20 Mar 2025 17:45:23 +0300 Subject: [PATCH] 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) --- crypto/asn1/asn_mime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.2