} OPTION_CHOICE;
const OPTIONS dsaparam_options[] = {
- {OPT_HELP_STR, 1, '-', "Usage: %s [options] [numbits]\n"},
+ {OPT_HELP_STR, 1, '-', "Usage: %s [options] [numbits] [numqbits]\n"},
OPT_SECTION("General"),
{"help", OPT_HELP, '-', "Display this summary"},
OPT_PROV_OPTIONS,
OPT_PARAMETERS(),
- {"numbits", 0, 0, "Number of bits if generating parameters (optional)"},
- {"numqbits", 0, 0, "Number of bits in the subprime parameter q if generating parameters (optional)"},
+ {"numbits", 0, 0, "Number of bits if generating parameters or key (optional)"},
+ {"numqbits", 0, 0, "Number of bits in the subprime parameter q if generating parameters or key (optional)"},
{NULL}
};
release_engine(e);
return ret;
}
-
plan tests =>
($no_fips ? 0 : 2) # FIPS related tests
- + 13;
+ + 18;
ok(run(app([ 'openssl', 'genpkey', '-genparam',
'-algorithm', 'DSA',
'dsagen.pem', "-verbose"])),
"gendsa with extra parameter (at end) should fail");
+# test key generation with dsaparam tool
+ok(run(app([ 'openssl', 'dsaparam',
+ '-genkey',
+ '-text',
+ '1024',
+ ])),
+ "dsaparam -genkey DSA 1024 with default qbits");
+
+ok(run(app([ 'openssl', 'dsaparam',
+ '-genkey',
+ '-text',
+ '2048',
+ ])),
+ "dsaparam -genkey DSA 2048 with default qbits");
+
+ok(run(app([ 'openssl', 'dsaparam',
+ '-genkey',
+ '-text',
+ '1024', '160',
+ ])),
+ "dsaparam -genkey DSA 1024 with 160 qbits");
+
+ok(run(app([ 'openssl', 'dsaparam',
+ '-genkey',
+ '-text',
+ '2048', '224',
+ ])),
+ "dsaparam -genkey DSA 2048 with 224 qbits");
+
+ok(run(app([ 'openssl', 'dsaparam',
+ '-genkey',
+ '-text',
+ '2048', '256',
+ ])),
+ "dsaparam -genkey DSA 2048 with 256 qbits");
+# genkey test for 3072 bits keys were removed to speed up the tests
+
unless ($no_fips) {
my $provconf = srctop_file("test", "fips-and-base.cnf");
my $provpath = bldtop_dir("providers");