forked from wolfSSL/wolfssl
pull SSL_set_msg_callback from Part5
This commit is contained in:
40
src/ssl.c
40
src/ssl.c
@ -24700,6 +24700,10 @@ int wolfSSL_SESSION_set_ex_data(WOLFSSL_SESSION* session, int idx, void* data)
|
||||
session->ex_data[idx] = data;
|
||||
return WOLFSSL_SUCCESS;
|
||||
}
|
||||
#else
|
||||
(void)session;
|
||||
(void)idx;
|
||||
(void)data;
|
||||
#endif
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
@ -24729,6 +24733,9 @@ void* wolfSSL_SESSION_get_ex_data(const WOLFSSL_SESSION* session, int idx)
|
||||
#ifdef HAVE_EX_DATA
|
||||
if (session != NULL && idx < MAX_EX_DATA && idx >= 0)
|
||||
return session->ex_data[idx];
|
||||
#else
|
||||
(void)session;
|
||||
(void)idx;
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
@ -25068,16 +25075,6 @@ void wolfSSL_CTX_set_servername_arg(WOLFSSL_CTX* ctx, void* arg)
|
||||
ctx->sniRecvCbArg = arg;
|
||||
}
|
||||
|
||||
|
||||
long wolfSSL_CTX_clear_options(WOLFSSL_CTX* ctx, long opt)
|
||||
{
|
||||
WOLFSSL_ENTER("SSL_CTX_clear_options");
|
||||
WOLFSSL_STUB("SSL_CTX_clear_options");
|
||||
(void)ctx;
|
||||
(void)opt;
|
||||
return opt;
|
||||
}
|
||||
|
||||
void wolfSSL_THREADID_set_callback(void(*threadid_func)(void*))
|
||||
{
|
||||
WOLFSSL_ENTER("wolfSSL_THREADID_set_callback");
|
||||
@ -26366,6 +26363,7 @@ WOLFSSL_API int wolfSSL_CTX_set1_curves_list(WOLFSSL_CTX* ctx, char* names)
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_EXTRA
|
||||
#ifndef NO_WOLFSSL_STUB
|
||||
int wolfSSL_CTX_set_msg_callback(WOLFSSL_CTX *ctx, SSL_Msg_Cb cb)
|
||||
{
|
||||
WOLFSSL_STUB("SSL_CTX_set_msg_callback");
|
||||
@ -26373,13 +26371,25 @@ int wolfSSL_CTX_set_msg_callback(WOLFSSL_CTX *ctx, SSL_Msg_Cb cb)
|
||||
(void)cb;
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
int wolfSSL_set_msg_callback(WOLFSSL *ssl, SSL_Msg_Cb cb)
|
||||
{
|
||||
WOLFSSL_STUB("SSL_set_msg_callback");
|
||||
(void)ssl;
|
||||
(void)cb;
|
||||
return WOLFSSL_FAILURE;
|
||||
WOLFSSL_ENTER("wolfSSL_set_msg_callback");
|
||||
|
||||
if (ssl == NULL) {
|
||||
return SSL_FAILURE;
|
||||
}
|
||||
|
||||
if (cb != NULL) {
|
||||
ssl->toInfoOn = 1;
|
||||
}
|
||||
|
||||
ssl->protoMsgCb = cb;
|
||||
return SSL_SUCCESS;
|
||||
}
|
||||
|
||||
#ifndef NO_WOLFSSL_STUB
|
||||
int wolfSSL_CTX_set_msg_callback_arg(WOLFSSL_CTX *ctx, void* arg)
|
||||
{
|
||||
WOLFSSL_STUB("SSL_CTX_set_msg_callback_arg");
|
||||
@ -26395,6 +26405,6 @@ int wolfSSL_set_msg_callback_arg(WOLFSSL *ssl, void* arg)
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* WOLFCRYPT_ONLY */
|
||||
|
@ -3398,6 +3398,12 @@ struct WOLFSSL {
|
||||
#ifdef WOLFSSL_CALLBACKS
|
||||
HandShakeInfo handShakeInfo; /* info saved during handshake */
|
||||
TimeoutInfo timeoutInfo; /* info saved during handshake */
|
||||
#endif
|
||||
#ifdef OPENSSL_EXTRA
|
||||
SSL_Msg_Cb protoMsgCb; /* inspect protocol message callback */
|
||||
void* protoMsgCtx; /* user set context with msg callback */
|
||||
#endif
|
||||
#if defined(WOLFSSL_CALLBACKS) || defined(OPENSSL_EXTRA)
|
||||
byte hsInfoOn; /* track handshake info */
|
||||
byte toInfoOn; /* track timeout info */
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user