fix various issues

- typo error
- replace `ssl->hanshake` with handshake

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2022-11-09 22:43:31 +08:00
parent 616ba75c23
commit 97be6a913e
7 changed files with 11 additions and 12 deletions

View File

@ -676,7 +676,7 @@ static int ssl_write_client_hello_body( mbedtls_ssl_context *ssl,
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
MBEDTLS_SSL_PRINT_EXTS( MBEDTLS_SSL_PRINT_EXTS(
3, MBEDTLS_SSL_HS_CLIENT_HELLO, ssl->handshake->sent_extensions ); 3, MBEDTLS_SSL_HS_CLIENT_HELLO, handshake->sent_extensions );
#endif #endif
*out_len = p - buf; *out_len = p - buf;

View File

@ -55,9 +55,9 @@ void mbedtls_ssl_print_extension( const mbedtls_ssl_context *ssl,
int hs_msg_type, unsigned int extension_type, int hs_msg_type, unsigned int extension_type,
const char *extra_msg0, const char *extra_msg1 ); const char *extra_msg0, const char *extra_msg1 );
#define MBEDTLS_SSL_PRINT_EXTS( level, hs_msg_type, extension_mask ) \ #define MBEDTLS_SSL_PRINT_EXTS( level, hs_msg_type, extensions_mask ) \
mbedtls_ssl_print_extensions( ssl, level, __FILE__, __LINE__, \ mbedtls_ssl_print_extensions( ssl, level, __FILE__, __LINE__, \
hs_msg_type, extension_mask, NULL ) hs_msg_type, extensions_mask, NULL )
#define MBEDTLS_SSL_PRINT_EXT( level, hs_msg_type, extension_type, extra ) \ #define MBEDTLS_SSL_PRINT_EXT( level, hs_msg_type, extension_type, extra ) \
mbedtls_ssl_print_extension( ssl, level, __FILE__, __LINE__, \ mbedtls_ssl_print_extension( ssl, level, __FILE__, __LINE__, \

View File

@ -754,7 +754,7 @@ void mbedtls_ssl_print_extensions( const mbedtls_ssl_context *ssl,
{ {
mbedtls_ssl_print_extension( mbedtls_ssl_print_extension(
ssl, level, file, line, hs_msg_type, extension_type_table[i], ssl, level, file, line, hs_msg_type, extension_type_table[i],
extensions_mask & ( 1 << i ) ? "exists" : "does not exists", extra ); extensions_mask & ( 1 << i ) ? "exists" : "does not exist", extra );
} }
} }

View File

@ -1742,8 +1742,7 @@ static int ssl_tls13_parse_server_hello( mbedtls_ssl_context *ssl,
p += extension_data_len; p += extension_data_len;
} }
MBEDTLS_SSL_PRINT_EXTS( MBEDTLS_SSL_PRINT_EXTS( 3, hs_msg_type, handshake->received_extensions );
3, hs_msg_type, ssl->handshake->received_extensions );
cleanup: cleanup:
@ -2036,7 +2035,7 @@ static int ssl_tls13_parse_encrypted_extensions( mbedtls_ssl_context *ssl,
} }
MBEDTLS_SSL_PRINT_EXTS( 3, MBEDTLS_SSL_HS_ENCRYPTED_EXTENSIONS, MBEDTLS_SSL_PRINT_EXTS( 3, MBEDTLS_SSL_HS_ENCRYPTED_EXTENSIONS,
ssl->handshake->received_extensions ); handshake->received_extensions );
/* Check that we consumed all the message. */ /* Check that we consumed all the message. */
if( p != end ) if( p != end )
@ -2225,7 +2224,7 @@ static int ssl_tls13_parse_certificate_request( mbedtls_ssl_context *ssl,
} }
MBEDTLS_SSL_PRINT_EXTS( 3, MBEDTLS_SSL_HS_CERTIFICATE_REQUEST, MBEDTLS_SSL_PRINT_EXTS( 3, MBEDTLS_SSL_HS_CERTIFICATE_REQUEST,
ssl->handshake->received_extensions ); handshake->received_extensions );
/* Check that we consumed all the message. */ /* Check that we consumed all the message. */
if( p != end ) if( p != end )
@ -2517,7 +2516,7 @@ static int ssl_tls13_parse_new_session_ticket_exts( mbedtls_ssl_context *ssl,
} }
MBEDTLS_SSL_PRINT_EXTS( 3, MBEDTLS_SSL_HS_NEW_SESSION_TICKET, MBEDTLS_SSL_PRINT_EXTS( 3, MBEDTLS_SSL_HS_NEW_SESSION_TICKET,
ssl->handshake->received_extensions ); handshake->received_extensions );
return( 0 ); return( 0 );
} }

View File

@ -547,7 +547,7 @@ int mbedtls_ssl_tls13_parse_certificate( mbedtls_ssl_context *ssl,
} }
MBEDTLS_SSL_PRINT_EXTS( 3, MBEDTLS_SSL_HS_CERTIFICATE, MBEDTLS_SSL_PRINT_EXTS( 3, MBEDTLS_SSL_HS_CERTIFICATE,
ssl->handshake->received_extensions ); handshake->received_extensions );
} }
exit: exit:

View File

@ -1624,7 +1624,7 @@ static int ssl_tls13_parse_client_hello( mbedtls_ssl_context *ssl,
} }
MBEDTLS_SSL_PRINT_EXTS( 3, MBEDTLS_SSL_HS_CLIENT_HELLO, MBEDTLS_SSL_PRINT_EXTS( 3, MBEDTLS_SSL_HS_CLIENT_HELLO,
ssl->handshake->received_extensions ); handshake->received_extensions );
mbedtls_ssl_add_hs_hdr_to_checksum( ssl, mbedtls_ssl_add_hs_hdr_to_checksum( ssl,
MBEDTLS_SSL_HS_CLIENT_HELLO, MBEDTLS_SSL_HS_CLIENT_HELLO,

View File

@ -18,7 +18,7 @@
# limitations under the License. # limitations under the License.
# #
# DO NOT ADD NEW TEST CASES INTO THIS FILE. The left cases can be generated by # DO NOT ADD NEW TEST CASES INTO THIS FILE. The left cases will be generated by
# scripts in future(#6280) # scripts in future(#6280)
requires_gnutls_tls1_3 requires_gnutls_tls1_3