[openssl] master update

Richard Levitte levitte at openssl.org
Thu Sep 26 20:41:55 UTC 2019


The branch master has been updated
       via  318e074e1f55c556d0ab4f9e3fbdca7c9b284847 (commit)
       via  03f30c552a07eb7686a9fc099b06653548afa941 (commit)
      from  a6dd3a3aa2577fa6c3586b96fe0b46be336cff54 (commit)


- Log -----------------------------------------------------------------
commit 318e074e1f55c556d0ab4f9e3fbdca7c9b284847
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Aug 19 08:55:53 2019 +0200

    When building of modules is disabled, build the legacy provider into libcrypto
    
    This makes the legacy provider available regardless of building conditions.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9637)

commit 03f30c552a07eb7686a9fc099b06653548afa941
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Aug 19 08:54:00 2019 +0200

    Configure, build.info: make it possible to use variables in indexes
    
    That will make it possible to assign different goals for translation
    units depending on need.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9637)

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

Summary of changes:
 Configure                           | 31 ++++++++++++++++++++++---------
 crypto/provider_predefined.c        |  7 ++++++-
 providers/build.info                | 17 +++++++++++------
 providers/legacy/build.info         |  8 ++++++--
 providers/legacy/digests/build.info | 16 +++++++++++-----
 providers/legacy/legacyprov.c       |  5 +++++
 6 files changed, 61 insertions(+), 23 deletions(-)

