[openssl] master update

tmraz at fedoraproject.org tmraz at fedoraproject.org
Wed Jan 20 12:13:22 UTC 2021


The branch master has been updated
       via  3d63348a871d2319f7ff3512f97fd660fa7fadea (commit)
       via  ac6ea3a7c5f53dad710987aae289a66a2e3f159e (commit)
      from  07b6068d240fb5af56fab880f2f971293a49f124 (commit)


- Log -----------------------------------------------------------------
commit 3d63348a871d2319f7ff3512f97fd660fa7fadea
Author: Jon Spillett <jon.spillett at oracle.com>
Date:   Tue Jan 19 13:43:35 2021 +1000

    apps/genpkey.c: Use PEM_read_bio_Parameters_ex when reading parameters
    
    Needed to be able to set the libctx and propq.
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/13894)

commit ac6ea3a7c5f53dad710987aae289a66a2e3f159e
Author: Jon Spillett <jon.spillett at oracle.com>
Date:   Thu Aug 20 15:10:21 2020 +1000

    test-gendsa: Add test cases with FIPS provider
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/13894)

-----------------------------------------------------------------------

Summary of changes:
 apps/genpkey.c                |  2 +-
 test/recipes/15-test_gendsa.t | 52 ++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/apps/genpkey.c b/apps/genpkey.c
index 523ec1da8f..68dbbf87eb 100644
--- a/apps/genpkey.c
+++ b/apps/genpkey.c
@@ -252,7 +252,7 @@ static int init_keygen_file(EVP_PKEY_CTX **pctx, const char *file, ENGINE *e,
         return 0;
     }
 
-    pkey = PEM_read_bio_Parameters(pbio, NULL);
+    pkey = PEM_read_bio_Parameters_ex(pbio, NULL, libctx, propq);
     BIO_free(pbio);
 
     if (pkey == NULL) {
diff --git a/test/recipes/15-test_gendsa.t b/test/recipes/15-test_gendsa.t
index 5e36109b37..4616deacc1 100644
--- a/test/recipes/15-test_gendsa.t
+++ b/test/recipes/15-test_gendsa.t
@@ -11,15 +11,25 @@ use strict;
 use warnings;
 
 use File::Spec;
-use OpenSSL::Test qw/:DEFAULT srctop_file/;
+use OpenSSL::Test qw/:DEFAULT srctop_file srctop_dir bldtop_dir bldtop_file/;
 use OpenSSL::Test::Utils;
 
-setup("test_gendsa");
+BEGIN {
+    setup("test_gendsa");
+}
+
+use lib srctop_dir('Configurations');
+use lib bldtop_dir('.');
+use platform;
 
 plan skip_all => "This test is unsupported in a no-dsa build"
     if disabled("dsa");
 
-plan tests => 11;
+my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
+
+plan tests =>
+    ($no_fips ? 0 : 3)          # FIPS install test + fips related tests
+    + 11;
 
 ok(run(app([ 'openssl', 'genpkey', '-genparam',
              '-algorithm', 'DSA',
@@ -97,3 +107,39 @@ ok(run(app([ 'openssl', 'genpkey',
 ok(!run(app([ 'openssl', 'genpkey',
               '-algorithm', 'DSA'])),
    "genpkey DSA with no params should fail");
+
+unless ($no_fips) {
+    my $provconf = srctop_file("test", "fips-and-base.cnf");
+    my $provpath = bldtop_dir("providers");
+    my @prov = ( "-provider-path", $provpath,
+                 "-config", $provconf);
+    my $infile = bldtop_file('providers', platform->dso('fips'));
+
+    ok(run(app(['openssl', 'fipsinstall',
+                '-out', bldtop_file('providers', 'fipsmodule.cnf'),
+                '-module', $infile,
+                '-provider_name', 'fips', '-mac_name', 'HMAC',
+                '-section_name', 'fips_sect'])),
+       "fipsinstall");
+
+    $ENV{OPENSSL_TEST_LIBCTX} = "1";
+
+    # Generate params
+    ok(run(app(['openssl', 'genpkey',
+                @prov,
+               '-genparam',
+               '-algorithm', 'DSA',
+               '-pkeyopt', 'pbits:3072',
+               '-pkeyopt', 'qbits:256',
+               '-out', 'gendsatest3072params.pem'])),
+       "Generating 3072-bit DSA params");
+
+    # Generate keypair
+    ok(run(app(['openssl', 'genpkey',
+                @prov,
+               '-paramfile', 'gendsatest3072params.pem',
+               '-text',
+               '-out', 'gendsatest3072.pem'])),
+       "Generating 3072-bit DSA keypair");
+
+}


More information about the openssl-commits mailing list