summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorOlga Batyshkina <obatysh@gmx.com>2023-08-07 14:51:53 +0200
committerTomas Mraz <tomas@openssl.org>2023-08-10 12:12:08 +0200
commit2c4fec62384a924be7139e82191c340e214333a4 (patch)
tree98db2c24d33b4cb2aeef4e6e0cfbe5e9c2e867bf /test
parent51a18356ee3303ed9a87c527937a8dbd0a5c7cef (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.c4
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)