Have only one DSO_METHOD_openssl
authorRich Salz <rsalz@openssl.org>
Tue, 22 Mar 2016 17:35:03 +0000 (13:35 -0400)
committerRich Salz <rsalz@openssl.org>
Tue, 22 Mar 2016 17:35:03 +0000 (13:35 -0400)
Instead of have every DSO_METHOD_xxx in all platforms, ensure that only
one DSO_METHOD_openssl is available on all platforms.

Reviewed-by: Tim Hudson <tjh@openssl.org>
12 files changed:
crypto/dso/Makefile.in
crypto/dso/build.info
crypto/dso/dso_dl.c
crypto/dso/dso_dlfcn.c
crypto/dso/dso_locl.h
crypto/dso/dso_null.c [deleted file]
crypto/dso/dso_openssl.c
crypto/dso/dso_vms.c
crypto/dso/dso_win32.c
include/openssl/dso.h
util/libcrypto.num
util/libssl.num

index 8c517febce19b2518140cd71ff1a0d0bdae9e9e1..e2fec28d4b223582e94656aad1a1908278874fa0 100644 (file)
@@ -15,9 +15,9 @@ CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 GENERAL=Makefile
 
 LIB=$(TOP)/libcrypto.a
-LIBSRC= dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c dso_null.c \
+LIBSRC= dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c \
        dso_openssl.c dso_win32.c dso_vms.c
-LIBOBJ= dso_dl.o dso_dlfcn.o dso_err.o dso_lib.o dso_null.o \
+LIBOBJ= dso_dl.o dso_dlfcn.o dso_err.o dso_lib.o \
        dso_openssl.o dso_win32.o dso_vms.o
 
 SRC= $(LIBSRC)
index 30b3a280ba8471338aaab8cfed11290b748e6b43..82b592d9a1c73aa5fec67f75b3b75b7dece00958 100644 (file)
@@ -1,4 +1,4 @@
 LIBS=../../libcrypto
 SOURCE[../../libcrypto]=\
-        dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c dso_null.c \
+        dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c \
         dso_openssl.c dso_win32.c dso_vms.c
index 1d6e12adc5a57a5d15601218cf550bb76e0ab2a5..72ca4544aa596fc9447012bc4cc1795cd4f02802 100644 (file)
 
 #include "dso_locl.h"
 
-#ifndef DSO_DL
-DSO_METHOD *DSO_METHOD_dl(void)
-{
-    return NULL;
-}
-#else
+#ifdef DSO_DL
 
 # include <dl.h>
 
@@ -95,9 +90,9 @@ static DSO_METHOD dso_meth_dl = {
     dl_globallookup
 };
 
-DSO_METHOD *DSO_METHOD_dl(void)
+DSO_METHOD *DSO_METHOD_openssl(void)
 {
-    return (&dso_meth_dl);
+    return &dso_meth_dl;
 }
 
 /*
index e69daadc4c3573f058cc9957cbc37fc390fccdab..09a49131ea21f41b8257279a002ec4edc4d36804 100644 (file)
 
 #include "dso_locl.h"
 
-#ifndef DSO_DLFCN
-DSO_METHOD *DSO_METHOD_dlfcn(void)
-{
-    return NULL;
-}
-#else
+#ifdef DSO_DLFCN
 
 # ifdef HAVE_DLFCN_H
 #  ifdef __osf__
@@ -117,9 +112,9 @@ static DSO_METHOD dso_meth_dlfcn = {
     dlfcn_globallookup
 };
 
-DSO_METHOD *DSO_METHOD_dlfcn(void)
+DSO_METHOD *DSO_METHOD_openssl(void)
 {
-    return (&dso_meth_dlfcn);
+    return &dso_meth_dlfcn;
 }
 
 /*
index 980448d25ae17ce9245c495755f7003a53b4bda1..3d7d669d478c30dac8e8a4d185a261b119b37a0d 100644 (file)
@@ -105,4 +105,3 @@ struct dso_meth_st {
     /* Perform global symbol lookup, i.e. among *all* modules */
     void *(*globallookup) (const char *symname);
 };
