mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-10 15:40:30 +00:00
fix too long lines
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
6f13f64aa6
commit
e885b76980
@ -59,7 +59,7 @@ int mbedtls_ssl_handshake_client_step_tls1_3( mbedtls_ssl_context *ssl )
|
|||||||
|
|
||||||
case MBEDTLS_SSL_SERVER_HELLO:
|
case MBEDTLS_SSL_SERVER_HELLO:
|
||||||
// Stop here : we haven't finished whole flow
|
// Stop here : we haven't finished whole flow
|
||||||
ret=MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE;
|
ret = MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE;
|
||||||
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_ENCRYPTED_EXTENSIONS );
|
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_ENCRYPTED_EXTENSIONS );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -88,17 +88,20 @@ static int ssl_client_hello_process( mbedtls_ssl_context *ssl )
|
|||||||
|
|
||||||
MBEDTLS_SSL_PROC_CHK( ssl_client_hello_prepare, ( ssl ) );
|
MBEDTLS_SSL_PROC_CHK( ssl_client_hello_prepare, ( ssl ) );
|
||||||
|
|
||||||
MBEDTLS_SSL_PROC_CHK( mbedtls_ssl_start_handshake_msg, ( ssl,
|
MBEDTLS_SSL_PROC_CHK( mbedtls_ssl_start_handshake_msg,
|
||||||
MBEDTLS_SSL_HS_CLIENT_HELLO, &buf, &buf_len ) );
|
( ssl, MBEDTLS_SSL_HS_CLIENT_HELLO,
|
||||||
|
&buf, &buf_len ) );
|
||||||
|
|
||||||
MBEDTLS_SSL_PROC_CHK( ssl_client_hello_write_partial, ( ssl, buf, buf_len, &msg_len ) );
|
MBEDTLS_SSL_PROC_CHK( ssl_client_hello_write_partial,
|
||||||
|
( ssl, buf, buf_len, &msg_len ) );
|
||||||
|
|
||||||
mbedtls_ssl_add_hs_hdr_to_checksum( ssl, MBEDTLS_SSL_HS_CLIENT_HELLO,
|
mbedtls_ssl_add_hs_hdr_to_checksum( ssl, MBEDTLS_SSL_HS_CLIENT_HELLO,
|
||||||
msg_len );
|
msg_len );
|
||||||
ssl->handshake->update_checksum( ssl, buf, 0 );
|
ssl->handshake->update_checksum( ssl, buf, 0 );
|
||||||
|
|
||||||
MBEDTLS_SSL_PROC_CHK( ssl_client_hello_postprocess, ( ssl ) );
|
MBEDTLS_SSL_PROC_CHK( ssl_client_hello_postprocess, ( ssl ) );
|
||||||
MBEDTLS_SSL_PROC_CHK( mbedtls_ssl_finish_handshake_msg, ( ssl, buf_len, msg_len ) );
|
MBEDTLS_SSL_PROC_CHK( mbedtls_ssl_finish_handshake_msg,
|
||||||
|
( ssl, buf_len, msg_len ) );
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
||||||
@ -177,8 +180,8 @@ static int ssl_client_hello_write_partial( mbedtls_ssl_context *ssl,
|
|||||||
/* Ciphersuite-related variables */
|
/* Ciphersuite-related variables */
|
||||||
const int* ciphersuites;
|
const int* ciphersuites;
|
||||||
const mbedtls_ssl_ciphersuite_t* ciphersuite_info;
|
const mbedtls_ssl_ciphersuite_t* ciphersuite_info;
|
||||||
size_t i; /* used to iterate through ciphersuite list */
|
/* ciphersuite_start points to the start of
|
||||||
/* ciphersuite_start points to the start of the ciphersuite list, i.e. to the length field*/
|
the ciphersuite list, i.e. to the length field*/
|
||||||
unsigned char* ciphersuite_start;
|
unsigned char* ciphersuite_start;
|
||||||
size_t ciphersuite_count;
|
size_t ciphersuite_count;
|
||||||
|
|
||||||
@ -220,7 +223,8 @@ static int ssl_client_hello_write_partial( mbedtls_ssl_context *ssl,
|
|||||||
/* Write random bytes */
|
/* Write random bytes */
|
||||||
MBEDTLS_SSL_CHK_BUF_PTR( buf, end, CLIENT_HELLO_RAND_BYTES_LEN);
|
MBEDTLS_SSL_CHK_BUF_PTR( buf, end, CLIENT_HELLO_RAND_BYTES_LEN);
|
||||||
memcpy( buf, ssl->handshake->randbytes, CLIENT_HELLO_RAND_BYTES_LEN );
|
memcpy( buf, ssl->handshake->randbytes, CLIENT_HELLO_RAND_BYTES_LEN );
|
||||||
MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, random bytes", buf, CLIENT_HELLO_RAND_BYTES_LEN );
|
MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, random bytes",
|
||||||
|
buf, CLIENT_HELLO_RAND_BYTES_LEN );
|
||||||
|
|
||||||
buf += CLIENT_HELLO_RAND_BYTES_LEN;
|
buf += CLIENT_HELLO_RAND_BYTES_LEN;
|
||||||
buflen -= CLIENT_HELLO_RAND_BYTES_LEN;
|
buflen -= CLIENT_HELLO_RAND_BYTES_LEN;
|
||||||
@ -268,7 +272,7 @@ static int ssl_client_hello_write_partial( mbedtls_ssl_context *ssl,
|
|||||||
buf += 2;
|
buf += 2;
|
||||||
buflen -= 2;
|
buflen -= 2;
|
||||||
|
|
||||||
for ( i = 0; ciphersuites[i] != 0; i++ )
|
for ( size_t i = 0; ciphersuites[i] != 0; i++ )
|
||||||
{
|
{
|
||||||
ciphersuite_info = mbedtls_ssl_ciphersuite_from_id( ciphersuites[i] );
|
ciphersuite_info = mbedtls_ssl_ciphersuite_from_id( ciphersuites[i] );
|
||||||
|
|
||||||
@ -280,7 +284,8 @@ static int ssl_client_hello_write_partial( mbedtls_ssl_context *ssl,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 3, ( "client hello, add ciphersuite: %04x, %s",
|
MBEDTLS_SSL_DEBUG_MSG( 3, ( "client hello, add ciphersuite: %04x, %s",
|
||||||
(unsigned int) ciphersuites[i], ciphersuite_info->name ) );
|
(unsigned int) ciphersuites[i],
|
||||||
|
ciphersuite_info->name ) );
|
||||||
|
|
||||||
ciphersuite_count++;
|
ciphersuite_count++;
|
||||||
|
|
||||||
@ -301,7 +306,9 @@ static int ssl_client_hello_write_partial( mbedtls_ssl_context *ssl,
|
|||||||
*ciphersuite_start++ = (unsigned char)( ciphersuite_count*2 >> 8 );
|
*ciphersuite_start++ = (unsigned char)( ciphersuite_count*2 >> 8 );
|
||||||
*ciphersuite_start++ = (unsigned char)( ciphersuite_count*2 );
|
*ciphersuite_start++ = (unsigned char)( ciphersuite_count*2 );
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 3, ( "client hello, got %" MBEDTLS_PRINTF_SIZET " ciphersuites", ciphersuite_count ) );
|
MBEDTLS_SSL_DEBUG_MSG( 3,
|
||||||
|
( "client hello, got %" MBEDTLS_PRINTF_SIZET " ciphersuites",
|
||||||
|
ciphersuite_count ) );
|
||||||
|
|
||||||
/* For every TLS 1.3 ClientHello, this vector MUST contain exactly
|
/* For every TLS 1.3 ClientHello, this vector MUST contain exactly
|
||||||
* one byte set to zero, which corresponds to the 'null' compression
|
* one byte set to zero, which corresponds to the 'null' compression
|
||||||
@ -421,7 +428,8 @@ static int ssl_write_supported_versions_ext( mbedtls_ssl_context *ssl,
|
|||||||
mbedtls_ssl_write_version( ssl->conf->max_major_ver, ssl->conf->max_minor_ver,
|
mbedtls_ssl_write_version( ssl->conf->max_major_ver, ssl->conf->max_minor_ver,
|
||||||
ssl->conf->transport, p );
|
ssl->conf->transport, p );
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 3, ( "supported version: [%d:%d]", ssl->conf->max_major_ver, ssl->conf->max_minor_ver ) );
|
MBEDTLS_SSL_DEBUG_MSG( 3, ( "supported version: [%d:%d]",
|
||||||
|
ssl->conf->max_major_ver, ssl->conf->max_minor_ver ) );
|
||||||
|
|
||||||
*olen = 7;
|
*olen = 7;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user