mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
ssl_ticket.c: Remove pedantic server endpoint check
When calculating the ticket age, remove the check that the endpoint is a server. The module is supposed to be used only server side. Furthermore, if such check was necessary, it should be at the beginning of all ssl_ticket.c APIs. As there is no such protection in any API, just remove the check. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
@ -498,10 +498,8 @@ int mbedtls_ssl_ticket_parse(void *p_ticket,
|
|||||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||||
if (session->tls_version == MBEDTLS_SSL_VERSION_TLS1_3) {
|
if (session->tls_version == MBEDTLS_SSL_VERSION_TLS1_3) {
|
||||||
/* Check for expiration */
|
/* Check for expiration */
|
||||||
mbedtls_ms_time_t ticket_age = -1;
|
mbedtls_ms_time_t ticket_age = mbedtls_ms_time() -
|
||||||
if (session->endpoint == MBEDTLS_SSL_IS_SERVER) {
|
session->ticket_creation_time;
|
||||||
ticket_age = mbedtls_ms_time() - session->ticket_creation_time;
|
|
||||||
}
|
|
||||||
mbedtls_ms_time_t ticket_lifetime =
|
mbedtls_ms_time_t ticket_lifetime =
|
||||||
(mbedtls_ms_time_t) ctx->ticket_lifetime * 1000;
|
(mbedtls_ms_time_t) ctx->ticket_lifetime * 1000;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user