diff --git a/library/ssl_client.c b/library/ssl_client.c index 55fe352fe..270db4168 100644 --- a/library/ssl_client.c +++ b/library/ssl_client.c @@ -753,7 +753,8 @@ static int ssl_prepare_client_hello(mbedtls_ssl_context *ssl) session_negotiate->ticket != NULL) { mbedtls_ms_time_t now = mbedtls_ms_time(); mbedtls_ms_time_t age = now - session_negotiate->ticket_reception_time; - if (age < 0 || age > session_negotiate->ticket_lifetime * 1000) { + if (age < 0 || + age > (mbedtls_ms_time_t) session_negotiate->ticket_lifetime * 1000) { /* Without valid ticket, disable session resumption.*/ MBEDTLS_SSL_DEBUG_MSG( 3, ("Ticket expired, disable session resumption")); diff --git a/library/ssl_ticket.c b/library/ssl_ticket.c index 8e7c145bc..cd730fb31 100644 --- a/library/ssl_ticket.c +++ b/library/ssl_ticket.c @@ -510,7 +510,8 @@ int mbedtls_ssl_ticket_parse(void *p_ticket, } #endif - mbedtls_ms_time_t ticket_lifetime = ctx->ticket_lifetime * 1000; + mbedtls_ms_time_t ticket_lifetime = + (mbedtls_ms_time_t) ctx->ticket_lifetime * 1000; if (ticket_age < 0 || ticket_age > ticket_lifetime) { ret = MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED;