From 7b9f8f7f03eda2faa1cdd42ed29a0b70e60eaf59 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 8 Feb 2016 16:43:03 +0000 Subject: Auto init/deinit libcrypto This builds on the previous commit to auto initialise/deinitialise libcrypto. Reviewed-by: Richard Levitte --- crypto/engine/eng_cryptodev.c | 9 +++++---- crypto/engine/eng_dyn.c | 3 ++- crypto/engine/eng_int.h | 3 +-- crypto/engine/eng_openssl.c | 4 ++-- crypto/engine/eng_rdrand.c | 7 ++++--- 5 files changed, 14 insertions(+), 12 deletions(-) (limited to 'crypto/engine') diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c index eb8a8bb218..eb25790ae0 100644 --- a/crypto/engine/eng_cryptodev.c +++ b/crypto/engine/eng_cryptodev.c @@ -27,9 +27,10 @@ */ #include -#include +#include #include #include +#include #if (defined(__unix__) || defined(unix)) && !defined(USG) && \ (defined(OpenBSD) || defined(__FreeBSD__)) @@ -64,7 +65,7 @@ #ifndef HAVE_CRYPTODEV -void ENGINE_load_cryptodev(void) +void engine_load_cryptodev_internal(void) { /* This is a NOP on platforms without /dev/crypto */ return; @@ -136,7 +137,7 @@ static int cryptodev_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, #endif static int cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void)); -void ENGINE_load_cryptodev(void); +void engine_load_cryptodev_internal(void); static const ENGINE_CMD_DEFN cryptodev_defns[] = { {0, NULL, NULL, 0} @@ -1619,7 +1620,7 @@ cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void)) return (1); } -void ENGINE_load_cryptodev(void) +void engine_load_cryptodev_internal(void) { ENGINE *engine = ENGINE_new(); int fd; diff --git a/crypto/engine/eng_dyn.c b/crypto/engine/eng_dyn.c index 607317b355..3ca24807c7 100644 --- a/crypto/engine/eng_dyn.c +++ b/crypto/engine/eng_dyn.c @@ -58,6 +58,7 @@ #include "eng_int.h" #include +#include /* * Shared libraries implementing ENGINEs for use by the "dynamic" ENGINE @@ -294,7 +295,7 @@ static ENGINE *engine_dynamic(void) return ret; } -void ENGINE_load_dynamic(void) +void engine_load_dynamic_internal(void) { ENGINE *toadd = engine_dynamic(); if (!toadd) diff --git a/crypto/engine/eng_int.h b/crypto/engine/eng_int.h index 804214d9ae..9d58d93ecd 100644 --- a/crypto/engine/eng_int.h +++ b/crypto/engine/eng_int.h @@ -65,8 +65,7 @@ # define HEADER_ENGINE_INT_H # include "internal/cryptlib.h" -/* Take public definitions from engine.h */ -# include +# include #ifdef __cplusplus extern "C" { diff --git a/crypto/engine/eng_openssl.c b/crypto/engine/eng_openssl.c index 8540673bd1..152c1881fa 100644 --- a/crypto/engine/eng_openssl.c +++ b/crypto/engine/eng_openssl.c @@ -64,7 +64,7 @@ #include #include #include "internal/cryptlib.h" -#include +#include #include #include #include @@ -196,7 +196,7 @@ static ENGINE *engine_openssl(void) return ret; } -void ENGINE_load_openssl(void) +void engine_load_openssl_internal(void) { ENGINE *toadd = engine_openssl(); if (!toadd) diff --git a/crypto/engine/eng_rdrand.c b/crypto/engine/eng_rdrand.c index 48726e2543..1be10dbeae 100644 --- a/crypto/engine/eng_rdrand.c +++ b/crypto/engine/eng_rdrand.c @@ -51,9 +51,10 @@ #include #include -#include +#include #include #include +#include #if (defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ defined(__x86_64) || defined(__x86_64__) || \ @@ -129,7 +130,7 @@ static ENGINE *ENGINE_rdrand(void) return ret; } -void ENGINE_load_rdrand(void) +void engine_load_rdrand_internal(void) { extern unsigned int OPENSSL_ia32cap_P[]; @@ -143,7 +144,7 @@ void ENGINE_load_rdrand(void) } } #else -void ENGINE_load_rdrand(void) +void engine_load_rdrand_internal(void) { } #endif -- cgit v1.2.1