From b67d53a52408f626bed5edb4d753cae282399ef7 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 12 Feb 2020 20:29:33 +0100 Subject: [PATCH] TEST: Modify test/recipes/20-test_dgst.t to leave artifacts behind Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/11080) --- test/recipes/20-test_dgst.t | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/recipes/20-test_dgst.t b/test/recipes/20-test_dgst.t index 1080770f53..a319d08ca2 100644 --- a/test/recipes/20-test_dgst.t +++ b/test/recipes/20-test_dgst.t @@ -11,6 +11,7 @@ use strict; use warnings; use File::Spec; +use File::Basename; use OpenSSL::Test qw/:DEFAULT with srctop_file/; use OpenSSL::Test::Utils; @@ -26,29 +27,28 @@ sub tsignverify { my $data_to_sign = srctop_file('test', 'README'); my $other_data = srctop_file('test', 'README.external'); + my $sigfile = basename($privkey, '.pem') . '.sig'; plan tests => 4; ok(run(app(['openssl', 'dgst', '-sign', $privkey, - '-out', 'testdgst.sig', + '-out', $sigfile, $data_to_sign])), $testtext.": Generating signature"); ok(run(app(['openssl', 'dgst', '-prverify', $privkey, - '-signature', 'testdgst.sig', + '-signature', $sigfile, $data_to_sign])), $testtext.": Verify signature with private key"); ok(run(app(['openssl', 'dgst', '-verify', $pubkey, - '-signature', 'testdgst.sig', + '-signature', $sigfile, $data_to_sign])), $testtext.": Verify signature with public key"); ok(!run(app(['openssl', 'dgst', '-verify', $pubkey, - '-signature', 'testdgst.sig', + '-signature', $sigfile, $other_data])), $testtext.": Expect failure verifying mismatching data"); - - unlink 'testdgst.sig'; } SKIP: { -- 2.25.1