Lines Matching refs:message

260  * Errors used in the message transport mock tests
266 * Context for a message metadata queue (fifo) that is on top of the ring buffer.
277 * Setup and free functions for the message metadata queue.
279 * \p capacity describes the number of message metadata chunks that can be held
311 * Push message length information onto the message metadata queue.
335 * Pop information about the next message length from the queue. This will be
336 * the oldest inserted message length(fifo). \p msg_len can be null, in which
341 * \retval message length, if the pop was successful, up to the given
365 * Take a peek on the info about the next message length from the queue.
366 * This will be the oldest inserted message length(fifo).
372 * too small to fit the message. In this case the \p msg_len will be
373 * set to the full message length so that the
374 * caller knows what portion of the message can be dropped.
564 /* Errors used in the message socket mocks */
597 * \retval MBEDTLS_ERR_SSL_ALLOC_FAILED, if allocation of a message
618 * Close a given message socket context, along with the socket itself. Free the
632 * Send one message through a given message socket context.
668 * Receive one message from a given message socket context and return message
671 * \retval message length, if everything succeeds.
705 /* Set the requested message len to be buffer length */
717 /* Drop the remaining part of the message */
720 /* Inconsistent state - part of the message was read,
1059 /* Used for DTLS and the message size larger than MFL. In that case
1060 * the message can not be fragmented and the library should return
1067 /* Used for TLS/DTLS and the message size lower than MFL */
1074 /* Used for TLS and the message size larger than MFL */
1521 * message was sent in the correct number of fragments.
1525 * /p msg_len_1 and /p msg_len_2 specify the size of the message to send.
1527 * fragments the message should be sent.
1528 * expected_fragments is 0: can be used for DTLS testing while the message
1529 * size is larger than MFL. In that case the message
1533 * message size is below MFL
1534 * expected_fragments > 1: can be used for TLS testing while the message
1550 /* Perform this test with two message types. At first use a message
1552 * At the second time use message with generated data */
1590 /* This error is expected when the message is too large and
1609 /* This error is expected when the message is too large and
1873 * after it receives a message, so we force it. */
2239 unsigned char message[MSGLEN];
2244 TEST_ASSERT( mbedtls_mock_tcp_send_b( &socket, message, MSGLEN ) < 0 );
2251 TEST_ASSERT( mbedtls_mock_tcp_send_nb( &socket, message, MSGLEN ) < 0 );
2265 * send a single message from the client to the server.
2273 unsigned char message[MSGLEN];
2301 message[i] = i & 0xFF;
2304 /* Make sure that sending a message takes a few iterations. */
2307 /* Send the message to the server */
2312 send_ret = send( &client, message + written, MSGLEN - written );
2321 int blocking_ret = send( &client, message , 1 );
2365 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
2386 unsigned char message[ROUNDS][MSGLEN];
2418 message[i][j] = ( i * MSGLEN + j ) & 0xFF;
2422 /* Make sure that sending a message takes a few iterations. */
2425 /* Send the message from both sides, interleaving. */
2443 send_ret[i] = send( socket, message[i] + written[i],
2453 int blocking_ret = send( socket, message[i] , 1 );
2514 TEST_ASSERT( memcmp( message[i], received[i], MSGLEN ) == 0 );
2653 unsigned char message[MSGLEN] = {0}, received[MSGLEN];
2661 TEST_ASSERT( mbedtls_mock_tcp_send_msg( NULL, message, MSGLEN )
2664 TEST_ASSERT( mbedtls_mock_tcp_recv_msg( NULL, message, MSGLEN )
2675 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message, MSGLEN )
2699 unsigned char message[MSGLEN], received[MSGLEN];
2719 message[i] = i & 0xFF;
2724 /* Send the message to the server */
2725 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
2732 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
2735 /* Send the message to the client */
2736 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &server_context, message,
2742 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
2754 unsigned char message[MSGLEN], received[MSGLEN];
2774 message[i] = i & 0xFF;
2779 /* Send three message to the server, last one with an error */
2780 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
2783 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
2786 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
2797 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
2812 unsigned char message[MSGLEN], received[MSGLEN];
2832 message[i] = i & 0xFF;
2837 /* Send two message to the server, second one with an error */
2838 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
2841 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
2845 /* Read the only message from the server */
2849 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
2861 unsigned char message[MSGLEN], received[MSGLEN];
2882 message[i] = i & 0xFF;
2889 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
2891 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
2893 /* Read a truncated message from the server */
2897 /* Test that the first half of the message is valid, and second one isn't */
2898 TEST_ASSERT( memcmp( message, received, MSGLEN/2 ) == 0 );
2899 TEST_ASSERT( memcmp( message + MSGLEN/2, received + MSGLEN/2, MSGLEN/2 )
2903 /* Read a full message from the server */
2907 /* Test that the first half of the message is valid */
2908 TEST_ASSERT( memcmp( message, received, MSGLEN/2 ) == 0 );
2920 unsigned char message[MSGLEN], received[MSGLEN];
2940 message[i] = i & 0xFF;
2945 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
2962 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
2974 unsigned char message[MSGLEN], received[MSGLEN];
2994 message[i] = i & 0xFF;
3003 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
3006 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
3011 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
3020 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
3034 unsigned char message[MSGLEN], received[MSGLEN];
3054 message[i] = i & 0xFF;
3063 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
3066 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &client_context, message,
3069 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &server_context, message,
3072 TEST_ASSERT( mbedtls_mock_tcp_send_msg( &server_context, message,
3078 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
3085 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
3095 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );
3101 TEST_ASSERT( memcmp( message, received, MSGLEN ) == 0 );