diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2022-06-27 17:05:21 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2022-07-16 08:15:49 +0200 |
commit | d7d3dae694fa4611c1cd953dccf81b3d2b4121c6 (patch) | |
tree | d4210058c101d76fc666b53c183fbd3e5fa6cff5 /test/cmsapitest.c | |
parent | CMS_add0_cert.pod: various improvements of the description (diff) | |
download | openssl-d7d3dae694fa4611c1cd953dccf81b3d2b4121c6.tar.xz openssl-d7d3dae694fa4611c1cd953dccf81b3d2b4121c6.zip |
CMS: add CMS_SignedData_verify(), a variant of CMS_verify() with extensions
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18667)
Diffstat (limited to 'test/cmsapitest.c')
-rw-r--r-- | test/cmsapitest.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/cmsapitest.c b/test/cmsapitest.c index b40089becd..460e4693c2 100644 --- a/test/cmsapitest.c +++ b/test/cmsapitest.c @@ -13,6 +13,7 @@ #include <openssl/bio.h> #include <openssl/x509.h> #include <openssl/pem.h> +#include "../crypto/cms/cms_local.h" /* for access to cms->d.signedData */ #include "testutil.h" @@ -81,8 +82,9 @@ static int test_encrypt_decrypt_aes_256_gcm(void) static int test_d2i_CMS_bio_NULL(void) { - BIO *bio; + BIO *bio, *content = NULL; CMS_ContentInfo *cms = NULL; + unsigned int flags = CMS_NO_SIGNER_CERT_VERIFY; int ret = 0; /* @@ -281,9 +283,12 @@ static int test_d2i_CMS_bio_NULL(void) }; ret = TEST_ptr(bio = BIO_new_mem_buf(cms_data, sizeof(cms_data))) - && TEST_ptr(cms = d2i_CMS_bio(bio, NULL)) - && TEST_true(CMS_verify(cms, NULL, NULL, NULL, NULL, - CMS_NO_SIGNER_CERT_VERIFY)); + && TEST_ptr(cms = d2i_CMS_bio(bio, NULL)) + && TEST_true(CMS_verify(cms, NULL, NULL, NULL, NULL, flags)) + && TEST_ptr(content = + CMS_SignedData_verify(cms->d.signedData, NULL, NULL, NULL, + NULL, NULL, flags, NULL, NULL)); + BIO_free(content); CMS_ContentInfo_free(cms); BIO_free(bio); return ret; |