Replace start with ticket_creation

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2023-10-31 14:42:20 +08:00
parent 702fc590ed
commit ec6d07870d
4 changed files with 17 additions and 14 deletions

View file

@ -193,15 +193,15 @@ static int ssl_tls13_offered_psks_check_identity_match_ticket(
#if defined(MBEDTLS_HAVE_TIME)
now = mbedtls_ms_time();
if (now < session->start) {
if (now < session->ticket_creation) {
MBEDTLS_SSL_DEBUG_MSG(
3, ("Invalid ticket start time ( now = %" MBEDTLS_PRINTF_MS_TIME
", start = %" MBEDTLS_PRINTF_MS_TIME " )",
now, session->start));
now, session->ticket_creation));
goto exit;
}
server_age = now - session->start;
server_age = now - session->ticket_creation;
/* RFC 8446 section 4.6.1
*
@ -2880,7 +2880,7 @@ static int ssl_tls13_prepare_new_session_ticket(mbedtls_ssl_context *ssl,
MBEDTLS_SSL_DEBUG_MSG(2, ("=> prepare NewSessionTicket msg"));
#if defined(MBEDTLS_HAVE_TIME)
session->start = mbedtls_ms_time();
session->ticket_creation = mbedtls_ms_time();
#endif
/* Set ticket_flags depends on the advertised psk key exchange mode */