summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-04-01 06:40:33 +0200
committerRichard Levitte <levitte@openssl.org>2019-04-10 07:50:17 +0200
commit5fba3afad01707f4a8856a35500de007a8a256ec (patch)
treef00f25de2eced91b761980504b57f690d5756ea1 /crypto
parent0c45bd8dae287a286583dca682eafcfa5a5d4469 (diff)
Rework DSO API conditions and configuration option
'no-dso' is meaningless, as it doesn't get any macro defined. Therefore, we remove all checks of OPENSSL_NO_DSO. However, there may be some odd platforms with no DSO scheme. For those, we generate the internal macro DSO_NONE aand use it. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8622)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/dso/dso_openssl.c2
-rw-r--r--crypto/include/internal/dso_conf.h.in5
-rw-r--r--crypto/init.c10
3 files changed, 8 insertions, 9 deletions
diff --git a/crypto/dso/dso_openssl.c b/crypto/dso/dso_openssl.c
index 6626331e92..eeebd98087 100644
--- a/crypto/dso/dso_openssl.c
+++ b/crypto/dso/dso_openssl.c
@@ -9,7 +9,7 @@
#include "dso_locl.h"
-#if !defined(DSO_VMS) && !defined(DSO_DLCFN) && !defined(DSO_DL) && !defined(DSO_WIN32) && !defined(DSO_DLFCN)
+#ifdef DSO_NONE
static DSO_METHOD dso_meth_null = {
"NULL shared library method"
diff --git a/crypto/include/internal/dso_conf.h.in b/crypto/include/internal/dso_conf.h.in
index d6e9d1b1ba..17fae7d802 100644
--- a/crypto/include/internal/dso_conf.h.in
+++ b/crypto/include/internal/dso_conf.h.in
@@ -10,7 +10,6 @@
#ifndef HEADER_DSO_CONF_H
# define HEADER_DSO_CONF_H
-{- output_off() if $disabled{dso} -}
{- # The DSO code currently always implements all functions so that no
# applications will have to worry about that from a compilation point
# of view. However, the "method"s may return zero unless that platform
@@ -18,6 +17,9 @@
# by a define "DSO_<name>" ... we translate the "dso_scheme" config
# string entry into using the following logic;
my $scheme = uc $target{dso_scheme};
+ if (!$scheme) {
+ $scheme = "NONE";
+ }
my @macros = ( "DSO_$scheme" );
if ($scheme eq 'DLFCN') {
@macros = ( "DSO_DLFCN", "HAVE_DLFCN_H" );
@@ -26,5 +28,4 @@
}
join("\n", map { "# define $_" } @macros); -}
# define DSO_EXTENSION "{- $target{dso_extension} -}"
-{- output_on() if $disabled{dso} -}
#endif
diff --git a/crypto/init.c b/crypto/init.c
index afb213315e..62626a707e 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -161,8 +161,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_nodelete)
#ifdef OPENSSL_INIT_DEBUG
fprintf(stderr, "OPENSSL_INIT: ossl_init_load_crypto_nodelete()\n");
#endif
-#if !defined(OPENSSL_NO_DSO) \
- && !defined(OPENSSL_USE_NODELETE) \
+#if !defined(OPENSSL_USE_NODELETE) \
&& !defined(OPENSSL_NO_PINSHARED)
# if defined(DSO_WIN32) && !defined(_WIN32_WCE)
{
@@ -180,7 +179,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_nodelete)
# endif
return (ret == TRUE) ? 1 : 0;
}
-# else
+# elif !defined(DSO_NONE)
/*
* Deliberately leak a reference to ourselves. This will force the library
* to remain loaded until the atexit() handler is run at process exit.
@@ -764,8 +763,7 @@ int OPENSSL_atexit(void (*handler)(void))
{
OPENSSL_INIT_STOP *newhand;
-#if !defined(OPENSSL_NO_DSO) \
- && !defined(OPENSSL_USE_NODELETE)\
+#if !defined(OPENSSL_USE_NODELETE)\
&& !defined(OPENSSL_NO_PINSHARED)
{
union {
@@ -790,7 +788,7 @@ int OPENSSL_atexit(void (*handler)(void))
if (!ret)
return 0;
}
-# else
+# elif !defined(DSO_NONE)
/*
* Deliberately leak a reference to the handler. This will force the
* library/code containing the handler to remain loaded until we run the