tls13: send new session ticket only when client supports psk
@@ -2568,10 +2568,14 @@ static int ssl_tls13_handshake_wrapup(mbedtls_ssl_context *ssl)
mbedtls_ssl_tls13_handshake_wrapup(ssl);
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
+ /* Sent NewSessionTicket message only when client supports PSK */
+ if (mbedtls_ssl_tls13_some_psk_enabled(ssl)) {
mbedtls_ssl_handshake_set_state(ssl, MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET);
-#else
- mbedtls_ssl_handshake_set_state(ssl, MBEDTLS_SSL_HANDSHAKE_OVER);
+ } else
#endif
+ {
+ mbedtls_ssl_handshake_set_state(ssl, MBEDTLS_SSL_HANDSHAKE_OVER);
+ }
return 0;
}