-
diff --git a/crypto/dso/dso_null.c b/crypto/dso/dso_null.c
deleted file mode 100644 (file)
index ed8bcd7..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project
- * 2000.
- */
-/* ====================================================================
- * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. All advertising materials mentioning features or use of this
- *    software must display the following acknowledgment:
- *    "This product includes software developed by the OpenSSL Project
- *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
- *
- * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
- *    endorse or promote products derived from this software without
- *    prior written permission. For written permission, please contact
- *    licensing@OpenSSL.org.
- *
- * 5. Products derived from this software may not be called "OpenSSL"
- *    nor may "OpenSSL" appear in their names without prior written
- *    permission of the OpenSSL Project.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- *    acknowledgment:
- *    "This product includes software developed by the OpenSSL Project
- *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
- *
- * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- * ====================================================================
- *
- * This product includes cryptographic software written by Eric Young
- * (eay@cryptsoft.com).  This product includes software written by Tim
- * Hudson (tjh@cryptsoft.com).
- *
- */
-
-/*
- * This "NULL" method is provided as the fallback for systems that have no
- * appropriate support for "shared-libraries".
- */
-
-#include "dso_locl.h"
-
-static DSO_METHOD dso_meth_null = {
-    "NULL shared library method",
-    NULL,                       /* load */
-    NULL,                       /* unload */
-    NULL,                       /* bind_var */
-    NULL,                       /* bind_func */
-    NULL,                       /* ctrl */
-    NULL,                       /* dso_name_converter */
-    NULL,                       /* dso_merger */
-    NULL,                       /* init */
-    NULL,                       /* finish */
-    NULL,                       /* pathbyaddr */
-    NULL                        /* globallookup */
-};
-
-DSO_METHOD *DSO_METHOD_null(void)
-{
-    return &dso_meth_null;
-}
index 9b0123b29a99de11af1453bcb0c4c15fdbdb4901..070f1162178be34b73f7333183e7ed9a692d356f 100644 (file)
 
 #include "dso_locl.h"
 
-/* We just pinch the method from an appropriate "default" method. */
+#if !defined(DSO_VMS) && !defined(DSO_DLCFN) && !defined(DSO_DL) && !defined(DSO_WIN32) && !defined(DSO_DLFCN)
+
+static DSO_METHOD dso_meth_null = {
+    "NULL shared library method"
+};
 
 DSO_METHOD *DSO_METHOD_openssl(void)
 {
-#ifdef DEF_DSO_METHOD
-    return (DEF_DSO_METHOD());
-#elif defined(DSO_DLFCN)
-    return (DSO_METHOD_dlfcn());
-#elif defined(DSO_DL)
-    return (DSO_METHOD_dl());
-#elif defined(DSO_WIN32)
-    return (DSO_METHOD_win32());
-#elif defined(DSO_VMS)
-    return (DSO_METHOD_vms());
-#else
-    return (DSO_METHOD_null());
-#endif
+    return dso_meth_null();
 }
+#endif
index 2fd6ffea2d3561c645cd4e1b387e50b49406d216..79e9963a2687d223a47d91c2a6cf459ebb672ca5 100644 (file)
 
 #include "dso_locl.h"
 
-#ifndef OPENSSL_SYS_VMS
-DSO_METHOD *DSO_METHOD_vms(void)
-{
-    return NULL;
-}
-#else
+#ifdef OPENSSL_SYS_VMS
 
 # pragma message disable DOLLARID
 # include <errno.h>
@@ -129,9 +124,9 @@ typedef struct dso_internal_st {
     char imagename[NAMX_MAXRSS + 1];
 } DSO_VMS_INTERNAL;
 
-DSO_METHOD *DSO_METHOD_vms(void)
+DSO_METHOD *DSO_METHOD_openssl(void)
 {
-    return (&dso_meth_vms);
+    return &dso_meth_vms;
 }
 
 static int vms_load(DSO *dso)
