mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-31 10:20:45 +00:00
fix various comment issues
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
ef387d79a4
commit
8c02bb4b71
@ -132,10 +132,10 @@
|
|||||||
#define MBEDTLS_SSL_EXT_KEY_SHARE ( 1 << 21 )
|
#define MBEDTLS_SSL_EXT_KEY_SHARE ( 1 << 21 )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper macros for function call with returen check.
|
* Helper macros for function call with return check.
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Exit and print debug message when return none zero value
|
* Exit when return non-zero value
|
||||||
*/
|
*/
|
||||||
#define MBEDTLS_SSL_PROC_CHK( f ) \
|
#define MBEDTLS_SSL_PROC_CHK( f ) \
|
||||||
do { \
|
do { \
|
||||||
@ -146,7 +146,7 @@
|
|||||||
} \
|
} \
|
||||||
} while( 0 )
|
} while( 0 )
|
||||||
/*
|
/*
|
||||||
* Exit and print debug message when return negative value
|
* Exit when return negative value
|
||||||
*/
|
*/
|
||||||
#define MBEDTLS_SSL_PROC_CHK_NEG( f ) \
|
#define MBEDTLS_SSL_PROC_CHK_NEG( f ) \
|
||||||
do { \
|
do { \
|
||||||
|
@ -164,8 +164,8 @@ static int ssl_tls13_write_client_hello_cipher_suites(
|
|||||||
ciphersuite_info = mbedtls_ssl_ciphersuite_from_id( cipher_suite );
|
ciphersuite_info = mbedtls_ssl_ciphersuite_from_id( cipher_suite );
|
||||||
if( ciphersuite_info == NULL )
|
if( ciphersuite_info == NULL )
|
||||||
continue;
|
continue;
|
||||||
if( ciphersuite_info->min_minor_ver != MBEDTLS_SSL_MINOR_VERSION_4 ||
|
if( !( MBEDTLS_SSL_MINOR_VERSION_4 > ciphersuite_info->min_minor_ver &&
|
||||||
ciphersuite_info->max_minor_ver != MBEDTLS_SSL_MINOR_VERSION_4 )
|
MBEDTLS_SSL_MINOR_VERSION_4 < ciphersuite_info->max_minor_ver ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 3, ( "client hello, add ciphersuite: %04x, %s",
|
MBEDTLS_SSL_DEBUG_MSG( 3, ( "client hello, add ciphersuite: %04x, %s",
|
||||||
@ -173,7 +173,7 @@ static int ssl_tls13_write_client_hello_cipher_suites(
|
|||||||
ciphersuite_info->name ) );
|
ciphersuite_info->name ) );
|
||||||
|
|
||||||
/* Check there is space for the cipher suite identifier (2 bytes). */
|
/* Check there is space for the cipher suite identifier (2 bytes). */
|
||||||
MBEDTLS_SSL_CHK_BUF_PTR( buf, end, 2 );
|
MBEDTLS_SSL_CHK_BUF_PTR( cipher_suites_iter, end, 2 );
|
||||||
MBEDTLS_PUT_UINT16_BE( cipher_suite, cipher_suites_iter, 0 );
|
MBEDTLS_PUT_UINT16_BE( cipher_suite, cipher_suites_iter, 0 );
|
||||||
cipher_suites_iter += 2;
|
cipher_suites_iter += 2;
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ static int ssl_tls13_write_client_hello_body( mbedtls_ssl_context *ssl,
|
|||||||
{
|
{
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
unsigned char *extensions_len_ptr; /* Pointer of extensions length */
|
unsigned char *extensions_len_ptr; /* Pointer to extensions length */
|
||||||
size_t output_len; /* Length of buffer used by function */
|
size_t output_len; /* Length of buffer used by function */
|
||||||
size_t extensions_len; /* Length of the list of extensions*/
|
size_t extensions_len; /* Length of the list of extensions*/
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ static int ssl_tls13_prepare_client_hello( mbedtls_ssl_context *ssl )
|
|||||||
ssl->handshake->randbytes,
|
ssl->handshake->randbytes,
|
||||||
CLIENT_HELLO_RANDOM_LEN ) ) != 0 )
|
CLIENT_HELLO_RANDOM_LEN ) ) != 0 )
|
||||||
{
|
{
|
||||||
MBEDTLS_SSL_DEBUG_RET( 1, "ssl_generate_random", ret );
|
MBEDTLS_SSL_DEBUG_RET( 1, "f_rng", ret );
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,12 +410,6 @@ int mbedtls_ssl_tls13_handshake_client_step( mbedtls_ssl_context *ssl )
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if( ssl->state == MBEDTLS_SSL_HANDSHAKE_OVER || ssl->handshake == NULL )
|
|
||||||
{
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "Handshake completed but ssl->handshake is NULL.\n" ) );
|
|
||||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
|
||||||
}
|
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "client state: %d", ssl->state ) );
|
MBEDTLS_SSL_DEBUG_MSG( 2, ( "client state: %d", ssl->state ) );
|
||||||
|
|
||||||
switch( ssl->state )
|
switch( ssl->state )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user