mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-25 02:02:03 +03:00
ssl_helpers.c: change prefix and move *queue_peek_info to static
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
@ -386,8 +386,7 @@ int mbedtls_test_mock_tcp_send_msg(void *ctx,
|
|||||||
* mbedtls_test_mock_tcp_recv_b failed.
|
* mbedtls_test_mock_tcp_recv_b failed.
|
||||||
*
|
*
|
||||||
* This function will also return any error other than
|
* This function will also return any error other than
|
||||||
* MBEDTLS_TEST_ERROR_MESSAGE_TRUNCATED from
|
* MBEDTLS_TEST_ERROR_MESSAGE_TRUNCATED from test_ssl_message_queue_peek_info.
|
||||||
* mbedtls_test_message_queue_peek_info.
|
|
||||||
*/
|
*/
|
||||||
int mbedtls_test_mock_tcp_recv_msg(void *ctx,
|
int mbedtls_test_mock_tcp_recv_msg(void *ctx,
|
||||||
unsigned char *buf, size_t buf_len);
|
unsigned char *buf, size_t buf_len);
|
||||||
|
@ -312,8 +312,9 @@ int mbedtls_test_ssl_message_queue_pop_info(
|
|||||||
* set to the full message length so that the
|
* set to the full message length so that the
|
||||||
* caller knows what portion of the message can be dropped.
|
* caller knows what portion of the message can be dropped.
|
||||||
*/
|
*/
|
||||||
int mbedtls_test_message_queue_peek_info(mbedtls_test_ssl_message_queue *queue,
|
static int test_ssl_message_queue_peek_info(
|
||||||
size_t buf_len, size_t *msg_len)
|
mbedtls_test_ssl_message_queue *queue,
|
||||||
|
size_t buf_len, size_t *msg_len)
|
||||||
{
|
{
|
||||||
if (queue == NULL || msg_len == NULL) {
|
if (queue == NULL || msg_len == NULL) {
|
||||||
return MBEDTLS_TEST_ERROR_ARG_NULL;
|
return MBEDTLS_TEST_ERROR_ARG_NULL;
|
||||||
@ -543,7 +544,7 @@ int mbedtls_test_mock_tcp_recv_msg(void *ctx,
|
|||||||
|
|
||||||
/* Peek first, so that in case of a socket error the data remains in
|
/* Peek first, so that in case of a socket error the data remains in
|
||||||
* the queue. */
|
* the queue. */
|
||||||
ret = mbedtls_test_message_queue_peek_info(queue, buf_len, &msg_len);
|
ret = test_ssl_message_queue_peek_info(queue, buf_len, &msg_len);
|
||||||
if (ret == MBEDTLS_TEST_ERROR_MESSAGE_TRUNCATED) {
|
if (ret == MBEDTLS_TEST_ERROR_MESSAGE_TRUNCATED) {
|
||||||
/* Calculate how much to drop */
|
/* Calculate how much to drop */
|
||||||
drop_len = msg_len - buf_len;
|
drop_len = msg_len - buf_len;
|
||||||
|
Reference in New Issue
Block a user