diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-05-03 21:58:02 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-05-19 09:23:41 +0200 |
commit | 8a734d3aaf4e4784581b87cdf2a4b3e2c2403b97 (patch) | |
tree | f08d3cf616312d586f4dc68f29eb8720f139f078 /crypto/cms/cms_sd.c | |
parent | apps/cms.c: Simplify make_receipt_request() and load_content_info(() (diff) | |
download | openssl-8a734d3aaf4e4784581b87cdf2a4b3e2c2403b97.tar.xz openssl-8a734d3aaf4e4784581b87cdf2a4b3e2c2403b97.zip |
CMS_get0_SignerInfos(): Prevent spurious error on cms_get0_signed() failure
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12959)
Diffstat (limited to 'crypto/cms/cms_sd.c')
-rw-r--r-- | crypto/cms/cms_sd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c index d208822c4b..c0235b6962 100644 --- a/crypto/cms/cms_sd.c +++ b/crypto/cms/cms_sd.c @@ -496,9 +496,13 @@ void ossl_cms_SignerInfos_set_cmsctx(CMS_ContentInfo *cms) { int i; CMS_SignerInfo *si; - STACK_OF(CMS_SignerInfo) *sinfos = CMS_get0_SignerInfos(cms); + STACK_OF(CMS_SignerInfo) *sinfos; const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms); + ERR_set_mark(); + sinfos = CMS_get0_SignerInfos(cms); + ERR_pop_to_mark(); /* removes error in case sinfos == NULL */ + for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) { si = sk_CMS_SignerInfo_value(sinfos, i); if (si != NULL) |