diff options
author | Olga Batyshkina <obatysh@gmx.com> | 2023-08-07 14:51:53 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-08-10 12:12:18 +0200 |
commit | 9f0f833480861ef230d215aa24f1aeb2a2160e81 (patch) | |
tree | 3dd0833ebfa772c4852c5cc77126f31422542d48 /test | |
parent | c9f278393ed459a51cc7984ae231536515e1001c (diff) |
Do not raise CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA error in CMS_ContentInfo_free
This happens if this function is called for signed content.
Added ossl_cms_env_enc_content_free() for cleaning enveloped content.
Fixed indentation in ossl_cms_env_enc_content_free
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21676)
(cherry picked from commit 13342efbb9e16ec8f97b1ac5ab4aa2b3b3490596)
Diffstat (limited to 'test')
-rw-r--r-- | test/cmsapitest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/cmsapitest.c b/test/cmsapitest.c index d5c4cb8481..ffc9a0c98a 100644 --- a/test/cmsapitest.c +++ b/test/cmsapitest.c @@ -56,7 +56,7 @@ static int test_encrypt_decrypt(const EVP_CIPHER *cipher) BIO_free(outmsgbio); CMS_ContentInfo_free(content); - return testresult; + return testresult && TEST_int_eq(ERR_peek_error(), 0); } static int test_encrypt_decrypt_aes_cbc(void) @@ -286,7 +286,7 @@ static int test_d2i_CMS_bio_NULL(void) CMS_NO_SIGNER_CERT_VERIFY)); CMS_ContentInfo_free(cms); BIO_free(bio); - return ret; + return ret && TEST_int_eq(ERR_peek_error(), 0); } static unsigned char *read_all(BIO *bio, long *p_len) |