]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Don't use the legacy provider in test_store if its not available
authorMatt Caswell <matt@openssl.org>
Wed, 2 Dec 2020 13:09:28 +0000 (13:09 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 11 Dec 2020 10:56:34 +0000 (10:56 +0000)
If we don't have the legacy provider then we avoid having to use it.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13595)

test/recipes/90-test_store.t

index a36a59fd8b42cdccbc31c4a95a7afda3174b4248..a61ed5b51e694fdc1a43663390a99b59b5f1105e 100644 (file)
@@ -19,7 +19,7 @@ setup($test_name);
 my $mingw = config('target') =~ m|^mingw|;
 
 my $use_md5 = !disabled("md5");
-my $use_des = !disabled("des"); # also affects 3des and pkcs12 app
+my $use_des = !(disabled("des") || disabled("legacy")); # also affects 3des and pkcs12 app
 my $use_dsa = !disabled("dsa");
 my $use_ecc = !disabled("ec");
 
@@ -97,7 +97,9 @@ my @noexist_file_files =
 # @methods is a collection of extra 'openssl storeutl' arguments used to
 # try the different methods.
 my @methods;
-push @methods, [qw(-provider default -provider legacy)];
+my @prov_method = qw(-provider default);
+push @prov_method, qw(-provider legacy) unless disabled('legacy');
+push @methods, [ @prov_method ];
 push @methods, [qw(-engine loader_attic)]
     unless disabled('dynamic-engine') || disabled('deprecated-3.0');
 
@@ -291,7 +293,9 @@ indir "store_$$" => sub {
 sub init {
     my $cnf = srctop_file('test', 'ca-and-certs.cnf');
     my $cakey = srctop_file('test', 'certs', 'ca-key.pem');
-    my @std_args = qw(-provider default -provider legacy);
+    my @std_args = qw(-provider default);
+    push @std_args, qw(-provider legacy)
+        unless disabled('legacy');
     return (
             # rsa-key-pkcs1.pem
             run(app(["openssl", "pkey", @std_args,