From 11920665518bb5fc0487cf1de82fd89e779f5729 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 13 Feb 2020 00:28:31 +0100 Subject: [PATCH] TEST: Modify test/recipes/25-test_req.t to leave artifacts behind Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/11080) --- test/recipes/25-test_req.t | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/test/recipes/25-test_req.t b/test/recipes/25-test_req.t index 075c09db6d..1a6efa8be2 100644 --- a/test/recipes/25-test_req.t +++ b/test/recipes/25-test_req.t @@ -51,13 +51,13 @@ subtest "generating certificate requests with RSA" => sub { ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-new", "-out", "testreq.pem", "-utf8", + "-new", "-out", "testreq-rsa.pem", "-utf8", "-key", srctop_file("test", "testrsa.pem")])), "Generating request"); ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-verify", "-in", "testreq.pem", "-noout"])), + "-verify", "-in", "testreq-rsa.pem", "-noout"])), "Verifying signature on request"); } }; @@ -71,13 +71,13 @@ subtest "generating certificate requests with DSA" => sub { ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-new", "-out", "testreq.pem", "-utf8", + "-new", "-out", "testreq-dsa.pem", "-utf8", "-key", srctop_file("test", "testdsa.pem")])), "Generating request"); ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-verify", "-in", "testreq.pem", "-noout"])), + "-verify", "-in", "testreq-dsa.pem", "-noout"])), "Verifying signature on request"); } }; @@ -91,13 +91,13 @@ subtest "generating certificate requests with ECDSA" => sub { ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-new", "-out", "testreq.pem", "-utf8", + "-new", "-out", "testreq-ec.pem", "-utf8", "-key", srctop_file("test", "testec-p256.pem")])), "Generating request"); ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-verify", "-in", "testreq.pem", "-noout"])), + "-verify", "-in", "testreq-ec.pem", "-noout"])), "Verifying signature on request"); } }; @@ -111,13 +111,13 @@ subtest "generating certificate requests with Ed25519" => sub { ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-new", "-out", "testreq.pem", "-utf8", + "-new", "-out", "testreq-ed25519.pem", "-utf8", "-key", srctop_file("test", "tested25519.pem")])), "Generating request"); ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-verify", "-in", "testreq.pem", "-noout"])), + "-verify", "-in", "testreq-ed25519.pem", "-noout"])), "Verifying signature on request"); } }; @@ -131,13 +131,13 @@ subtest "generating certificate requests with Ed448" => sub { ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-new", "-out", "testreq.pem", "-utf8", + "-new", "-out", "testreq-ed448.pem", "-utf8", "-key", srctop_file("test", "tested448.pem")])), "Generating request"); ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-verify", "-in", "testreq.pem", "-noout"])), + "-verify", "-in", "testreq-ed448.pem", "-noout"])), "Verifying signature on request"); } }; @@ -164,12 +164,12 @@ subtest "generating SM2 certificate requests" => sub { "-config", srctop_file("test", "test.cnf"), "-new", "-key", srctop_file("test", "certs", "sm2.key"), "-sigopt", "sm2_id:1234567812345678", - "-out", "testreq.pem", "-sm3"])), + "-out", "testreq-sm2.pem", "-sm3"])), "Generating SM2 certificate request"); ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-verify", "-in", "testreq.pem", "-noout", + "-verify", "-in", "testreq-sm2.pem", "-noout", "-sm2-id", "1234567812345678", "-sm3"])), "Verifying signature on SM2 certificate request"); @@ -177,12 +177,12 @@ subtest "generating SM2 certificate requests" => sub { "-config", srctop_file("test", "test.cnf"), "-new", "-key", srctop_file("test", "certs", "sm2.key"), "-sigopt", "sm2_hex_id:DEADBEEF", - "-out", "testreq.pem", "-sm3"])), + "-out", "testreq-sm2.pem", "-sm3"])), "Generating SM2 certificate request with hex id"); ok(run(app(["openssl", "req", "-config", srctop_file("test", "test.cnf"), - "-verify", "-in", "testreq.pem", "-noout", + "-verify", "-in", "testreq-sm2.pem", "-noout", "-sm2-hex-id", "DEADBEEF", "-sm3"])), "Verifying signature on SM2 certificate request"); } @@ -195,8 +195,6 @@ run_conversion('req conversions', run_conversion('req conversions -- testreq2', srctop_file("test", "testreq2.pem")); -unlink "testkey.pem", "testreq.pem"; - sub run_conversion { my $title = shift; my $reqfile = shift; -- 2.25.1