Add a CMS test for a bad encryption algorithm
@@ -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 => 16;
+plan tests => 17;
ok(run(test(["pkcs7_test"])), "test pkcs7");
@@ -887,6 +887,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;
