mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00:00
fix build failure
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
cf9135100e
commit
472a69260b
@ -498,7 +498,18 @@ 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 = mbedtls_ms_time() - session->ticket_creation_time;
|
mbedtls_ms_time_t ticket_age = -1;
|
||||||
|
#if defined(MBEDTLS_SSL_SRV_C)
|
||||||
|
if (session->endpoint == MBEDTLS_SSL_IS_SERVER) {
|
||||||
|
ticket_age = mbedtls_ms_time() - session->ticket_creation_time;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(MBEDTLS_SSL_CLI_C)
|
||||||
|
if (session->endpoint == MBEDTLS_SSL_IS_CLIENT) {
|
||||||
|
ticket_age = mbedtls_ms_time() - session->ticket_reception_time;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
mbedtls_ms_time_t ticket_lifetime = ctx->ticket_lifetime * 1000;
|
mbedtls_ms_time_t ticket_lifetime = ctx->ticket_lifetime * 1000;
|
||||||
|
|
||||||
if (ticket_age < 0 || ticket_age > ticket_lifetime) {
|
if (ticket_age < 0 || ticket_age > ticket_lifetime) {
|
||||||
|
@ -1752,7 +1752,7 @@ int mbedtls_test_ssl_tls13_populate_session(mbedtls_ssl_session *session,
|
|||||||
session->max_early_data_size = 0x87654321;
|
session->max_early_data_size = 0x87654321;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_HAVE_TIME)
|
#if defined(MBEDTLS_HAVE_TIME) && defined(MBEDTLS_SSL_SRV_C)
|
||||||
if (session->endpoint == MBEDTLS_SSL_IS_SERVER) {
|
if (session->endpoint == MBEDTLS_SSL_IS_SERVER) {
|
||||||
session->ticket_creation_time = mbedtls_ms_time() - 42;
|
session->ticket_creation_time = mbedtls_ms_time() - 42;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user