From a042b8406d0ec8489eceff88e27c5583577bab26 Mon Sep 17 00:00:00 2001 From: Xiaokang Qian Date: Wed, 9 Nov 2022 01:59:33 +0000 Subject: [PATCH] Address some format issues Signed-off-by: Xiaokang Qian --- library/ssl_misc.h | 4 ---- library/ssl_tls13_client.c | 8 +++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/library/ssl_misc.h b/library/ssl_misc.h index 342cabb3a..4d7f63547 100644 --- a/library/ssl_misc.h +++ b/library/ssl_misc.h @@ -77,10 +77,6 @@ /* Faked handshake message identity for HelloRetryRequest. */ #define MBEDTLS_SSL_TLS1_3_HS_HELLO_RETRY_REQUEST ( -MBEDTLS_SSL_HS_SERVER_HELLO ) -/* Early data indication sent or not */ -#define MBEDTLS_SSL_EARLY_DATA_OFF 0 -#define MBEDTLS_SSL_EARLY_DATA_ON 1 - /* * Internal identity of handshake extensions */ diff --git a/library/ssl_tls13_client.c b/library/ssl_tls13_client.c index 46c7c4589..f68b24080 100644 --- a/library/ssl_tls13_client.c +++ b/library/ssl_tls13_client.c @@ -1182,8 +1182,10 @@ int mbedtls_ssl_tls13_write_client_hello_exts( mbedtls_ssl_context *ssl, return( ret ); p += ext_len; - /* Initializes the status to `indication sent`. Changes it to `accepted` - * when `early_data` is received in EncryptedExtesion. */ + /* Initializes the status to `indication sent`. It will be updated to + * `accepted` or `rejected` depend on whether the EncryptedExtension + * message will contain an early data indication extension or not. + */ ssl->early_data_status = MBEDTLS_SSL_EARLY_DATA_STATUS_INDICATION_SENT; } else @@ -2540,7 +2542,7 @@ static int ssl_tls13_parse_new_session_ticket_exts( mbedtls_ssl_context *ssl, { case MBEDTLS_TLS_EXT_EARLY_DATA: MBEDTLS_SSL_DEBUG_MSG( 4, ( "early_data extension received" ) ); - if( extension_data_len == 4 && ssl->session != NULL) + if( extension_data_len == 4 && ssl->session != NULL ) ssl->session->ticket_flags |= MBEDTLS_SSL_TICKET_ALLOW_EARLY_DATA; break;