summaryrefslogtreecommitdiff
path: root/test/recipes/20-test_enc.t
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-12-02 12:45:47 +0000
committerMatt Caswell <matt@openssl.org>2020-12-11 10:56:22 +0000
commit81959b26a31bfa807f80d43234db2168f80784c2 (patch)
tree05c66b4eb9a81b8fdd05923d5b455afe3ce63930 /test/recipes/20-test_enc.t
parent39e3daeead143f5599ec58d52ff54cbde3cf27d4 (diff)
downloadopenssl-new-81959b26a31bfa807f80d43234db2168f80784c2.tar.gz
Skip testing ciphers in the legacy provider if no legacy
test_enc should not test ciphers that are not available due to a lack of the legacy provider Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13595)
Diffstat (limited to 'test/recipes/20-test_enc.t')
-rw-r--r--test/recipes/20-test_enc.t8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/recipes/20-test_enc.t b/test/recipes/20-test_enc.t
index 003b1fc344..8cd4cf98b7 100644
--- a/test/recipes/20-test_enc.t
+++ b/test/recipes/20-test_enc.t
@@ -15,6 +15,7 @@ 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_enc");
@@ -27,13 +28,16 @@ my $test = catfile(".", "p");
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 =
map { s/^\s+//; s/\s+$//; split /\s+/ }
run(app([$cmd, "list", "-cipher-commands"]),
capture => 1, statusvar => \$ciphersstatus);
+@ciphers = grep {!/^(bf|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)*2;