summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Fiala <daniel@openssl.org>2022-03-16 20:30:38 +0100
committerTomas Mraz <tomas@openssl.org>2022-03-22 14:03:29 +0100
commit388d6f4506892a47e69d28232c4b7ebd43706478 (patch)
tree5ab5cf0c6fe5f4246503501318fde19a0e834665 /test
parent3b5b91992ca25bef8575dbd17d7d3a2ca9557e04 (diff)
Make `openssl check -rsa ...` to work for both RSA and RSA-PSS.
Fixes openssl#17167 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17920) (cherry picked from commit 5d1f357a01f668f708c1abd7567175b4a0f18a38)
Diffstat (limited to 'test')
-rw-r--r--test/recipes/15-test_rsapss.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/recipes/15-test_rsapss.t b/test/recipes/15-test_rsapss.t
index 69a5b7b0eb..ea87d8420e 100644
--- a/test/recipes/15-test_rsapss.t
+++ b/test/recipes/15-test_rsapss.t
@@ -16,7 +16,7 @@ use OpenSSL::Test::Utils;
setup("test_rsapss");
-plan tests => 7;
+plan tests => 9;
#using test/testrsa.pem which happens to be a 512 bit RSA
ok(run(app(['openssl', 'dgst', '-sign', srctop_file('test', 'testrsa.pem'), '-sha1',
@@ -64,3 +64,13 @@ ok(run(app(['openssl', 'dgst', '-prverify', srctop_file('test', 'testrsa.pem'),
'-signature', 'testrsapss-unrestricted.sig',
srctop_file('test', 'testrsa.pem')])),
"openssl dgst -prverify [plain RSA key, PSS padding mode, no PSS restrictions]");
+
+# Test that RSA-PSS keys are supported by genpkey and rsa commands.
+{
+ my $rsapss = "rsapss.key";
+ ok(run(app(['openssl', 'genpkey', '-algorithm', 'RSA-PSS',
+ '-pkeyopt', 'rsa_keygen_bits:1024',
+ '--out', $rsapss])));
+ ok(run(app(['openssl', 'rsa', '-check',
+ '-in', $rsapss])));
+}