Rename some "new_session_tickets" symbols

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2024-08-28 16:44:10 +02:00
parent c9884b04ad
commit 9f44c883f4
7 changed files with 28 additions and 25 deletions

View File

@ -1,8 +1,9 @@
Bugfix Bugfix
* Fix TLS connection failure in applications using an Mbed TLS client in * Fix TLS connection failure in applications using an Mbed TLS client in
the default configuration connecting to a TLS 1.3 server sending tickets. the default configuration connecting to a TLS 1.3 server sending tickets.
See the documentation of mbedtls_ssl_conf_enable_new_session_tickets() See the documentation of
for more information. mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets() for more
information.
Fixes #8749. Fixes #8749.
Changes Changes
@ -10,4 +11,4 @@ Changes
disabled at runtime. Applications that were using TLS 1.3 tickets disabled at runtime. Applications that were using TLS 1.3 tickets
signalled by MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET return values now signalled by MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET return values now
need to enable the handling of TLS 1.3 tickets through the new need to enable the handling of TLS 1.3 tickets through the new
mbedtls_ssl_conf_enable_new_session_tickets() API. mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets() API.

View File

@ -321,8 +321,8 @@
#define MBEDTLS_SSL_SESSION_TICKETS_DISABLED 0 #define MBEDTLS_SSL_SESSION_TICKETS_DISABLED 0
#define MBEDTLS_SSL_SESSION_TICKETS_ENABLED 1 #define MBEDTLS_SSL_SESSION_TICKETS_ENABLED 1
#define MBEDTLS_SSL_NEW_SESSION_TICKETS_DISABLED 0 #define MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_DISABLED 0
#define MBEDTLS_SSL_NEW_SESSION_TICKETS_ENABLED 1 #define MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED 1
#define MBEDTLS_SSL_PRESET_DEFAULT 0 #define MBEDTLS_SSL_PRESET_DEFAULT 0
#define MBEDTLS_SSL_PRESET_SUITEB 2 #define MBEDTLS_SSL_PRESET_SUITEB 2
@ -4508,12 +4508,12 @@ void mbedtls_ssl_conf_session_tickets(mbedtls_ssl_config *conf, int use_tickets)
* fatal error code are then failing. * fatal error code are then failing.
* *
* \param conf SSL configuration * \param conf SSL configuration
* \param use_new_session_tickets Enable or disable * \param signal_new_session_tickets Enable or disable
* (MBEDTLS_SSL_NEW_SESSION_TICKETS_ENABLED or * (MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED or
* MBEDTLS_SSL_NEW_SESSION_TICKETS_DISABLED) * MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_DISABLED)
*/ */
void mbedtls_ssl_conf_enable_new_session_tickets(mbedtls_ssl_config *conf, void mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(
int use_new_session_tickets); mbedtls_ssl_config *conf, int signal_new_session_tickets);
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */ #endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */ #endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */
@ -5093,8 +5093,8 @@ int mbedtls_ssl_renegotiate(mbedtls_ssl_context *ssl);
* This error code can be returned only on client side if and * This error code can be returned only on client side if and
* only if handling of TLS 1.3 NewSessionTicket messages has * only if handling of TLS 1.3 NewSessionTicket messages has
* been enabled through the * been enabled through the
* mbedtls_ssl_conf_enable_new_session_tickets() API. A TLS 1.3 * mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets() API.
* NewSessionTicket message has been received and parsed * A TLS 1.3 NewSessionTicket message has been received and parsed
* successfully by the client. Ticket data is available in the * successfully by the client. Ticket data is available in the
* SSL context and remain available as long as the client will * SSL context and remain available as long as the client will
* not receive a new NewSessionTicket message. Ticket data may * not receive a new NewSessionTicket message. Ticket data may

View File

@ -2955,12 +2955,12 @@ static inline int mbedtls_ssl_conf_get_session_tickets(
} }
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
static inline int mbedtls_ssl_conf_is_new_session_tickets_enabled( static inline int mbedtls_ssl_conf_is_signal_new_session_tickets_enabled(
const mbedtls_ssl_config *conf) const mbedtls_ssl_config *conf)
{ {
return conf->session_tickets & MBEDTLS_SSL_SESSION_TICKETS_TLS1_3_MASK ? return conf->session_tickets & MBEDTLS_SSL_SESSION_TICKETS_TLS1_3_MASK ?
MBEDTLS_SSL_NEW_SESSION_TICKETS_ENABLED : MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED :
MBEDTLS_SSL_NEW_SESSION_TICKETS_DISABLED; MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_DISABLED;
} }
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */ #endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */ #endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */

View File

