diff --git a/src/ssl.c b/src/ssl.c index caa0a4fb8..8b2e0095e 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -31584,6 +31584,20 @@ void *wolfSSL_OPENSSL_malloc(size_t a) return XMALLOC(a, NULL, DYNAMIC_TYPE_OPENSSL); } +int wolfSSL_OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) +{ + (void)opts; + (void)settings; + return wolfSSL_library_init(); +} + +int wolfSSL_OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS* settings) +{ + (void)opts; + (void)settings; + return wolfSSL_library_init(); +} + #if defined(WOLFSSL_KEY_GEN) && defined(WOLFSSL_PEM_TO_DER) static int EncryptDerKey(byte *der, int *derSz, const EVP_CIPHER* cipher, diff --git a/wolfssl/openssl/crypto.h b/wolfssl/openssl/crypto.h index fe2bb7d94..7b1dab137 100644 --- a/wolfssl/openssl/crypto.h +++ b/wolfssl/openssl/crypto.h @@ -24,10 +24,11 @@ #ifndef WOLFSSL_CRYPTO_H_ #define WOLFSSL_CRYPTO_H_ -#include - #include +#include +#include + #ifdef WOLFSSL_PREFIX #include "prefix_crypto.h" #endif @@ -40,6 +41,8 @@ WOLFSSL_API unsigned long wolfSSL_OpenSSL_version_num(void); #ifdef OPENSSL_EXTRA WOLFSSL_API void wolfSSL_OPENSSL_free(void*); WOLFSSL_API void *wolfSSL_OPENSSL_malloc(size_t a); + +WOLFSSL_API int wolfSSL_OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); #endif #define CRYPTO_THREADID void @@ -62,11 +65,13 @@ WOLFSSL_API void *wolfSSL_OPENSSL_malloc(size_t a); #define OPENSSL_free wolfSSL_OPENSSL_free #define OPENSSL_malloc wolfSSL_OPENSSL_malloc -#ifdef WOLFSSL_QT - #define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L - #define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L - #define OPENSSL_INIT_LOAD_CONFIG 0x00000040L -#endif +#define OPENSSL_INIT_ENGINE_ALL_BUILTIN 0x00000001L +#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L +#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L +#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L + +#define OPENSSL_init_crypto wolfSSL_OPENSSL_init_crypto + #if defined(OPENSSL_ALL) || defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || \ defined(WOLFSSL_HAPROXY) || defined(OPENSSL_EXTRA) diff --git a/wolfssl/openssl/ssl.h b/wolfssl/openssl/ssl.h index bb84756ee..ce9e538b4 100644 --- a/wolfssl/openssl/ssl.h +++ b/wolfssl/openssl/ssl.h @@ -67,6 +67,9 @@ #undef ASN1_INTEGER #endif +#ifdef OPENSSL_EXTRA +WOLFSSL_API int wolfSSL_OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); +#endif typedef WOLFSSL SSL; typedef WOLFSSL_SESSION SSL_SESSION; @@ -283,6 +286,7 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; #define SSL_pending wolfSSL_pending #define SSL_load_error_strings wolfSSL_load_error_strings #define SSL_library_init wolfSSL_library_init +#define OPENSSL_init_ssl wolfSSL_OPENSSL_init_ssl #define OpenSSL_add_ssl_algorithms wolfSSL_library_init #define SSL_CTX_set_session_cache_mode wolfSSL_CTX_set_session_cache_mode #define SSL_CTX_set_cipher_list wolfSSL_CTX_set_cipher_list