From 63b64f19c13d59d68dc2e525f454aea62a739842 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Fri, 12 Mar 2021 19:45:40 +0100 Subject: 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 (Merged from https://github.com/openssl/openssl/pull/14503) --- test/recipes/80-test_cms.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/recipes/80-test_cms.t') 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]); } } }; -- cgit v1.2.3