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:09:38 +0200 |
commit | 13342efbb9e16ec8f97b1ac5ab4aa2b3b3490596 (patch) | |
tree | 6656eebfcacb40831a903900de5bc1239758f4d2 /test/cmsapitest.c | |
parent | 6d38ccedb25f31dfab232e2669415fd4db18b20e (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)
Diffstat (limited to 'test/cmsapitest.c')
-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 6e59b48813..ecb5e1054d 100644 --- a/test/cmsapitest.c +++ b/test/cmsapitest.c @@ -65,7 +65,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) @@ -312,7 +312,7 @@ static int test_d2i_CMS_bio_NULL(void) BIO_free(content); 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) |