diff --git a/src/ssl.c b/src/ssl.c index 9e3748eaa..167a381f3 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -141,6 +141,12 @@ #include #endif #endif /* !WOLFCRYPT_ONLY || OPENSSL_EXTRA */ + +#ifdef OPENSSL_EXTRA +/* Global pointer to constant BN on */ +static WOLFSSL_BIGNUM* bn_one = NULL; +#endif + #ifndef WOLFCRYPT_ONLY #if defined(OPENSSL_EXTRA) && defined(HAVE_ECC) @@ -345,11 +351,6 @@ int wolfSSL_send_session(WOLFSSL* ssl) #endif /* WOLFSSL_DTLS */ #endif /* WOLFSSL_SESSION_EXPORT */ -#ifdef OPENSSL_EXTRA -/* Global pointer to constant BN on */ -static WOLFSSL_BIGNUM* bn_one = NULL; -#endif - /* prevent multiple mutex initializations */ static volatile WOLFSSL_GLOBAL int initRefCount = 0; static WOLFSSL_GLOBAL wolfSSL_Mutex count_mutex; /* init ref count mutex */ @@ -15658,7 +15659,7 @@ size_t wolfSSL_get_client_random(const WOLFSSL* ssl, unsigned char* out, return SSLEAY_VERSION_NUMBER; } - unsigned long OpenSSL_version_num(void) + unsigned long wolfSSL_OpenSSL_version_num(void) { return OPENSSL_VERSION_NUMBER; } @@ -32201,6 +32202,18 @@ WOLFSSL_API int wolfSSL_EVP_PKEY_set1_EC_KEY(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_EC_ wolfSSL_RSA_free(pkey->rsa); } pkey->ownRsa = 0; +#endif +#ifndef NO_DSA + if (pkey->dsa != NULL && pkey->ownDsa == 1) { + wolfSSL_DSA_free(pkey->dsa); + } + pkey->ownDsa = 0; +#endif +#ifndef NO_DH + if (pkey->dh != NULL && pkey->ownDh == 1) { + wolfSSL_DH_free(pkey->dh); + } + pkey->ownDh = 0; #endif if (pkey->ecc != NULL && pkey->ownEcc == 1) { wolfSSL_EC_KEY_free(pkey->ecc); diff --git a/wolfssl/openssl/crypto.h b/wolfssl/openssl/crypto.h index a3eeb7bd7..25d0c31b2 100644 --- a/wolfssl/openssl/crypto.h +++ b/wolfssl/openssl/crypto.h @@ -35,7 +35,7 @@ WOLFSSL_API const char* wolfSSLeay_version(int type); WOLFSSL_API unsigned long wolfSSLeay(void); -WOLFSSL_API unsigned long OpenSSL_version_num(void); +WOLFSSL_API unsigned long wolfSSL_OpenSSL_version_num(void); #ifdef OPENSSL_EXTRA WOLFSSL_API void wolfSSL_OPENSSL_free(void*); @@ -85,6 +85,8 @@ typedef void (CRYPTO_free_func)(void*parent, void*ptr, CRYPTO_EX_DATA *ad, int i #define CRYPTO_THREAD_r_lock wc_LockMutex #define CRYPTO_THREAD_unlock wc_UnLockMutex +#define OpenSSL_version_num wolfSSL_OpenSSL_version_num + #endif /* OPENSSL_ALL || HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY */ #endif /* header */