Skip to content

Commit c59f5f1

Browse files
committed
Make test_ssl_new execute tests with fips provider again
This has regressed with #24799 The test configs have to be generated differently based on the fips provider version. Reviewed-by: Tim Hudson <[email protected]> Reviewed-by: Neil Horman <[email protected]> (Merged from #26715)
1 parent 6ab8772 commit c59f5f1

10 files changed

+318
-282
lines changed

test/generate_ssl_tests.pl

+19-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use File::Basename;
1616
use File::Spec::Functions;
1717

18-
use OpenSSL::Test qw/srctop_dir srctop_file/;
18+
use OpenSSL::Test qw/srctop_dir srctop_file run test/;
1919
use OpenSSL::Test::Utils;
2020

2121
use FindBin;
@@ -136,10 +136,26 @@ sub print_templates {
136136
sub read_config {
137137
my $fname = shift;
138138
my $provider = shift;
139-
local $ssltests::fips_mode = $provider eq "fips";
139+
140+
my $fips_mode = $provider eq "fips";
141+
local $ssltests::fips_3_4 = 0;
142+
local $ssltests::fips_3_5 = 0;
143+
144+
if ($fips_mode) {
145+
my $provconf = srctop_file("test", "fips-and-base.cnf");
146+
my $exit;
147+
148+
run(test(["fips_version_test", "-config", $provconf, ">=3.4.0"]),
149+
capture => 1, statusvar => \$exit);
150+
$ssltests::fips_3_4 = $exit;
151+
run(test(["fips_version_test", "-config", $provconf, ">=3.5.0"]),
152+
capture => 1, statusvar => \$exit);
153+
$ssltests::fips_3_5 = $exit;
154+
}
155+
156+
local $ssltests::fips_mode = $fips_mode;
140157
local $ssltests::no_deflt_libctx =
141158
$provider eq "default" || $provider eq "fips";
142-
143159
open(INPUT, "< $fname") or die "Can't open input file '$fname'!\n";
144160
local $/ = undef;
145161
my $content = <INPUT>;

test/recipes/80-test_ssl_new.t

-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use lib srctop_dir('Configurations');
2828
use lib bldtop_dir('.');
2929

3030
my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
31-
my $dsaallow = '1';
3231

3332
$ENV{TEST_CERTS_DIR} = srctop_dir("test", "certs");
3433

@@ -49,12 +48,6 @@ map { s/;.*// } @conf_srcs if $^O eq "VMS";
4948
my @conf_files = map { basename($_, ".in") } @conf_srcs;
5049
map { s/\^// } @conf_files if $^O eq "VMS";
5150

52-
unless ($no_fips) {
53-
my $provconf = srctop_file("test", "fips-and-base.cnf");
54-
run(test(["fips_version_test", "-config", $provconf, "<3.4.0"]),
55-
capture => 1, statusvar => \$dsaallow);
56-
}
57-
5851
# Some test results depend on the configuration of enabled protocols. We only
5952
# verify generated sources in the default configuration.
6053
my $is_default_tls = (disabled("ssl3") && !disabled("tls1") &&
@@ -184,7 +177,6 @@ sub test_conf {
184177
# Test 3. Run the test.
185178
skip "No tests available; skipping tests", 1 if $skip;
186179
skip "Stale sources; skipping tests", 1 if !$run_test;
187-
skip "Dsa not allowed in FIPS 140-3 provider", 1 if ($provider eq "fips") && ($dsaallow eq '0');
188180

189181
my $msg = "running CTLOG_FILE=test/ct/log_list.cnf". # $ENV{CTLOG_FILE}.
190182
" TEST_CERTS_DIR=test/certs". # $ENV{TEST_CERTS_DIR}.

0 commit comments

Comments
 (0)