limit session ticket number when resumption
@@ -2866,6 +2866,13 @@ 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 ) );
+ /* Limit session tickets count to one when resumption connection.
+ *
+ * See document of mbedtls_ssl_conf_new_session_tickets.
+ */
+ if( ssl->handshake->resume == 1 )
+ ssl->handshake->new_session_tickets_count = 0;
+ else
ssl->handshake->new_session_tickets_count--;
mbedtls_ssl_handshake_set_state( ssl,