index e1d88b1d5ef432a93d68e9993107d50aef9fd675..e378d6894632a94a50e2842291abf15799c47979 100644 (file)
 
 #include "dso_locl.h"
 
-#if !defined(DSO_WIN32)
-DSO_METHOD *DSO_METHOD_win32(void)
-{
-    return NULL;
-}
-#else
+#if defined(DSO_WIN32)
 
 # ifdef _WIN32_WCE
 #  if _WIN32_WCE < 300
@@ -138,9 +133,9 @@ static DSO_METHOD dso_meth_win32 = {
     win32_globallookup
 };
 
-DSO_METHOD *DSO_METHOD_win32(void)
+DSO_METHOD *DSO_METHOD_openssl(void)
 {
-    return (&dso_meth_win32);
+    return &dso_meth_win32;
 }
 
 /*
index 77baf8ae252064eb81a6b57c6a995ad9d6c3bb04..70b19b65e948c4282d1960ff97d12405eff85fe9 100644 (file)
@@ -214,32 +214,6 @@ DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname);
  */
 DSO_METHOD *DSO_METHOD_openssl(void);
 
-/*
- * This method is defined for all platforms - if a platform has no DSO
- * support then this will be the only method!
- */
-DSO_METHOD *DSO_METHOD_null(void);
-
-/*
- * If DSO_DLFCN is defined, the standard dlfcn.h-style functions (dlopen,
- * dlclose, dlsym, etc) will be used and incorporated into this method. If
- * not, this method will return NULL.
- */
-DSO_METHOD *DSO_METHOD_dlfcn(void);
-
-/*
- * If DSO_DL is defined, the standard dl.h-style functions (shl_load,
- * shl_unload, shl_findsym, etc) will be used and incorporated into this
- * method. If not, this method will return NULL.
- */
-DSO_METHOD *DSO_METHOD_dl(void);
-
-/* If WIN32 is defined, use DLLs. If not, return NULL. */
-DSO_METHOD *DSO_METHOD_win32(void);
-
-/* If VMS is defined, use shared images. If not, return NULL. */
-DSO_METHOD *DSO_METHOD_vms(void);
-
 /*
  * This function writes null-terminated pathname of DSO module containing
  * 'addr' into 'sz' large caller-provided 'path' and returns the number of
index 2e2e6571cb90fe66d3e7318c60a34a720afde280..c0918bae15ce74fa4886496ebdc0826d676aaf79 100644 (file)
@@ -138,7 +138,7 @@ X509v3_add_ext                          135 1_1_0   EXIST::FUNCTION:
 v3_addr_subset                          136    1_1_0   EXIST::FUNCTION:RFC3779
 CRYPTO_strndup                          137    1_1_0   EXIST::FUNCTION:
 OCSP_REQ_CTX_free                       138    1_1_0   EXIST::FUNCTION:
-DSO_METHOD_dlfcn                        139    1_1_0   EXIST::FUNCTION:
+DSO_METHOD_dlfcn                        139    1_1_0   NOEXIST::FUNCTION:
 X509_STORE_new                          140    1_1_0   EXIST::FUNCTION:
 ASN1_TYPE_free                          141    1_1_0   EXIST::FUNCTION:
 PKCS12_BAGS_new                         142    1_1_0   EXIST::FUNCTION:
@@ -1491,7 +1491,7 @@ EVP_CIPHER_CTX_set_padding              1444      1_1_0   EXIST::FUNCTION:
 CTLOG_new_from_base64                   1445   1_1_0   EXIST::FUNCTION:CT
 AES_bi_ige_encrypt                      1446   1_1_0   EXIST::FUNCTION:AES
 ERR_pop_to_mark                         1447   1_1_0   EXIST::FUNCTION:
-DSO_METHOD_win32                        1448   1_1_0   EXIST::FUNCTION:
+DSO_METHOD_win32                        1448   1_1_0   NOEXIST::FUNCTION:
 CRL_DIST_POINTS_new                     1449   1_1_0   EXIST::FUNCTION:
 EVP_PKEY_get0_asn1                      1450   1_1_0   EXIST::FUNCTION:
 EVP_camellia_192_ctr                    1451   1_1_0   EXIST::FUNCTION:CAMELLIA
@@ -1888,7 +1888,7 @@ ASN1_VISIBLESTRING_it                   1831      1_1_0   EXIST:!EXPORT_VAR_AS_FUNCTION
 ASN1_VISIBLESTRING_it                   1831   1_1_0   EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:
 X509V3_EXT_REQ_add_conf                 1832   1_1_0   EXIST::FUNCTION:
 ASN1_STRING_to_UTF8                     1833   1_1_0   EXIST::FUNCTION:
-DSO_METHOD_null                         1834   1_1_0   EXIST::FUNCTION:
+DSO_METHOD_null                         1834   1_1_0   NOEXIST::FUNCTION:
 EVP_MD_meth_set_update                  1835   1_1_0   EXIST::FUNCTION:
 EVP_camellia_192_cbc                    1836   1_1_0   EXIST::FUNCTION:CAMELLIA
 lh_stats_bio                            1837   1_1_0   EXIST::FUNCTION:
@@ -3116,7 +3116,7 @@ PEM_read_bio_RSAPublicKey               3009      1_1_0   EXIST::FUNCTION:RSA
 EVP_PKEY_asn1_set_private               3010   1_1_0   EXIST::FUNCTION:
 EVP_PKEY_get0_RSA                       3011   1_1_0   EXIST::FUNCTION:RSA
 DES_ede3_cfb64_encrypt                  3012   1_1_0   EXIST::FUNCTION:DES
-DSO_METHOD_vms                          3013   1_1_0   EXIST::FUNCTION:
+DSO_METHOD_vms                          3013   1_1_0   NOEXIST::FUNCTION:
 POLICY_MAPPING_free                     3014   1_1_0   EXIST::FUNCTION:
 EVP_aes_128_gcm                         3015   1_1_0   EXIST::FUNCTION:AES
 BIO_dgram_non_fatal_error               3016   1_1_0   EXIST::FUNCTION:
@@ -3677,7 +3677,7 @@ EVP_CIPHER_CTX_cipher_data              3561      1_1_0   NOEXIST::FUNCTION:
 PKCS7_decrypt                           3562   1_1_0   EXIST::FUNCTION:
 X509_STORE_set1_param                   3563   1_1_0   EXIST::FUNCTION:
 RAND_file_name                          3564   1_1_0   EXIST::FUNCTION:
-DSO_METHOD_dl                           3565   1_1_0   EXIST::FUNCTION:
+DSO_METHOD_dl                           3565   1_1_0   NOEXIST::FUNCTION:
 EVP_CipherInit_ex                       3566   1_1_0   EXIST::FUNCTION:
 BIO_dgram_sctp_notification_cb          3567   1_1_0   EXIST::FUNCTION:SCTP
 ERR_load_RAND_strings                   3568   1_1_0   EXIST::FUNCTION:
index 7b4a7e6f5ed22071b49a6d77ad3f708f642ec494..8b2155ec9f25b7ec0b7214795bcfa5b0825e1b7f 100644 (file)
@@ -58,7 +58,7 @@ SSL_get0_dane_authority                 57    1_1_0   EXIST::FUNCTION:
 SSL_set_purpose                         58     1_1_0   EXIST::FUNCTION:
 SSL_CTX_use_PrivateKey_file             59     1_1_0   EXIST::FUNCTION:
 SSL_get_rfd                             60     1_1_0   EXIST::FUNCTION:
-DTLSv1_listen                           61     1_1_0   EXIST::FUNCTION:
+DTLSv1_listen                           61     1_1_0   EXIST::FUNCTION:SOCK
 SSL_set_ssl_method                      62     1_1_0   EXIST::FUNCTION:
 SSL_get0_security_ex_data               63     1_1_0   EXIST::FUNCTION:
 SSLv3_client_method                     64     1_1_0   EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD