From 323c47532ea7fc79d5e28a0fa58ea0cc4d5196b8 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Fri, 27 Jan 2023 14:31:45 +0100 Subject: APPS/{storeutl,gendsa}: give error on extra arguments, improve doc Point out that options must be given before the final file/URI arg. Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20156) --- test/recipes/15-test_gendsa.t | 10 +++++++++- test/recipes/90-test_store.t | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'test/recipes') diff --git a/test/recipes/15-test_gendsa.t b/test/recipes/15-test_gendsa.t index b495b08bda..00423ce12f 100644 --- a/test/recipes/15-test_gendsa.t +++ b/test/recipes/15-test_gendsa.t @@ -28,7 +28,7 @@ my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0); plan tests => ($no_fips ? 0 : 2) # FIPS related tests - + 11; + + 13; ok(run(app([ 'openssl', 'genpkey', '-genparam', '-algorithm', 'DSA', @@ -107,6 +107,14 @@ ok(!run(app([ 'openssl', 'genpkey', '-algorithm', 'DSA'])), "genpkey DSA with no params should fail"); +ok(run(app(["openssl", "gendsa", "-verbose", + 'dsagen.pem'])), + "gendsa with -verbose option and dsagen parameter"); + +ok(!run(app(["openssl", "gendsa", + 'dsagen.pem', "-verbose"])), + "gendsa with extra parameter (at end) should fail"); + unless ($no_fips) { my $provconf = srctop_file("test", "fips-and-base.cnf"); my $provpath = bldtop_dir("providers"); diff --git a/test/recipes/90-test_store.t b/test/recipes/90-test_store.t index 3af8178e89..c0bf1d1bb0 100644 --- a/test/recipes/90-test_store.t +++ b/test/recipes/90-test_store.t @@ -106,7 +106,7 @@ push @methods, [ @prov_method ]; push @methods, [qw(-engine loader_attic)] unless disabled('loadereng'); -my $n = scalar @methods +my $n = 2 + scalar @methods * ( (3 * scalar @noexist_files) + (6 * scalar @src_files) + (2 * scalar @data_files) @@ -131,6 +131,14 @@ plan skip_all => "No plan" if $n == 0; plan tests => $n; +my $test_x509 = srctop_file('test', 'testx509.pem'); + +ok(run(app(["openssl", "storeutl", "-crls", $test_x509])), + "storeutil with -crls option"); + +ok(!run(app(["openssl", "storeutl", $test_x509, "-crls"])), + "storeutil with extra parameter (at end) should fail"); + indir "store_$$" => sub { if ($do_test_ossltest_store) { # ossltest loads PEM files, with names prefixed with 'ot:'. -- cgit v1.2.1