Skip to content

Commit

Permalink
Merge pull request #5534 from dgarske/zd14420
Browse files Browse the repository at this point in the history
Fix for async session tickets
  • Loading branch information
SparkiDev authored Sep 1, 2022
2 parents 65ca72c + 96ab26e commit 23fd645
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -33473,7 +33473,12 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
et = (ExternalTicket*)ssl->session->ticket;
it = (InternalTicket*)et->enc_ticket;

XMEMSET(et, 0, sizeof(*et));
#ifdef WOLFSSL_ASYNC_CRYPT
if (ssl->error != WC_PENDING_E)
#endif
{
XMEMSET(et, 0, sizeof(*et));
}

/* build internal */
it->pv.major = ssl->version.major;
Expand Down
9 changes: 7 additions & 2 deletions src/tls13.c
Original file line number Diff line number Diff line change
Expand Up @@ -9127,8 +9127,13 @@ static int SendTls13NewSessionTicket(WOLFSSL* ssl)
ssl->session->ticketNonce.len = DEF_TICKET_NONCE_SZ;
ssl->session->ticketNonce.data[0] = 0;
}
else
ssl->session->ticketNonce.data[0]++;
else
#ifdef WOLFSSL_ASYNC_CRYPT
if (ssl->error != WC_PENDING_E)
#endif
{
ssl->session->ticketNonce.data[0]++;
}

if (!ssl->options.noTicketTls13) {
if ((ret = CreateTicket(ssl)) != 0)
Expand Down

0 comments on commit 23fd645

Please # to comment.