improve code format and readability

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
This commit is contained in:
Pengyu Lv 2022-12-09 14:39:19 +08:00
parent 302feb3955
commit 9eacb44a5e
2 changed files with 11 additions and 13 deletions

View file

@ -2630,8 +2630,8 @@ static int ssl_tls13_parse_new_session_ticket(mbedtls_ssl_context *ssl,
session->ticket_len = ticket_len;
/* Clear all flags in ticket_flags */
mbedtls_ssl_tls13_session_clear_ticket_flags(session,
MBEDTLS_SSL_TLS1_3_TICKET_FLAGS_MASK);
mbedtls_ssl_tls13_session_clear_ticket_flags(
session, MBEDTLS_SSL_TLS1_3_TICKET_FLAGS_MASK);
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, 2);
extensions_len = MBEDTLS_GET_UINT16_BE(p, 0);
@ -2717,8 +2717,8 @@ static int ssl_tls13_postprocess_new_session_ticket(mbedtls_ssl_context *ssl,
session->resumption_key_len);
/* Set ticket_flags depends on the selected key exchange modes */
mbedtls_ssl_tls13_session_set_ticket_flags(session,
ssl->conf->tls13_kex_modes);
mbedtls_ssl_tls13_session_set_ticket_flags(
session, ssl->conf->tls13_kex_modes);
MBEDTLS_SSL_DEBUG_TICKET_FLAGS(4, session->ticket_flags);
return 0;

View file

@ -170,12 +170,10 @@ static int ssl_tls13_offered_psks_check_identity_match_ticket(
* We regard the ticket with incompatible key exchange modes as not match.
*/
ret = MBEDTLS_ERR_SSL_TICKET_INVALID_KEX_MODE;
MBEDTLS_SSL_DEBUG_TICKET_FLAGS(4,
session->ticket_flags);
MBEDTLS_SSL_DEBUG_TICKET_FLAGS(4, session->ticket_flags);
if (mbedtls_ssl_tls13_check_kex_modes(ssl,
mbedtls_ssl_tls13_session_get_ticket_flags(session,
MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_ALL)))
{
mbedtls_ssl_tls13_session_get_ticket_flags(
session, MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_ALL))) {
MBEDTLS_SSL_DEBUG_MSG(3, ("No suitable key exchange mode"));
goto exit;
}
@ -2630,11 +2628,11 @@ static int ssl_tls13_prepare_new_session_ticket(mbedtls_ssl_context *ssl,
#endif
/* Set ticket_flags depends on the advertised psk key exchange mode */
mbedtls_ssl_tls13_session_clear_ticket_flags(session,
MBEDTLS_SSL_TLS1_3_TICKET_FLAGS_MASK);
mbedtls_ssl_tls13_session_clear_ticket_flags(
session, MBEDTLS_SSL_TLS1_3_TICKET_FLAGS_MASK);
#if defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_SOME_PSK_ENABLED)
mbedtls_ssl_tls13_session_set_ticket_flags(session,
ssl->handshake->tls13_kex_modes);
mbedtls_ssl_tls13_session_set_ticket_flags(
session, ssl->handshake->tls13_kex_modes);
#endif
MBEDTLS_SSL_DEBUG_TICKET_FLAGS(4, session->ticket_flags);