mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Replace start
with ticket_creation
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
@ -498,16 +498,17 @@ int mbedtls_ssl_ticket_parse(void *p_ticket,
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||
if (session->tls_version == MBEDTLS_SSL_VERSION_TLS1_3) {
|
||||
/* Check for expiration */
|
||||
mbedtls_ms_time_t ticket_age = mbedtls_ms_time() - session->start;
|
||||
mbedtls_ms_time_t ticket_age = mbedtls_ms_time() - session->ticket_creation;
|
||||
mbedtls_ms_time_t ticket_lifetime = ctx->ticket_lifetime * 1000;
|
||||
|
||||
if (ticket_age < 0 || ticket_age > ticket_lifetime) {
|
||||
ret = MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED;
|
||||
goto cleanup;
|
||||
}
|
||||
} else
|
||||
}
|
||||
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
|
||||
{
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
||||
if (session->tls_version == MBEDTLS_SSL_VERSION_TLS1_2) {
|
||||
/* Check for expiration */
|
||||
mbedtls_time_t current_time = mbedtls_time(NULL);
|
||||
|
||||
@ -517,6 +518,7 @@ int mbedtls_ssl_ticket_parse(void *p_ticket,
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* MBEDTLS_HAVE_TIME */
|
||||
|
||||
cleanup:
|
||||
|
Reference in New Issue
Block a user