ssl_client.c: Improve coding style

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2022-03-30 20:24:51 +02:00
parent da41b38c42
commit 150d579d7a

View file

@ -580,13 +580,6 @@ static int ssl_write_client_hello_body( mbedtls_ssl_context *ssl,
{ {
int ret; int ret;
mbedtls_ssl_handshake_params *handshake = ssl->handshake; mbedtls_ssl_handshake_params *handshake = ssl->handshake;
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
unsigned char propose_tls12 = 0;
#endif
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
unsigned char propose_tls13 = 0;
#endif
unsigned char *p = buf; unsigned char *p = buf;
unsigned char *p_extensions_len; /* Pointer to extensions length */ unsigned char *p_extensions_len; /* Pointer to extensions length */
size_t output_len; /* Length of buffer used by function */ size_t output_len; /* Length of buffer used by function */
@ -596,14 +589,16 @@ static int ssl_write_client_hello_body( mbedtls_ssl_context *ssl,
*out_len = 0; *out_len = 0;
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) #if defined(MBEDTLS_SSL_PROTO_TLS1_2)
propose_tls12 = ( handshake->min_minor_ver <= MBEDTLS_SSL_MINOR_VERSION_3 ) unsigned char propose_tls12 =
&& ( handshake->min_minor_ver <= MBEDTLS_SSL_MINOR_VERSION_3 )
( MBEDTLS_SSL_MINOR_VERSION_3 <= ssl->minor_ver ); &&
( MBEDTLS_SSL_MINOR_VERSION_3 <= ssl->minor_ver );
#endif #endif
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
propose_tls13 = ( handshake->min_minor_ver <= MBEDTLS_SSL_MINOR_VERSION_4 ) unsigned char propose_tls13 =
&& ( handshake->min_minor_ver <= MBEDTLS_SSL_MINOR_VERSION_4 )
( MBEDTLS_SSL_MINOR_VERSION_4 <= ssl->minor_ver ); &&
( MBEDTLS_SSL_MINOR_VERSION_4 <= ssl->minor_ver );
#endif #endif
/* /*