mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
session_ticket: Add separate member to track compatCb
This resolves an error: `ISO C forbids conversion of object pointer to function pointer type` Instead of casting the function pointer, the extra member contains the function pointer.
This commit is contained in:
@ -49666,7 +49666,7 @@ static int wolfSSL_TicketKeyCb(WOLFSSL* ssl,
|
|||||||
|
|
||||||
WOLFSSL_ENTER("wolfSSL_TicketKeyCb");
|
WOLFSSL_ENTER("wolfSSL_TicketKeyCb");
|
||||||
|
|
||||||
if (ssl == NULL || ssl->ctx == NULL || ssl->ctx->ticketEncCtx == NULL) {
|
if (ssl == NULL || ssl->ctx == NULL || ssl->ctx->ticketEncWrapCb == NULL) {
|
||||||
WOLFSSL_MSG("Bad parameter");
|
WOLFSSL_MSG("Bad parameter");
|
||||||
return WOLFSSL_TICKET_RET_FATAL;
|
return WOLFSSL_TICKET_RET_FATAL;
|
||||||
}
|
}
|
||||||
@ -49677,7 +49677,7 @@ static int wolfSSL_TicketKeyCb(WOLFSSL* ssl,
|
|||||||
WOLFSSL_MSG("wolfSSL_HMAC_CTX_Init error");
|
WOLFSSL_MSG("wolfSSL_HMAC_CTX_Init error");
|
||||||
return WOLFSSL_TICKET_RET_FATAL;
|
return WOLFSSL_TICKET_RET_FATAL;
|
||||||
}
|
}
|
||||||
res = ((ticketCompatCb)ssl->ctx->ticketEncCtx)(ssl, keyName,
|
res = ssl->ctx->ticketEncWrapCb(ssl, keyName,
|
||||||
iv, &evpCtx, &hmacCtx, enc);
|
iv, &evpCtx, &hmacCtx, enc);
|
||||||
if (res != TICKET_KEY_CB_RET_OK && res != TICKET_KEY_CB_RET_RENEW) {
|
if (res != TICKET_KEY_CB_RET_OK && res != TICKET_KEY_CB_RET_RENEW) {
|
||||||
WOLFSSL_MSG("Ticket callback error");
|
WOLFSSL_MSG("Ticket callback error");
|
||||||
@ -49743,11 +49743,12 @@ end:
|
|||||||
*/
|
*/
|
||||||
int wolfSSL_CTX_set_tlsext_ticket_key_cb(WOLFSSL_CTX *ctx, ticketCompatCb cb)
|
int wolfSSL_CTX_set_tlsext_ticket_key_cb(WOLFSSL_CTX *ctx, ticketCompatCb cb)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Set the ticket encryption callback to be a wrapper around OpenSSL
|
/* Set the ticket encryption callback to be a wrapper around OpenSSL
|
||||||
* callback.
|
* callback.
|
||||||
*/
|
*/
|
||||||
ctx->ticketEncCb = wolfSSL_TicketKeyCb;
|
ctx->ticketEncCb = wolfSSL_TicketKeyCb;
|
||||||
ctx->ticketEncCtx = (void*)cb;
|
ctx->ticketEncWrapCb = cb;
|
||||||
|
|
||||||
return WOLFSSL_SUCCESS;
|
return WOLFSSL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -2955,6 +2955,10 @@ struct WOLFSSL_CTX {
|
|||||||
#if defined(HAVE_SESSION_TICKET) && !defined(NO_WOLFSSL_SERVER)
|
#if defined(HAVE_SESSION_TICKET) && !defined(NO_WOLFSSL_SERVER)
|
||||||
SessionTicketEncCb ticketEncCb; /* enc/dec session ticket Cb */
|
SessionTicketEncCb ticketEncCb; /* enc/dec session ticket Cb */
|
||||||
void* ticketEncCtx; /* session encrypt context */
|
void* ticketEncCtx; /* session encrypt context */
|
||||||
|
#if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) \
|
||||||
|
|| defined(OPENSSL_EXTRA) || defined(HAVE_LIGHTY)
|
||||||
|
ticketCompatCb ticketEncWrapCb; /* callback for OpenSSL ticket key callback */
|
||||||
|
#endif
|
||||||
int ticketHint; /* ticket hint in seconds */
|
int ticketHint; /* ticket hint in seconds */
|
||||||
#ifndef WOLFSSL_NO_DEF_TICKET_ENC_CB
|
#ifndef WOLFSSL_NO_DEF_TICKET_ENC_CB
|
||||||
TicketEncCbCtx ticketKeyCtx;
|
TicketEncCbCtx ticketKeyCtx;
|
||||||
|
Reference in New Issue
Block a user