ssl_helpers.c: add mbedtls_test prefix for mbedtls_mock_socket_init
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
parent
5e22a929b3
commit
5f86a42813
3 changed files with 14 additions and 14 deletions
|
@ -285,13 +285,13 @@ int mbedtls_test_ssl_message_queue_pop_info(
|
|||
/*
|
||||
* Setup and teardown functions for mock sockets.
|
||||
*/
|
||||
void mbedtls_mock_socket_init(mbedtls_test_mock_socket *socket);
|
||||
void mbedtls_test_mock_socket_init(mbedtls_test_mock_socket *socket);
|
||||
|
||||
/*
|
||||
* Closes the socket \p socket.
|
||||
*
|
||||
* \p socket must have been previously initialized by calling
|
||||
* mbedtls_mock_socket_init().
|
||||
* mbedtls_test_mock_socket_init().
|
||||
*
|
||||
* This function frees all allocated resources and both sockets are aware of the
|
||||
* new connection state.
|
||||
|
@ -306,7 +306,7 @@ void mbedtls_test_mock_socket_close(mbedtls_test_mock_socket *socket);
|
|||
* Establishes a connection between \p peer1 and \p peer2.
|
||||
*
|
||||
* \p peer1 and \p peer2 must have been previously initialized by calling
|
||||
* mbedtls_mock_socket_init().
|
||||
* mbedtls_test_mock_socket_init().
|
||||
*
|
||||
* The capacities of the internal buffers are set to \p bufsize. Setting this to
|
||||
* the correct value allows for simulation of MTU, sanity testing the mock
|
||||
|
|
|
@ -327,7 +327,7 @@ static int test_ssl_message_queue_peek_info(
|
|||
return (*msg_len > buf_len) ? MBEDTLS_TEST_ERROR_MESSAGE_TRUNCATED : 0;
|
||||
}
|
||||
|
||||
void mbedtls_mock_socket_init(mbedtls_test_mock_socket *socket)
|
||||
void mbedtls_test_mock_socket_init(mbedtls_test_mock_socket *socket)
|
||||
{
|
||||
memset(socket, 0, sizeof(*socket));
|
||||
}
|
||||
|
@ -479,7 +479,7 @@ int mbedtls_test_message_socket_setup(
|
|||
ctx->queue_input = queue_input;
|
||||
ctx->queue_output = queue_output;
|
||||
ctx->socket = socket;
|
||||
mbedtls_mock_socket_init(socket);
|
||||
mbedtls_test_mock_socket_init(socket);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -781,7 +781,7 @@ int mbedtls_test_ssl_endpoint_init(
|
|||
100, &(ep->socket),
|
||||
dtls_context) == 0);
|
||||
} else {
|
||||
mbedtls_mock_socket_init(&(ep->socket));
|
||||
mbedtls_test_mock_socket_init(&(ep->socket));
|
||||
}
|
||||
|
||||
/* Non-blocking callbacks without timeout */
|
||||
|
|
|
@ -210,17 +210,17 @@ void ssl_mock_sanity()
|
|||
unsigned char received[MSGLEN] = { 0 };
|
||||
mbedtls_test_mock_socket socket;
|
||||
|
||||
mbedtls_mock_socket_init(&socket);
|
||||
mbedtls_test_mock_socket_init(&socket);
|
||||
TEST_ASSERT(mbedtls_test_mock_tcp_send_b(&socket, message, MSGLEN) < 0);
|
||||
mbedtls_test_mock_socket_close(&socket);
|
||||
mbedtls_mock_socket_init(&socket);
|
||||
mbedtls_test_mock_socket_init(&socket);
|
||||
TEST_ASSERT(mbedtls_test_mock_tcp_recv_b(&socket, received, MSGLEN) < 0);
|
||||
mbedtls_test_mock_socket_close(&socket);
|
||||
|
||||
mbedtls_mock_socket_init(&socket);
|
||||
mbedtls_test_mock_socket_init(&socket);
|
||||
TEST_ASSERT(mbedtls_test_mock_tcp_send_nb(&socket, message, MSGLEN) < 0);
|
||||
mbedtls_test_mock_socket_close(&socket);
|
||||
mbedtls_mock_socket_init(&socket);
|
||||
mbedtls_test_mock_socket_init(&socket);
|
||||
TEST_ASSERT(mbedtls_test_mock_tcp_recv_nb(&socket, received, MSGLEN) < 0);
|
||||
mbedtls_test_mock_socket_close(&socket);
|
||||
|
||||
|
@ -258,8 +258,8 @@ void ssl_mock_tcp(int blocking)
|
|||
recv = mbedtls_test_mock_tcp_recv_b;
|
||||
}
|
||||
|
||||
mbedtls_mock_socket_init(&client);
|
||||
mbedtls_mock_socket_init(&server);
|
||||
mbedtls_test_mock_socket_init(&client);
|
||||
mbedtls_test_mock_socket_init(&server);
|
||||
|
||||
/* Fill up the buffer with structured data so that unwanted changes
|
||||
* can be detected */
|
||||
|
@ -356,8 +356,8 @@ void ssl_mock_tcp_interleaving(int blocking)
|
|||
recv = mbedtls_test_mock_tcp_recv_b;
|
||||
}
|
||||
|
||||
mbedtls_mock_socket_init(&client);
|
||||
mbedtls_mock_socket_init(&server);
|
||||
mbedtls_test_mock_socket_init(&client);
|
||||
mbedtls_test_mock_socket_init(&server);
|
||||
|
||||
/* Fill up the buffers with structured data so that unwanted changes
|
||||
* can be detected */
|
||||
|
|
Loading…
Reference in a new issue