]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
TEST: Ensure that the base provider i activated when needed
authorRichard Levitte <levitte@openssl.org>
Sun, 30 Aug 2020 07:53:22 +0000 (09:53 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 3 Sep 2020 15:48:33 +0000 (17:48 +0200)
The fips providers can't be activated alone if encoding, decoding or
STORE are going to be used.

To enable this, we selectively use test/fips-and-base.cnf instead of
test/fips.cnf in our test recipes.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12587)

test/recipes/15-test_genrsa.t
test/recipes/15-test_rsaoaep.t
test/recipes/30-test_evp.t
test/recipes/65-test_cmp_client.t
test/recipes/65-test_cmp_msg.t
test/recipes/65-test_cmp_protect.t
test/recipes/80-test_cms.t
test/recipes/80-test_ssl_new.t
test/recipes/80-test_ssl_old.t
test/recipes/90-test_sslapi.t

index 90880be9fcadd1002b4c0b32e0e04f0f0d862e5d..ffa334f15eb051574e4ad94509abb1e39a066407 100644 (file)
@@ -117,10 +117,9 @@ ok(!run(app([ 'openssl', 'genpkey', '-algorithm', 'RSA',
 }
 
 unless ($no_fips) {
-    my $provconf = srctop_file("test", "fips.cnf");
+    my $provconf = srctop_file("test", "fips-and-base.cnf");
     my $provpath = bldtop_dir("providers");
     my @prov = ( "-provider-path", $provpath,
-                 "-provider", "base",
                  "-config", $provconf);
     my $infile = bldtop_file('providers', platform->dso('fips'));
 
index 60d9b44f4fccae85b4be24bc801f93614b23da48..59646bd223e99dd3a213a9086c5e1840240941cf 100644 (file)
@@ -27,7 +27,7 @@ plan tests =>
     + 9;
 
 my @prov = ( );
-my $provconf = srctop_file("test", "fips.cnf");
+my $provconf = srctop_file("test", "fips-and-base.cnf");
 my $provpath = bldtop_dir("providers");
 my $msg_file = data_file("plain_text");
 my $enc1_file = "enc1.bin";
index a49f4b50aae47179ab27cadba026590391e574d0..c80fdd9a879b4d644c7d5861ac66b7f3e4844ab1 100644 (file)
@@ -29,7 +29,7 @@ my $defaultcnf = $no_legacy ? 'default.cnf' : 'default-and-legacy.cnf';
 
 my @configs = ( $defaultcnf );
 # Only add the FIPS config if the FIPS module has been built
-push @configs, 'fips.cnf' unless $no_fips;
+push @configs, 'fips-and-base.cnf' unless $no_fips;
 
 # A list of tests that run with both the default and fips provider.
 my @files = qw(
index de60599cf0e3b2602adfc4744263b29ff3f44722..a25be81996ed32a1eada647c9a98c6d6721cf118 100644 (file)
@@ -44,5 +44,5 @@ unless ($no_fips) {
                 '-module', bldtop_file('providers', platform->dso('fips'))])),
        "fipsinstall");
 
-    ok(run(test([@basic_cmd, "fips", srctop_file("test", "fips.cnf")])));
+    ok(run(test([@basic_cmd, "fips", srctop_file("test", "fips-and-base.cnf")])));
 }
index 0347c1a2a93ae211bdb726288290ac8f7e359fef..b74b2dc2edb48f146f28a2bd4c9432592e87d908 100644 (file)
@@ -42,5 +42,6 @@ unless ($no_fips) {
                 '-module', bldtop_file('providers', platform->dso('fips'))])),
        "fipsinstall");
 
-    ok(run(test([@basic_cmd, "fips", srctop_file("test", "fips.cnf")])));
+    ok(run(test([@basic_cmd,
+                 "fips", srctop_file("test", "fips-and-base.cnf")])));
 }
index 19185e112bcbf7bd984d6006a0c67c62cd4919ac..eb8e75d485fdd5853d3cee1dd6822768f4ef2521 100644 (file)
@@ -52,5 +52,6 @@ unless ($no_fips) {
                 '-module', bldtop_file('providers', platform->dso('fips'))])),
        "fipsinstall");
 
-    ok(run(test([@basic_cmd, "fips", srctop_file("test", "fips.cnf")])));
+    ok(run(test([@basic_cmd,
+                 "fips", srctop_file("test", "fips-and-base.cnf")])));
 }
index cdd5ec15a8c8491ac800176121ca99aa20ac7f56..1edddb2a8293c70540a3d8b2fa229371123b72be 100644 (file)
@@ -59,7 +59,7 @@ unless ($no_fips) {
                 '-out', bldtop_file('providers', 'fipsmodule.cnf'),
                 '-module', $infile])),
        "fipsinstall");
-    @config = ( "-config", srctop_file("test", "fips.cnf") );
+    @config = ( "-config", srctop_file("test", "fips-and-base.cnf") );
     $provname = 'fips';
 }
 
index 6051adbfb2d44c6407858ab9cfe99d6a6f2f11f9..e2b9349d04d0b870d094acf91346d62c12b19ab8 100644 (file)
@@ -171,7 +171,7 @@ sub test_conf {
 
       if ($provider eq "fips") {
           ok(run(test(["ssl_test", $output_file, $provider,
-                       srctop_file("test", "fips.cnf")])),
+                       srctop_file("test", "fips-and-base.cnf")])),
              "running ssl_test $conf");
       } else {
           ok(run(test(["ssl_test", $output_file, $provider])),
index 210346cb70e31a6d5ce6de6263222f98f1e631ea..a4d84c9b5cba4bb50f2eb6cc6b19f05b4483c88a 100644 (file)
@@ -106,7 +106,8 @@ subtest 'test_ss' => sub {
 note('test_ssl -- key U');
 testssl("keyU.ss", $Ucert, $CAcert, "default", srctop_file("test","default.cnf"));
 unless ($no_fips) {
-    testssl("keyU.ss", $Ucert, $CAcert, "fips", srctop_file("test","fips.cnf"));
+    testssl("keyU.ss", $Ucert, $CAcert, "fips",
+            srctop_file("test","fips-and-base.cnf"));
 }
 
 # -----------
index 9af8435f6e8659d0b62326e5f6439564bdb29f8a..8cef077a66136ae86a6f176465714cc5d657cc6e 100644 (file)
@@ -45,7 +45,7 @@ unless ($no_fips) {
     ok(run(test(["sslapitest", srctop_dir("test", "certs"),
                  srctop_file("test", "recipes", "90-test_sslapi_data",
                              "passwd.txt"), $tmpfilename, "fips",
-                 srctop_file("test", "fips.cnf")])),
+                 srctop_file("test", "fips-and-base.cnf")])),
                  "running sslapitest");
 }