summaryrefslogtreecommitdiffstats
path: root/crypto/cms
diff options
context:
space:
mode:
authorDaniel Fiala <daniel@openssl.org>2022-03-28 12:53:08 +0000
committerTomas Mraz <tomas@openssl.org>2022-04-21 08:38:40 +0200
commit455e158ef9b3b600738f5b01190c2b7083d3d0ba (patch)
treefc18c2f2d3a5f3ae59f2a31d91168ca9767f1ae0 /crypto/cms
parentea5ef33be1bd4fbd89143932a4d12a72003913a5 (diff)
Clear incorrectly reported errors in cms_io.
Fixes openssl#17841. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18109) (cherry picked from commit 45a3c592b94b66cab72e5bffbaf9d810c3fb29c0)
Diffstat (limited to 'crypto/cms')
-rw-r--r--crypto/cms/cms_io.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/cms/cms_io.c b/crypto/cms/cms_io.c
index 3768ea4db2..935344167a 100644
--- a/crypto/cms/cms_io.c
+++ b/crypto/cms/cms_io.c
@@ -41,8 +41,11 @@ CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms)
ci = ASN1_item_d2i_bio_ex(ASN1_ITEM_rptr(CMS_ContentInfo), bp, cms,
ossl_cms_ctx_get0_libctx(ctx),
ossl_cms_ctx_get0_propq(ctx));
- if (ci != NULL)
+ if (ci != NULL) {
+ ERR_set_mark();
ossl_cms_resolve_libctx(ci);
+ ERR_pop_to_mark();
+ }
return ci;
}
@@ -104,8 +107,11 @@ CMS_ContentInfo *SMIME_read_CMS_ex(BIO *bio, int flags, BIO **bcont,
(ASN1_VALUE **)cms,
ossl_cms_ctx_get0_libctx(ctx),
ossl_cms_ctx_get0_propq(ctx));
- if (ci != NULL)
+ if (ci != NULL) {
+ ERR_set_mark();
ossl_cms_resolve_libctx(ci);
+ ERR_pop_to_mark();
+ }
return ci;
}