diff options
author | Matt Caswell <matt@openssl.org> | 2022-12-14 17:15:18 +0000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-02-03 12:38:44 +0100 |
commit | f596ec8a6f9f5fcfa8e46a73b60f78a609725294 (patch) | |
tree | d684861195087d85ef92c2ca8ad81e87f458b830 /test/recipes | |
parent | 8818064ce3c3c0f1b740a5aaba2a987e75bfbafd (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')
-rw-r--r-- | test/recipes/80-test_cms.t | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/recipes/80-test_cms.t b/test/recipes/80-test_cms.t index 610f1cbc51..fd53683e6b 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 => 14; +plan tests => 15; ok(run(test(["pkcs7_test"])), "test pkcs7"); @@ -972,3 +972,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"); + }); |