]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix return value of the i2d_ASN1_bio_stream() call
authorAndrey Tsygunka <aitsygunka@yandex.ru>
Thu, 20 Mar 2025 14:45:23 +0000 (17:45 +0300)
committerTomas Mraz <tomas@openssl.org>
Wed, 26 Mar 2025 14:27:51 +0000 (15:27 +0100)
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 <aitsygunka@yandex.ru>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27106)

(cherry picked from commit 3edb1f09c62c058edf4039587ef35f6b074e0870)

crypto/asn1/asn_mime.c

index 44b760534babb4401f85bb41c881de7ea30135e8..2c262b095c84bcc739482953f3ed85e040e36dd1 100644 (file)
@@ -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;
 }