From b7e3fa7fbdd573f3f7f633da297a561eadac0fc5 Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Thu, 22 Sep 2022 11:07:18 +0800 Subject: [PATCH] move count decrement after success sent Signed-off-by: Jerry Yu --- library/ssl_tls13_server.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/ssl_tls13_server.c b/library/ssl_tls13_server.c index 40ac47667..e1e52cb45 100644 --- a/library/ssl_tls13_server.c +++ b/library/ssl_tls13_server.c @@ -2654,10 +2654,6 @@ static int ssl_tls13_prepare_new_session_ticket( mbedtls_ssl_context *ssl, MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> prepare NewSessionTicket msg" ) ); - if( ssl->handshake->resume == 1 ) - ssl->handshake->new_session_tickets_count = 0; - else - ssl->handshake->new_session_tickets_count--; #if defined(MBEDTLS_HAVE_TIME) session->start = mbedtls_time( NULL ); #endif @@ -2870,6 +2866,8 @@ static int ssl_tls13_write_new_session_ticket( mbedtls_ssl_context *ssl ) MBEDTLS_SSL_PROC_CHK( mbedtls_ssl_finish_handshake_msg( ssl, buf_len, msg_len ) ); + ssl->handshake->new_session_tickets_count--; + mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH ); }