Skip to content

Commit 031656e

Browse files
committed
Send a new ticket when rejecting a ticket and tickets enabled
1 parent 2847cbf commit 031656e

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/tls.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5905,14 +5905,25 @@ static int TLSX_SessionTicket_Parse(WOLFSSL* ssl, const byte* input,
59055905
/* SERVER: ticket is peer auth. */
59065906
ssl->options.peerAuthGood = 1;
59075907
}
5908-
} else if (ret == WOLFSSL_TICKET_RET_REJECT) {
5908+
} else if (ret == WOLFSSL_TICKET_RET_REJECT ||
5909+
ret == WC_NO_ERR_TRACE(VERSION_ERROR)) {
59095910
WOLFSSL_MSG("Process client ticket rejected, not using");
5910-
ssl->options.rejectTicket = 1;
5911+
if (ret == WC_NO_ERR_TRACE(VERSION_ERROR))
5912+
WOLFSSL_MSG("\tbad TLS version");
59115913
ret = 0; /* not fatal */
5912-
} else if (ret == WC_NO_ERR_TRACE(VERSION_ERROR)) {
5913-
WOLFSSL_MSG("Process client ticket rejected, bad TLS version");
5914+
59145915
ssl->options.rejectTicket = 1;
5915-
ret = 0; /* not fatal */
5916+
/* If we have session tickets enabled then send a new ticket */
5917+
if (!TLSX_CheckUnsupportedExtension(ssl, TLSX_SESSION_TICKET)) {
5918+
ret = TLSX_UseSessionTicket(&ssl->extensions, NULL,
5919+
ssl->heap);
5920+
if (ret == WOLFSSL_SUCCESS) {
5921+
ret = 0;
5922+
TLSX_SetResponse(ssl, TLSX_SESSION_TICKET);
5923+
ssl->options.createTicket = 1;
5924+
ssl->options.useTicket = 1;
5925+
}
5926+
}
59165927
} else if (ret == WOLFSSL_TICKET_RET_FATAL) {
59175928
WOLFSSL_MSG("Process client ticket fatal error, not using");
59185929
} else if (ret < 0) {

0 commit comments

Comments
 (0)