From: Matt Caswell Date: Wed, 2 Dec 2020 12:56:16 +0000 (+0000) Subject: Don't load the legacy provider if not available in test_enc_more X-Git-Tag: openssl-3.0.0-alpha10~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2130201f19f74d6d8bbd19e20a6fe33f95d49c6;p=thirdparty%2Fopenssl.git Don't load the legacy provider if not available in test_enc_more If the legacy provider isn't available then we shouldn't attempt to load or use it. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/13595) --- diff --git a/test/recipes/20-test_enc_more.t b/test/recipes/20-test_enc_more.t index 27fc901a160..0bddac00ebd 100644 --- a/test/recipes/20-test_enc_more.t +++ b/test/recipes/20-test_enc_more.t @@ -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;