mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
add SSL_SESSION_up_ref and fix for get lib
This commit is contained in:
21
src/ssl.c
21
src/ssl.c
@@ -19277,6 +19277,22 @@ int wolfSSL_session_reused(WOLFSSL* ssl)
|
||||
}
|
||||
|
||||
#if defined(OPENSSL_EXTRA) || defined(HAVE_EXT_CACHE)
|
||||
/* add one to session reference count
|
||||
* return WOFLSSL_SUCCESS on success and WOLFSSL_FAILURE on error */
|
||||
int wolfSSL_SESSION_up_ref(WOLFSSL_SESSION* session)
|
||||
{
|
||||
if (session == NULL)
|
||||
return WOLFSSL_FAILURE;
|
||||
|
||||
if (wc_LockMutex(&session->refMutex) != 0) {
|
||||
WOLFSSL_MSG("Failed to lock session mutex");
|
||||
}
|
||||
session->refCount++;
|
||||
wc_UnLockMutex(&session->refMutex);
|
||||
return WOLFSSL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
WOLFSSL_SESSION* wolfSSL_SESSION_dup(WOLFSSL_SESSION* session)
|
||||
{
|
||||
#ifdef HAVE_EXT_CACHE
|
||||
@@ -23939,7 +23955,10 @@ unsigned long wolfSSL_ERR_peek_error(void)
|
||||
|
||||
int wolfSSL_ERR_GET_LIB(unsigned long err)
|
||||
{
|
||||
switch (err) {
|
||||
unsigned long value;
|
||||
|
||||
value = (err & 0xFFFFFFL);
|
||||
switch (value) {
|
||||
case PEM_R_NO_START_LINE:
|
||||
case PEM_R_PROBLEMS_GETTING_PASSWORD:
|
||||
case PEM_R_BAD_PASSWORD_READ:
|
||||
|
@@ -3154,6 +3154,8 @@ struct WOLFSSL_SESSION {
|
||||
#ifdef OPENSSL_EXTRA
|
||||
byte sessionCtxSz; /* sessionCtx length */
|
||||
byte sessionCtx[ID_LEN]; /* app specific context id */
|
||||
wolfSSL_Mutex refMutex; /* ref count mutex */
|
||||
int refCount; /* reference count */
|
||||
#endif
|
||||
#ifdef WOLFSSL_TLS13
|
||||
word16 namedGroup;
|
||||
|
@@ -302,6 +302,7 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
||||
#define SSL_set_connect_state wolfSSL_set_connect_state
|
||||
#define SSL_set_accept_state wolfSSL_set_accept_state
|
||||
#define SSL_session_reused wolfSSL_session_reused
|
||||
#define SSL_SESSION_up_ref wolfSSL_SESSION_up_ref
|
||||
#define SSL_SESSION_dup wolfSSL_SESSION_dup
|
||||
#define SSL_SESSION_free wolfSSL_SESSION_free
|
||||
#define SSL_is_init_finished wolfSSL_is_init_finished
|
||||
|
@@ -1153,6 +1153,7 @@ WOLFSSL_API int wolfSSL_set_session_id_context(WOLFSSL*, const unsigned char*,
|
||||
WOLFSSL_API void wolfSSL_set_connect_state(WOLFSSL*);
|
||||
WOLFSSL_API void wolfSSL_set_accept_state(WOLFSSL*);
|
||||
WOLFSSL_API int wolfSSL_session_reused(WOLFSSL*);
|
||||
WOLFSSL_API int wolfSSL_SESSION_up_ref(WOLFSSL_SESSION* session);
|
||||
WOLFSSL_API WOLFSSL_SESSION* wolfSSL_SESSION_dup(WOLFSSL_SESSION* session);
|
||||
WOLFSSL_API void wolfSSL_SESSION_free(WOLFSSL_SESSION* session);
|
||||
WOLFSSL_API int wolfSSL_is_init_finished(WOLFSSL*);
|
||||
|
Reference in New Issue
Block a user