From fec982eacc184b08d00eaeb118c06918147bcfe7 Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Tue, 7 Sep 2021 17:26:06 +0800 Subject: [PATCH] fix coding style issues Signed-off-by: Jerry Yu --- library/ssl_tls13_client.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/ssl_tls13_client.c b/library/ssl_tls13_client.c index b10e33bfb..41c7a4d14 100644 --- a/library/ssl_tls13_client.c +++ b/library/ssl_tls13_client.c @@ -31,7 +31,6 @@ #include #define CLIENT_HELLO_RANDOM_LEN 32 -#define CLIENT_HELLO_LEGACY_VERSION_LEN 2 /* Write extensions */ @@ -132,7 +131,7 @@ static int ssl_tls13_write_client_hello_cipher_suites( unsigned char *end, size_t *olen ) { - unsigned char *p = buf; /* Iteration over the cipher_suites list */ + unsigned char *p = buf; const int *ciphersuite_list; unsigned char *cipher_suites_ptr; /* Start of the cipher_suites list */ size_t cipher_suites_len; @@ -229,9 +228,9 @@ static int ssl_tls13_write_client_hello_body( mbedtls_ssl_context *ssl, * For TLS 1.3 we use the legacy version number {0x03, 0x03} * instead of the true version number. */ - MBEDTLS_SSL_CHK_BUF_PTR( p, end, CLIENT_HELLO_LEGACY_VERSION_LEN ); + MBEDTLS_SSL_CHK_BUF_PTR( p, end, 2 ); MBEDTLS_PUT_UINT16_BE( 0x0303, p, 0 ); - p += CLIENT_HELLO_LEGACY_VERSION_LEN; + p += 2; /* Write the random bytes ( random ).*/ MBEDTLS_SSL_CHK_BUF_PTR( p, end, CLIENT_HELLO_RANDOM_LEN );