summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-12-06 15:12:59 +0000
committerTomas Mraz <tomas@openssl.org>2022-12-22 11:05:50 +0100
commit00323667e3b725be4c193c3242863e3a521ac19e (patch)
tree1efd60ebcd369cbca7be29559c52b1a366840de3 /test
parente979d9aaf5f06fd7aa0935ed9758a2048c3b287c (diff)
Add a CMS test for a bad encryption algorithm
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19919) (cherry picked from commit 0c5fe6e4e740e7150ecb9f0a1954ef085f1fcf10)
Diffstat (limited to 'test')
-rw-r--r--test/recipes/80-test_cms.t20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/recipes/80-test_cms.t b/test/recipes/80-test_cms.t
index c0cdf16aca..9c96ce9bf4 100644
--- a/test/recipes/80-test_cms.t
+++ b/test/recipes/80-test_cms.t
@@ -50,7 +50,7 @@ my ($no_des, $no_dh, $no_dsa, $no_ec, $no_ec2m, $no_rc2, $no_zlib)
$no_rc2 = 1 if disabled("legacy");
-plan tests => 13;
+plan tests => 14;
ok(run(test(["pkcs7_test"])), "test pkcs7");
@@ -836,6 +836,24 @@ subtest "CMS Check that bad attributes fail when verifying signers\n" => sub {
}
};
+subtest "CMS Check that bad encryption algorithm fails\n" => sub {
+ plan tests => 1;
+
+ SKIP: {
+ skip "DES or Legacy isn't supported in this build", 1
+ if disabled("des") || disabled("legacy");
+
+ my $out = "smtst.txt";
+
+ ok(!run(app(["openssl", "cms", @legacyprov, "-encrypt",
+ "-in", $smcont,
+ "-stream", "-recip", $smrsa1,
+ "-des-ede3",
+ "-out", $out ])),
+ "Decrypt message from OpenSSL 1.1.1");
+ }
+};
+
subtest "CMS Decrypt message encrypted with OpenSSL 1.1.1\n" => sub {
plan tests => 1;