Fix format issues
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
diff --git a/library/ssl_misc.h b/library/ssl_misc.h
index d454ebb..581e153 100644
--- a/library/ssl_misc.h
+++ b/library/ssl_misc.h
@@ -2058,9 +2058,10 @@
#endif /* MBEDTLS_ECDH_C */
#if defined(MBEDTLS_SSL_EARLY_DATA)
-int mbedtls_ssl_tls13_write_early_data_ext(
- mbedtls_ssl_context *ssl,
- unsigned char *buf, const unsigned char *end, size_t *olen);
+int mbedtls_ssl_tls13_write_early_data_ext( mbedtls_ssl_context *ssl,
+ unsigned char *buf,
+ const unsigned char *end,
+ size_t *out_len );
#endif /* MBEDTLS_SSL_EARLY_DATA */
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
diff --git a/library/ssl_tls13_client.c b/library/ssl_tls13_client.c
index 8879c44..c019db2 100644
--- a/library/ssl_tls13_client.c
+++ b/library/ssl_tls13_client.c
@@ -693,7 +693,6 @@
}
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
-MBEDTLS_CHECK_RETURN_CRITICAL
static int ssl_tls13_has_configured_ticket( mbedtls_ssl_context *ssl )
{
mbedtls_ssl_session *session = ssl->session_negotiate;
@@ -1094,8 +1093,7 @@
}
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
- if( selected_identity == 0 &&
- ssl_tls13_has_configured_ticket( ssl ) )
+ if( selected_identity == 0 && ssl_tls13_has_configured_ticket( ssl ) )
{
ret = ssl_tls13_ticket_get_psk( ssl, &hash_alg, &psk, &psk_len );
}
@@ -1174,8 +1172,8 @@
p += ext_len;
ssl->handshake->early_data = MBEDTLS_SSL_EARLY_DATA_ON;
- /* We're using rejected once we send the EarlyData extension,
- and change it to accepted upon receipt of the server extension. */
+ /* Initializes the status to `rejected`. Changes it to `accepted`
+ * when `early_data` is received in EncryptedExtesion. */
ssl->early_data_status = MBEDTLS_SSL_EARLY_DATA_STATUS_REJECTED;
}
else
diff --git a/library/ssl_tls13_generic.c b/library/ssl_tls13_generic.c
index a273151..0479038 100644
--- a/library/ssl_tls13_generic.c
+++ b/library/ssl_tls13_generic.c
@@ -1374,11 +1374,11 @@
#endif /* MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE */
-/* Early Data Extension
+/* Early Data Indication Extension
*
* struct {
* select ( Handshake.msg_type ) {
- * case new_session_ticket: uint32 max_early_data_size;
+ * ...
* case client_hello: Empty;
* case encrypted_extensions: Empty;
* };
@@ -1399,7 +1399,6 @@
3, ( "client hello, adding early_data extension" ) );
MBEDTLS_PUT_UINT16_BE( MBEDTLS_TLS_EXT_EARLY_DATA, p, 0 );
- /* Write length of the early data indication extension */
MBEDTLS_PUT_UINT16_BE( 0, p, 2 );
*out_len = 4;