diff --git a/Configure b/Configure
index 4415e1d6bc..3a29d90329 100755
--- a/Configure
+++ b/Configure
@@ -518,7 +518,7 @@ my @disable_cascades = (
     # or modules.
     "pic"               => [ "shared", "module" ],
 
-    "module"            => [ "fips", "legacy" ],
+    "module"            => [ "fips" ],
 
     "engine"            => [ grep /eng$/, @disablables ],
     "hw"                => [ "padlockeng" ],
@@ -1742,11 +1742,19 @@ if ($builder eq "unified") {
             my $value = '';
             my $value_rest = shift;
 
+            if ($ENV{CONFIGURE_DEBUG_VARIABLE_EXPAND}) {
+                print STDERR
+                    "DEBUG[\$expand_variables] Parsed '$value_rest' into:\n"
+            }
             while ($value_rest =~ /(?<!\\)${variable_re}/) {
                 $value .= $`;
                 $value .= $variables{$1};
                 $value_rest = $';
             }
+            if ($ENV{CONFIGURE_DEBUG_VARIABLE_EXPAND}) {
+                print STDERR
+                    "DEBUG[\$expand_variables] ... '$value$value_rest'\n";
+            }
             return $value . $value_rest;
         };
 
@@ -1899,26 +1907,31 @@ if ($builder eq "unified") {
             },
 
             qr/^\s*ORDINALS\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/,
-            => sub { push @{$ordinals{$1}}, tokenize($expand_variables->($2))
+            => sub { push @{$ordinals{$expand_variables->($1)}},
+                         tokenize($expand_variables->($2))
                          if !@skip || $skip[$#skip] > 0 },
             qr/^\s*SOURCE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
-            => sub { push @{$sources{$1}}, tokenize($expand_variables->($2))
+            => sub { push @{$sources{$expand_variables->($1)}},
+                         tokenize($expand_variables->($2))
                          if !@skip || $skip[$#skip] > 0 },
             qr/^\s*SHARED_SOURCE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
-            => sub { push @{$shared_sources{$1}},
+            => sub { push @{$shared_sources{$expand_variables->($1)}},
                          tokenize($expand_variables->($2))
                          if !@skip || $skip[$#skip] > 0 },
             qr/^\s*INCLUDE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
-            => sub { push @{$includes{$1}}, tokenize($expand_variables->($2))
+            => sub { push @{$includes{$expand_variables->($1)}},
+                         tokenize($expand_variables->($2))
                          if !@skip || $skip[$#skip] > 0 },
-            qr/^\s*DEFINE\[((?:\\.|[^\\\]])*)\]\s*=\s*(.*)\s*$/
-            => sub { push @{$defines{$1}}, tokenize($expand_variables->($2))
+            qr/^\s*DEFINE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
+            => sub { push @{$defines{$expand_variables->($1)}},
+                         tokenize($expand_variables->($2))
                          if !@skip || $skip[$#skip] > 0 },
             qr/^\s*DEPEND\[((?:\\.|[^\\\]])*)\]\s*=\s*(.*)\s*$/
-            => sub { push @{$depends{$1}}, tokenize($expand_variables->($2))
+            => sub { push @{$depends{$expand_variables->($1)}},
+                         tokenize($expand_variables->($2))
                          if !@skip || $skip[$#skip] > 0 },
             qr/^\s*GENERATE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
-            => sub { push @{$generate{$1}}, $2
+            => sub { push @{$generate{$expand_variables->($1)}}, $2
                          if !@skip || $skip[$#skip] > 0 },
             qr/^\s*(?:#.*)?$/ => sub { },
             "OTHERWISE" => sub { die "Something wrong with this line:\n$_\nat $sourced/$f" },
diff --git a/crypto/provider_predefined.c b/crypto/provider_predefined.c
index d1423b1c6c..e65f461008 100644
--- a/crypto/provider_predefined.c
+++ b/crypto/provider_predefined.c
@@ -12,12 +12,17 @@
 
 OSSL_provider_init_fn ossl_default_provider_init;
 OSSL_provider_init_fn fips_intern_provider_init;
-
+#ifdef STATIC_LEGACY
+OSSL_provider_init_fn ossl_legacy_provider_init;
+#endif
 const struct predefined_providers_st predefined_providers[] = {
 #ifdef FIPS_MODE
     { "fips", fips_intern_provider_init, 1 },
 #else
     { "default", ossl_default_provider_init, 1 },
+# ifdef STATIC_LEGACY
+    { "legacy", ossl_legacy_provider_init, 0 },
+# endif
 #endif
     { NULL, NULL, 0 }
 };
diff --git a/providers/build.info b/providers/build.info
index 192a5defcc..9642a3c153 100644
--- a/providers/build.info
+++ b/providers/build.info
@@ -15,11 +15,16 @@ ENDIF
 
 IF[{- !$disabled{legacy} -}]
   SUBDIRS=legacy
-  MODULES=legacy
-  IF[{- defined $target{shared_defflag} -}]
-    SOURCE[legacy]=legacy.ld
-    GENERATE[legacy.ld]=../util/providers.num
+  IF[{- $disabled{module} -}]
+    LIBS=../libcrypto
+    DEFINE[../libcrypto]=STATIC_LEGACY
+  ELSE
+    MODULES=legacy
+    IF[{- defined $target{shared_defflag} -}]
+      SOURCE[legacy]=legacy.ld
+      GENERATE[legacy.ld]=../util/providers.num
+    ENDIF
+    DEPEND[legacy]=../libcrypto
+    INCLUDE[legacy]=.. ../include ../crypto/include common/include
   ENDIF
-  INCLUDE[legacy]=.. ../include ../crypto/include common/include
-  DEPEND[legacy]=../libcrypto
 ENDIF
diff --git a/providers/legacy/build.info b/providers/legacy/build.info
index df7e9ac750..713c48dbe6 100644
--- a/providers/legacy/build.info
+++ b/providers/legacy/build.info
@@ -1,4 +1,8 @@
 SUBDIRS=digests
+IF[{- $disabled{module} -}]
+  $GOAL=../../libcrypto
+ELSE
+  $GOAL=../legacy
+ENDIF
 
-SOURCE[../legacy]=\
-        legacyprov.c
+SOURCE[$GOAL]=legacyprov.c
diff --git a/providers/legacy/digests/build.info b/providers/legacy/digests/build.info
index 538afd4c07..2c85970dde 100644
--- a/providers/legacy/digests/build.info
+++ b/providers/legacy/digests/build.info
@@ -1,24 +1,30 @@
+IF[{- $disabled{module} -}]
+  $GOAL=../../../libcrypto
+ELSE
+  $GOAL=../../legacy
+ENDIF
+
 IF[{- !$disabled{md2} -}]
-  SOURCE[../../legacy]=\
+  SOURCE[$GOAL]=\
           md2_prov.c
 ENDIF
 
 IF[{- !$disabled{md4} -}]
-  SOURCE[../../legacy]=\
+  SOURCE[$GOAL]=\
           md4_prov.c
 ENDIF
 
 IF[{- !$disabled{mdc2} -}]
-  SOURCE[../../legacy]=\
+  SOURCE[$GOAL]=\
           mdc2_prov.c
 ENDIF
 
 IF[{- !$disabled{whirlpool} -}]
-  SOURCE[../../legacy]=\
+  SOURCE[$GOAL]=\
           wp_prov.c
 ENDIF
 
 IF[{- !$disabled{rmd160} -}]
-  SOURCE[../../legacy]=\
+  SOURCE[$GOAL]=\
           ripemd_prov.c
 ENDIF
\ No newline at end of file
diff --git a/providers/legacy/legacyprov.c b/providers/legacy/legacyprov.c
index 9b2df1e5e7..89587d632c 100644
--- a/providers/legacy/legacyprov.c
+++ b/providers/legacy/legacyprov.c
@@ -15,6 +15,11 @@
 #include <openssl/params.h>
 #include "internal/provider_algs.h"
 
+#ifdef STATIC_LEGACY
+OSSL_provider_init_fn ossl_legacy_provider_init;
+# define OSSL_provider_init ossl_legacy_provider_init
+#endif
+
 /* Functions provided by the core */
 static OSSL_core_gettable_params_fn *c_gettable_params = NULL;
 static OSSL_core_get_params_fn *c_get_params = NULL;


More information about the openssl-commits mailing list