replace early data permission check

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2023-11-22 10:08:13 +08:00
parent 4da7c22cd6
commit c2b1bc4fb6
2 changed files with 4 additions and 9 deletions

View file

@ -695,10 +695,8 @@ static int ssl_tls13_early_data_has_valid_ticket(mbedtls_ssl_context *ssl)
mbedtls_ssl_session *session = ssl->session_negotiate;
return ssl->handshake->resume &&
session->tls_version == MBEDTLS_SSL_VERSION_TLS1_3 &&
(session->ticket_flags &
MBEDTLS_SSL_TLS1_3_TICKET_ALLOW_EARLY_DATA) &&
mbedtls_ssl_tls13_cipher_suite_is_offered(
ssl, session->ciphersuite);
mbedtls_ssl_session_ticket_allow_early_data(session) &&
mbedtls_ssl_tls13_cipher_suite_is_offered(ssl, session->ciphersuite);
}
#endif

View file

@ -1845,9 +1845,7 @@ static void ssl_tls13_update_early_data_status(mbedtls_ssl_context *ssl)
}
if (mbedtls_ssl_session_get_ticket_flags(
ssl->session_negotiate,
MBEDTLS_SSL_TLS1_3_TICKET_ALLOW_EARLY_DATA) == 0) {
if (!mbedtls_ssl_session_ticket_allow_early_data(ssl->session_negotiate)) {
MBEDTLS_SSL_DEBUG_MSG(
1,
("EarlyData: rejected, early_data not allowed in ticket "
@ -3223,8 +3221,7 @@ static int ssl_tls13_write_nst_early_data_ext(mbedtls_ssl_context *ssl,
unsigned char *p = buf;
*out_len = 0;
if (mbedtls_ssl_session_get_ticket_flags(
ssl->session, MBEDTLS_SSL_TLS1_3_TICKET_ALLOW_EARLY_DATA) == 0) {
if (!mbedtls_ssl_session_ticket_allow_early_data(ssl->session)) {
MBEDTLS_SSL_DEBUG_MSG(
4, ("early_data not allowed, skip early_data extension in "
"NewSessionTicket"));