]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Don't load the legacy provider if not available in test_enc_more
authorMatt Caswell <matt@openssl.org>
Wed, 2 Dec 2020 12:56:16 +0000 (12:56 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 11 Dec 2020 10:56:22 +0000 (10:56 +0000)
If the legacy provider isn't available then we shouldn't attempt to
load or use it.

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

test/recipes/20-test_enc_more.t

index 27fc901a1607a2c0660a2cd58c3bc9fc280bed5e..0bddac00ebd9149af76239b4ce456cac92383dda 100644 (file)
@@ -16,6 +16,8 @@ use File::Copy;
 use File::Compare qw/compare_text/;
 use File::Basename;
 use OpenSSL::Test qw/:DEFAULT srctop_file bldtop_dir/;
+use OpenSSL::Test::Utils;
+
 
 setup("test_evp_more");
 
@@ -26,7 +28,8 @@ my $plaintext = catfile(".", "testdatafile");
 my $fail = "";
 my $cmd = "openssl";
 my $provpath = bldtop_dir("providers");
-my @prov = ("-provider-path", $provpath, "-provider", "default", "-provider", "legacy");
+my @prov = ("-provider-path", $provpath, "-provider", "default");
+push @prov, ("-provider", "legacy") unless disabled("legacy");
 
 my $ciphersstatus = undef;
 my @ciphers =
@@ -34,6 +37,9 @@ my @ciphers =
          (map { split /\s+/ }
           run(app([$cmd, "enc", "-list"]),
               capture => 1, statusvar => \$ciphersstatus)));
+@ciphers = grep {!/^-(bf|blowfish|cast|des$|des-cbc|des-cfb|des-ecb|des-ofb
+                      |desx|idea|rc2|rc4|seed)/x} @ciphers
+    if disabled("legacy");
 
 plan tests => 2 + scalar @ciphers;