Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -34824,6 +34824,8 @@ int SendCertificateVerify(WOLFSSL* ssl)
#ifdef HAVE_SESSION_TICKET
int SetTicket(WOLFSSL* ssl, const byte* ticket, word32 length)
{
word32 sessIdLen = 0;
Comment thread
SparkiDev marked this conversation as resolved.
Outdated

if (!HaveUniqueSessionObj(ssl))
return MEMORY_ERROR;

Expand All @@ -34845,6 +34847,10 @@ int SetTicket(WOLFSSL* ssl, const byte* ticket, word32 length)
ssl->session->ticketLen = (word16)length;

if (length > 0) {
if (length >= ID_LEN)
sessIdLen = ID_LEN;
else
sessIdLen = length;
XMEMCPY(ssl->session->ticket, ticket, length);
if (ssl->session_ticket_cb != NULL) {
ssl->session_ticket_cb(ssl,
Expand All @@ -34856,15 +34862,17 @@ int SetTicket(WOLFSSL* ssl, const byte* ticket, word32 length)
ssl->options.haveSessionId = 1;
#ifdef WOLFSSL_TLS13
if (ssl->options.tls1_3) {
XMEMSET(ssl->session->sessionID, 0, ID_LEN);
XMEMCPY(ssl->session->sessionID,
ssl->session->ticket + length - ID_LEN, ID_LEN);
ssl->session->ticket + length - sessIdLen, sessIdLen);
Comment thread
SparkiDev marked this conversation as resolved.
Outdated
ssl->session->sessionIDSz = ID_LEN;
}
else
#endif
{
XMEMSET(ssl->arrays->sessionID, 0, ID_LEN);
XMEMCPY(ssl->arrays->sessionID,
ssl->session->ticket + length - ID_LEN, ID_LEN);
ssl->session->ticket + length - sessIdLen, sessIdLen);
Comment thread
SparkiDev marked this conversation as resolved.
Outdated
ssl->arrays->sessionIDSz = ID_LEN;
}
}
Expand Down
Loading