Have only one DSO_METHOD_openssl

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>
This commit is contained in:
Rich Salz 2016-03-22 13:35:03 -04:00
parent 73decf5975
commit 38186bfd4e
12 changed files with 28 additions and 166 deletions

View 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)

View 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

View file

@ -58,12 +58,7 @@
#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;
}
/*

View file

@ -67,12 +67,7 @@
#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;
}
/*

View file

@ -105,4 +105,3 @@ struct dso_meth_st {
/* Perform global symbol lookup, i.e. among *all* modules */
void *(*globallookup) (const char *symname);
};

View file

@ -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;
}

View file

@ -58,21 +58,14 @@
#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

View file

@ -58,12 +58,7 @@
#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)

View file

@ -58,12 +58,7 @@
#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;
}
/*

View 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

View 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:

View 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