Adding wolfSSL_CTX_get_TicketEncCtx

This commit is contained in:
Eric Blankenhorn
2021-02-15 11:28:46 -06:00
parent ba1c67843a
commit b7b07e1945
3 changed files with 30 additions and 0 deletions

View File

@ -11214,6 +11214,27 @@ WOLFSSL_API int wolfSSL_CTX_set_TicketHint(WOLFSSL_CTX* ctx, int);
*/
WOLFSSL_API int wolfSSL_CTX_set_TicketEncCtx(WOLFSSL_CTX* ctx, void*);
/*!
\brief This function gets the session ticket encrypt user context for the
callback. For server side use.
\return userCtx will be returned upon successfully getting the session.
\return NULL will be returned on failure. This is caused by
passing invalid arguments to the function, or when the user context has
not been set.
\param ctx pointer to the WOLFSSL_CTX object, created
with wolfSSL_CTX_new().
_Example_
\code
none
\endcode
\sa wolfSSL_CTX_set_TicketEncCtx
*/
WOLFSSL_API void* wolfSSL_CTX_get_TicketEncCtx(WOLFSSL_CTX* ctx);
/*!
\ingroup IO

View File

@ -2893,6 +2893,14 @@ int wolfSSL_CTX_set_TicketEncCtx(WOLFSSL_CTX* ctx, void* userCtx)
return WOLFSSL_SUCCESS;
}
/* get user context - returns userCtx on success, NULL on failure */
void* wolfSSL_CTX_get_TicketEncCtx(WOLFSSL_CTX* ctx)
{
if (ctx == NULL)
return NULL;
return ctx->ticketEncCtx;
}
#endif /* !NO_WOLFSSL_SERVER */
#if !defined(NO_WOLFSSL_CLIENT)

View File

@ -3261,6 +3261,7 @@ WOLFSSL_API int wolfSSL_CTX_set_TicketEncCb(WOLFSSL_CTX* ctx,
SessionTicketEncCb);
WOLFSSL_API int wolfSSL_CTX_set_TicketHint(WOLFSSL_CTX* ctx, int);
WOLFSSL_API int wolfSSL_CTX_set_TicketEncCtx(WOLFSSL_CTX* ctx, void*);
WOLFSSL_API void* wolfSSL_CTX_get_TicketEncCtx(WOLFSSL_CTX* ctx);
#endif /* NO_WOLFSSL_SERVER */