diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-03-12 19:45:40 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-03-18 07:03:53 +0100 |
commit | 63b64f19c13d59d68dc2e525f454aea62a739842 (patch) | |
tree | a0eb5a23182f4d056dcb435dadf4c96fb50e76c1 /test | |
parent | bef876f97e26309ccd20f916cf1e5e305735ee98 (diff) |
TS and CMS CAdES-BES: Refactor check_signing_certs() funcs into common ESS func
Also constify related CMS/PKCS7 functions and improve error codes thrown.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14503)
Diffstat (limited to 'test')
-rw-r--r-- | test/recipes/80-test_cms.t | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/recipes/80-test_cms.t b/test/recipes/80-test_cms.t index 8e3275c2e5..1837a51bbe 100644 --- a/test/recipes/80-test_cms.t +++ b/test/recipes/80-test_cms.t @@ -451,10 +451,11 @@ my @smime_cms_cades_tests = ( ); my @smime_cms_cades_ko_tests = ( - [ "signed content DER format, RSA key, but verified as CAdES-BES compatible", + [ "sign content DER format, RSA key, not CAdES-BES compatible", [ @prov, "-sign", "-in", $smcont, "-outform", "DER", "-nodetach", "-certfile", catfile($smdir, "smroot.pem"), "-signer", catfile($smdir, "smrsa1.pem"), "-out", "{output}.cms" ], + "fail to verify token because requiring CAdES-BES compatibility", [ @prov, "-verify", "-cades", "-in", "{output}.cms", "-inform", "DER", "-CAfile", catfile($smdir, "smroot.pem"), "-out", "{output}.txt" ], \&final_compare @@ -798,16 +799,15 @@ subtest "CAdES; cms incompatible arguments tests\n" => sub { }; subtest "CAdES ko tests\n" => sub { - plan tests => (scalar @smime_cms_cades_ko_tests); + plan tests => 2 * scalar @smime_cms_cades_ko_tests; foreach (@smime_cms_cades_ko_tests) { SKIP: { my $skip_reason = check_availability($$_[0]); skip $skip_reason, 1 if $skip_reason; - ok(run(app(["openssl", "cms", @{$$_[1]}])) - && !run(app(["openssl", "cms", @{$$_[2]}])), - $$_[0]); + ok(run(app(["openssl", "cms", @{$$_[1]}])), $$_[0]); + ok(!run(app(["openssl", "cms", @{$$_[3]}])), $$_[2]); } } }; |