diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-05-19 19:44:22 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-05-22 14:28:51 +0200 |
commit | 5771017d06be0ba9d82203de0e5ff45b0c616d66 (patch) | |
tree | 8d331bc4c964444a07d4fdcadf21c482b76b3d13 /test/recipes/80-test_cms.t | |
parent | d0ccefdb77f94bec662d75aeadd0b081641abd19 (diff) |
apps/cms.c: Correct -sign output and -verify input with -binary
Also add related warnings on irrelevant use of -nodetach and -content options.
Fixes #15347
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15358)
Diffstat (limited to 'test/recipes/80-test_cms.t')
-rw-r--r-- | test/recipes/80-test_cms.t | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/test/recipes/80-test_cms.t b/test/recipes/80-test_cms.t index 7896bc9b12..193c738a5d 100644 --- a/test/recipes/80-test_cms.t +++ b/test/recipes/80-test_cms.t @@ -818,7 +818,6 @@ subtest "CMS binary input tests\n" => sub { my $cert = srctop_file("test", "certs", "ee-self-signed.pem"); my $key = srctop_file("test", "certs", "ee-key.pem"); - plan skip_all => "Binary input tests currently disabled on Windows" if $^O =~ /^MSWin32$/; plan tests => 11; ok(run(app(["openssl", "cms", "-sign", "-md", "sha256", @@ -829,29 +828,31 @@ subtest "CMS binary input tests\n" => sub { "-binary", "-in", $signed, "-out", $verified])), "verify binary input with -binary"); is(compare($input, $verified), 0, "binary input retained with -binary"); + ok(run(app(["openssl", "cms", "-sign", "-md", "sha256", "-signer", $cert, "-inkey", $key, - "-in", $input, "-out", $signed])), + "-in", $input, "-out", $signed.".nobin"])), "sign binary input without -binary"); ok(run(app(["openssl", "cms", "-verify", "-CAfile", $cert, - "-in", $signed, "-out", $verified])), + "-in", $signed.".nobin", "-out", $verified.".nobin"])), "verify binary input without -binary"); - is(compare($input, $verified), 1, "binary input not retained without -binary"); + is(compare($input, $verified.".nobin"), 1, "binary input not retained without -binary"); ok(!run(app(["openssl", "cms", "-verify", "-CAfile", $cert, "-crlfeol", - "-binary", "-in", $signed, "-out", $verified])), + "-binary", "-in", $signed, "-out", $verified.".crlfeol"])), "verify binary input wrong crlfeol"); ok(run(app(["openssl", "cms", "-sign", "-md", "sha256", "-crlfeol", "-signer", $cert, "-inkey", $key, "-binary", "-in", $input, "-out", $signed.".crlf"])), - "sign binary input crlfeol"); + "sign binary input with -binary -crlfeol"); ok(run(app(["openssl", "cms", "-verify", "-CAfile", $cert, "-crlfeol", "-binary", "-in", $signed.".crlf", "-out", $verified.".crlf"])), - "verify binary input crlfeol"); - is(compare($input, $verified.".crlf"), 0); + "verify binary input with -binary -crlfeol"); + is(compare($input, $verified.".crlf"), 0, + "binary input retained with -binary -crlfeol"); ok(!run(app(["openssl", "cms", "-verify", "-CAfile", $cert, - "-binary", "-in", $signed.".crlf", "-out", $verified.".crlf"])), - "verify binary input missing crlfeol"); + "-binary", "-in", $signed.".crlf", "-out", $verified.".crlf2"])), + "verify binary input with -binary missing -crlfeol"); }; sub check_availability { |