From fb943a2f238a1a7c660afadc8158fa771b5e49df Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Wed, 23 Feb 2022 09:55:52 +0100 Subject: [PATCH] Rebase and make `wolfSSL_CTX_up_ref` always available `wolfSSL_CTX_up_ref` is a small and potentially useful API for users so it doesn't need to be restricted only to the compatibility layer. The reference counting mechanisms are always available anyway. This just exposes the functionality to the user. --- src/ssl.c | 2 -- wolfssl/ssl.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index ebe0b3ac8..1df33d647 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -547,14 +547,12 @@ WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD* method) #endif } -#ifdef OPENSSL_EXTRA /* increases CTX reference count to track proper time to "free" */ int wolfSSL_CTX_up_ref(WOLFSSL_CTX* ctx) { int refCount = SSL_CTX_RefCount(ctx, 1); return ((refCount > 1) ? WOLFSSL_SUCCESS : WOLFSSL_FAILURE); } -#endif WOLFSSL_ABI void wolfSSL_CTX_free(WOLFSSL_CTX* ctx) diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index e78a2134b..ae3393833 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -999,8 +999,8 @@ WOLFSSL_API int wolfSSL_use_RSAPrivateKey_file( WOLFSSL_API WOLFSSL_CTX* wolfSSL_CTX_new_ex(WOLFSSL_METHOD* method, void* heap); WOLFSSL_ABI WOLFSSL_API WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD* method); -#ifdef OPENSSL_EXTRA WOLFSSL_API int wolfSSL_CTX_up_ref(WOLFSSL_CTX* ctx); +#ifdef OPENSSL_EXTRA WOLFSSL_API int wolfSSL_CTX_set_ecdh_auto(WOLFSSL_CTX* ctx, int onoff); WOLFSSL_API int wolfSSL_get_signature_nid(WOLFSSL* ssl, int* nid); WOLFSSL_API int wolfSSL_CTX_set1_sigalgs_list(WOLFSSL_CTX* ctx,