summaryrefslogtreecommitdiffstats
path: root/test/recipes/15-test_gendsa.t
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-08-11 10:15:28 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-08-17 23:40:20 +1000
commit38145fba0a5f6163743f007dd6c9ba1a1e07e4f4 (patch)
treeaf3b5a8ae3d4e004bc6452a1ad3cc3ae96bb2941 /test/recipes/15-test_gendsa.t
parent6c4e2e52d87d61a6df3ddf5f67c7207387585d6c (diff)
Fix DSA/DH so that legacy keys can still be generated by the default provider
Fixes #12589 The 'type' parameter needed to be propagated to the ffc params during keygen, so that the simple validation of params done during keygen can handle legacy keys for the default provider. The fips provider ignores this change and only allows fips186-4 approved sizes. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12623)
Diffstat (limited to 'test/recipes/15-test_gendsa.t')
-rw-r--r--test/recipes/15-test_gendsa.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/recipes/15-test_gendsa.t b/test/recipes/15-test_gendsa.t
index 4344cde95c..4dc387cac5 100644
--- a/test/recipes/15-test_gendsa.t
+++ b/test/recipes/15-test_gendsa.t
@@ -19,7 +19,7 @@ setup("test_gendsa");
plan skip_all => "This test is unsupported in a no-dsa build"
if disabled("dsa");
-plan tests => 8;
+plan tests => 10;
ok(run(app([ 'openssl', 'genpkey', '-genparam',
'-algorithm', 'DSA',
@@ -40,6 +40,13 @@ ok(run(app([ 'openssl', 'genpkey', '-genparam',
'-text'])),
"genpkey DSA params fips186_2");
+ok(run(app([ 'openssl', 'genpkey', '-genparam',
+ '-algorithm', 'DSA',
+ '-pkeyopt', 'type:fips186_2',
+ '-pkeyopt', 'dsa_paramgen_bits:1024',
+ '-out', 'dsagen.legacy.pem'])),
+ "genpkey DSA params fips186_2 PEM");
+
ok(!run(app([ 'openssl', 'genpkey', '-algorithm', 'DSA',
'-pkeyopt', 'type:group',
'-text'])),
@@ -62,6 +69,12 @@ ok(run(app([ 'openssl', 'genpkey', '-genparam',
'-out', 'dsagen.der'])),
"genpkey DSA params fips186_4 DER");
+ok(run(app([ 'openssl', 'genpkey',
+ '-paramfile', 'dsagen.legacy.pem',
+ '-pkeyopt', 'type:fips186_2',
+ '-text'])),
+ "genpkey DSA fips186_2 with PEM params");
+
# The seed and counter should be the ones generated from the param generation
# Just put some dummy ones in to show it works.
ok(run(app([ 'openssl', 'genpkey',