@ -5595,8 +5595,8 @@ static int ssl_tls13_handle_hs_message_post_handshake(mbedtls_ssl_context *ssl)
if (ssl_tls13_is_new_session_ticket(ssl)) { if (ssl_tls13_is_new_session_ticket(ssl)) {
#if defined(MBEDTLS_SSL_SESSION_TICKETS) #if defined(MBEDTLS_SSL_SESSION_TICKETS)
MBEDTLS_SSL_DEBUG_MSG(3, ("NewSessionTicket received")); MBEDTLS_SSL_DEBUG_MSG(3, ("NewSessionTicket received"));
if (mbedtls_ssl_conf_is_new_session_tickets_enabled(ssl->conf) == if (mbedtls_ssl_conf_is_signal_new_session_tickets_enabled(ssl->conf) ==
MBEDTLS_SSL_NEW_SESSION_TICKETS_ENABLED) { MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED) {
ssl->keep_current_message = 1; ssl->keep_current_message = 1;
mbedtls_ssl_handshake_set_state(ssl, mbedtls_ssl_handshake_set_state(ssl,

View File

@ -3018,11 +3018,11 @@ void mbedtls_ssl_conf_session_tickets(mbedtls_ssl_config *conf, int use_tickets)
} }
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
void mbedtls_ssl_conf_enable_new_session_tickets(mbedtls_ssl_config *conf, void mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(
int use_new_session_tickets) mbedtls_ssl_config *conf, int signal_new_session_tickets)
{ {
conf->session_tickets &= ~MBEDTLS_SSL_SESSION_TICKETS_TLS1_3_MASK; conf->session_tickets &= ~MBEDTLS_SSL_SESSION_TICKETS_TLS1_3_MASK;
conf->session_tickets |= (use_new_session_tickets != 0) << conf->session_tickets |= (signal_new_session_tickets != 0) <<
MBEDTLS_SSL_SESSION_TICKETS_TLS1_3_BIT; MBEDTLS_SSL_SESSION_TICKETS_TLS1_3_BIT;
} }
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */ #endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
@ -5893,7 +5893,8 @@ int mbedtls_ssl_config_defaults(mbedtls_ssl_config *conf,
#if defined(MBEDTLS_SSL_SESSION_TICKETS) #if defined(MBEDTLS_SSL_SESSION_TICKETS)
mbedtls_ssl_conf_session_tickets(conf, MBEDTLS_SSL_SESSION_TICKETS_ENABLED); mbedtls_ssl_conf_session_tickets(conf, MBEDTLS_SSL_SESSION_TICKETS_ENABLED);
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
mbedtls_ssl_conf_enable_new_session_tickets(conf, MBEDTLS_SSL_NEW_SESSION_TICKETS_DISABLED); mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(
conf, MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_DISABLED);
#endif #endif
#endif #endif
} }

View File

@ -82,7 +82,7 @@ int main(void)
#define DFL_CID_VALUE_RENEGO NULL #define DFL_CID_VALUE_RENEGO NULL
#define DFL_RECONNECT_HARD 0 #define DFL_RECONNECT_HARD 0
#define DFL_TICKETS MBEDTLS_SSL_SESSION_TICKETS_ENABLED #define DFL_TICKETS MBEDTLS_SSL_SESSION_TICKETS_ENABLED
#define DFL_NEW_SESSION_TICKETS MBEDTLS_SSL_NEW_SESSION_TICKETS_ENABLED #define DFL_NEW_SESSION_TICKETS MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED
#define DFL_ALPN_STRING NULL #define DFL_ALPN_STRING NULL
#define DFL_GROUPS NULL #define DFL_GROUPS NULL
#define DFL_SIG_ALGS NULL #define DFL_SIG_ALGS NULL
@ -1946,7 +1946,8 @@ usage:
#if defined(MBEDTLS_SSL_SESSION_TICKETS) #if defined(MBEDTLS_SSL_SESSION_TICKETS)
mbedtls_ssl_conf_session_tickets(&conf, opt.tickets); mbedtls_ssl_conf_session_tickets(&conf, opt.tickets);
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
mbedtls_ssl_conf_enable_new_session_tickets(&conf, opt.new_session_tickets); mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(
&conf, opt.new_session_tickets);
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */ #endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
#endif /* MBEDTLS_SSL_SESSION_TICKETS */ #endif /* MBEDTLS_SSL_SESSION_TICKETS */

View File

@ -2543,8 +2543,8 @@ int mbedtls_test_get_tls13_ticket(
server_options, NULL, NULL, NULL); server_options, NULL, NULL, NULL);
TEST_EQUAL(ret, 0); TEST_EQUAL(ret, 0);
mbedtls_ssl_conf_enable_new_session_tickets( mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(
&client_ep.conf, MBEDTLS_SSL_NEW_SESSION_TICKETS_ENABLED); &client_ep.conf, MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED);
mbedtls_ssl_conf_session_tickets_cb(&server_ep.conf, mbedtls_ssl_conf_session_tickets_cb(&server_ep.conf,
mbedtls_test_ticket_write, mbedtls_test_ticket_write,