summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-08-19 08:55:53 +0200
committerRichard Levitte <levitte@openssl.org>2019-09-26 22:41:47 +0200
commit318e074e1f55c556d0ab4f9e3fbdca7c9b284847 (patch)
tree81f256ac53a6438e82cf54535e2cafacd00aab1b /providers
parent03f30c552a07eb7686a9fc099b06653548afa941 (diff)
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@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9637)
Diffstat (limited to 'providers')
-rw-r--r--providers/build.info17
-rw-r--r--providers/legacy/build.info8
-rw-r--r--providers/legacy/digests/build.info16
-rw-r--r--providers/legacy/legacyprov.c5
4 files changed, 33 insertions, 13 deletions
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;