From e28d9745a12b32243fb0c292f98000e95303029f Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Thu, 18 Aug 2022 15:44:03 +0800 Subject: [PATCH] fix coding style issues Signed-off-by: Jerry Yu --- library/ssl_tls.c | 8 +------- tests/suites/test_suite_ssl.function | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 266cf77b14..c45a1b84c6 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -1945,19 +1945,15 @@ static int ssl_tls13_session_save( const mbedtls_ssl_session *session, /* Check size_t overflow */ if( session->ticket_len > SIZE_MAX - needed ) - { return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA ); - } - needed += session->ticket_len; /* ticket */ + needed += session->ticket_len; /* ticket */ } #endif /* MBEDTLS_SSL_CLI_C */ *olen = needed; if( needed > buf_len ) - { return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ); - } p[0] = session->endpoint; MBEDTLS_PUT_UINT16_BE( session->ciphersuite, p, 1 ); @@ -3073,9 +3069,7 @@ static int ssl_session_save( const mbedtls_ssl_session *session, case MBEDTLS_SSL_VERSION_TLS1_3: ret = ssl_tls13_session_save( session, p, remaining_len, &out_len ); if( ret != 0 && ret != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ) - { return( ret ); - } used += out_len; break; #endif /* MBEDTLS_SSL_PROTO_TLS1_3 */ diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index 7f78e4d434..145591dfa5 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -4809,7 +4809,7 @@ void ssl_serialize_session_save_load( int ticket_len, char *crt_file, original.resumption_key_len ) == 0 ); } #if defined(MBEDTLS_HAVE_TIME) && defined(MBEDTLS_SSL_SRV_C) - if( endpoint_type == MBEDTLS_SSL_IS_SERVER) + if( endpoint_type == MBEDTLS_SSL_IS_SERVER ) { TEST_ASSERT( original.start == restored.start ); }