summaryrefslogtreecommitdiffstats
path: root/test/recipes/80-test_cms.t
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-12-14 17:15:18 +0000
committerTomas Mraz <tomas@openssl.org>2023-02-07 17:05:10 +0100
commit625faca931957719c76fb16094cf5b6e0debe23f (patch)
tree4aa05baa9f7a8b4e7d2c988b0785fb5a8ca8cb04 /test/recipes/80-test_cms.t
parent9cc85002a1138235bdc272b837d7eb32d6b7aa95 (diff)
Check CMS failure during BIO setup with -stream is handled correctly
Test for the issue fixed in the previous commit Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
Diffstat (limited to 'test/recipes/80-test_cms.t')
-rw-r--r--test/recipes/80-test_cms.t15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/recipes/80-test_cms.t b/test/recipes/80-test_cms.t
index 01947b4977..dba5b52b60 100644
--- a/test/recipes/80-test_cms.t
+++ b/test/recipes/80-test_cms.t
@@ -13,7 +13,7 @@ use warnings;
use POSIX;
use File::Spec::Functions qw/catfile/;
use File::Compare qw/compare_text compare/;
-use OpenSSL::Test qw/:DEFAULT srctop_dir srctop_file bldtop_dir bldtop_file/;
+use OpenSSL::Test qw/:DEFAULT srctop_dir srctop_file bldtop_dir bldtop_file with/;
use OpenSSL::Test::Utils;
@@ -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 => 17;
+plan tests => 18;
ok(run(test(["pkcs7_test"])), "test pkcs7");
@@ -1110,3 +1110,14 @@ ok(!run(app(['openssl', 'cms', '-verify',
"SignedInvalidMappingFromanyPolicyTest7.eml")
])),
"issue#19643");
+
+# Check that we get the expected failure return code
+with({ exit_checker => sub { return shift == 6; } },
+ sub {
+ ok(run(app(['openssl', 'cms', '-encrypt',
+ '-in', srctop_file("test", "smcont.txt"),
+ '-stream', '-recip',
+ srctop_file("test/smime-certs", "badrsa.pem"),
+ ])),
+ "Check failure during BIO setup with -stream is handled correctly");
+ });