From f5dcf22b43b192f1ae7ba1477aacab5469cacf08 Mon Sep 17 00:00:00 2001 From: lhuang04 Date: Mon, 8 Nov 2021 07:52:27 -0800 Subject: [PATCH] Fix the TLS 1.3 obfuscated_ticket_age caclulation Summary: Fix the calcuation of (obfuscated_ticket_age)[https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.11.1], it is milliseconds. Test Plan: ``` tests/ssl-opt.sh ``` Reviewers: Subscribers: Tasks: Tags: --- library/ssl_tls13_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl_tls13_client.c b/library/ssl_tls13_client.c index ea2487b80b07..35cb6b7284fd 100644 --- a/library/ssl_tls13_client.c +++ b/library/ssl_tls13_client.c @@ -939,7 +939,7 @@ int mbedtls_ssl_write_pre_shared_key_ext( mbedtls_ssl_context *ssl, } obfuscated_ticket_age = - (uint32_t)( now - ssl->session_negotiate->ticket_received ) + + (uint32_t)( ( now - ssl->session_negotiate->ticket_received ) * 1000 ) + ssl->session_negotiate->ticket_age_add; MBEDTLS_SSL_DEBUG_MSG( 4, ( "obfuscated_ticket_age: %u",