ssl_helpers.c: improve code readability
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
diff --git a/tests/include/test/ssl_helpers.h b/tests/include/test/ssl_helpers.h
index cb6fd2e..b38c58a 100644
--- a/tests/include/test/ssl_helpers.h
+++ b/tests/include/test/ssl_helpers.h
@@ -317,16 +317,16 @@
/*
* Callbacks for simulating blocking I/O over connection-oriented transport.
*/
-int mbedtls_test_mock_tcp_send_b(void *ctx, const unsigned char *buf,
- size_t len);
+int mbedtls_test_mock_tcp_send_b(void *ctx,
+ const unsigned char *buf, size_t len);
int mbedtls_test_mock_tcp_recv_b(void *ctx, unsigned char *buf, size_t len);
/*
* Callbacks for simulating non-blocking I/O over connection-oriented transport.
*/
-int mbedtls_test_mock_tcp_send_nb(void *ctx, const unsigned char *buf,
- size_t len);
+int mbedtls_test_mock_tcp_send_nb(void *ctx,
+ const unsigned char *buf, size_t len);
int mbedtls_test_mock_tcp_recv_nb(void *ctx, unsigned char *buf, size_t len);
@@ -368,8 +368,8 @@
* This function will also return any error from
* mbedtls_test_ssl_message_queue_push_info.
*/
-int mbedtls_test_mock_tcp_send_msg(void *ctx, const unsigned char *buf,
- size_t len);
+int mbedtls_test_mock_tcp_send_msg(void *ctx,
+ const unsigned char *buf, size_t len);
/*
* Receive one message from a given message socket context and return message
@@ -385,8 +385,8 @@
* MBEDTLS_TEST_ERROR_MESSAGE_TRUNCATED from
* mbedtls_test_message_queue_peek_info.
*/
-int mbedtls_test_mock_tcp_recv_msg(void *ctx, unsigned char *buf,
- size_t buf_len);
+int mbedtls_test_mock_tcp_recv_msg(void *ctx,
+ unsigned char *buf, size_t buf_len);
#if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED)
diff --git a/tests/src/test_helpers/ssl_helpers.c b/tests/src/test_helpers/ssl_helpers.c
index d18114b..d248e29 100644
--- a/tests/src/test_helpers/ssl_helpers.c
+++ b/tests/src/test_helpers/ssl_helpers.c
@@ -405,8 +405,8 @@
return ret;
}
-int mbedtls_test_mock_tcp_send_b(void *ctx, const unsigned char *buf,
- size_t len)
+int mbedtls_test_mock_tcp_send_b(void *ctx,
+ const unsigned char *buf, size_t len)
{
mbedtls_test_mock_socket *socket = (mbedtls_test_mock_socket *) ctx;
@@ -561,8 +561,8 @@
if (ret == MBEDTLS_TEST_ERROR_MESSAGE_TRUNCATED) {
/* Drop the remaining part of the message */
- if (mbedtls_test_mock_tcp_recv_b(socket, NULL, drop_len)
- != (int) drop_len) {
+ if (mbedtls_test_mock_tcp_recv_b(socket, NULL, drop_len) !=
+ (int) drop_len) {
/* Inconsistent state - part of the message was read,
* and a part couldn't. Not much we can do here, but it should not
* happen in test environment, unless forced manually. */
@@ -2106,11 +2106,9 @@
exit:
mbedtls_test_ssl_endpoint_free(&client,
- options->dtls != 0 ?
- &client_context : NULL);
+ options->dtls != 0 ? &client_context : NULL);
mbedtls_test_ssl_endpoint_free(&server,
- options->dtls != 0 ?
- &server_context : NULL);
+ options->dtls != 0 ? &server_context : NULL);
#if defined(MBEDTLS_DEBUG_C)
if (options->cli_log_fun || options->srv_log_fun) {
mbedtls_debug_set_threshold(0);