mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-06-26 23:14:07 +08:00
ssl_helpers.c: add mbedtls_test_ssl prefix for *_exchange_data
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
parent
5f86a42813
commit
b088bfc453
@ -524,7 +524,8 @@ int mbedtls_test_ssl_tls13_populate_session(mbedtls_ssl_session *session,
|
|||||||
*
|
*
|
||||||
* \retval 0 on success, otherwise error code.
|
* \retval 0 on success, otherwise error code.
|
||||||
*/
|
*/
|
||||||
int mbedtls_exchange_data(mbedtls_ssl_context *ssl_1,
|
int mbedtls_test_ssl_exchange_data(
|
||||||
|
mbedtls_ssl_context *ssl_1,
|
||||||
int msg_len_1, const int expected_fragments_1,
|
int msg_len_1, const int expected_fragments_1,
|
||||||
mbedtls_ssl_context *ssl_2,
|
mbedtls_ssl_context *ssl_2,
|
||||||
int msg_len_2, const int expected_fragments_2);
|
int msg_len_2, const int expected_fragments_2);
|
||||||
|
@ -919,7 +919,7 @@ int mbedtls_ssl_write_fragment(mbedtls_ssl_context *ssl,
|
|||||||
/* Used for DTLS and the message size larger than MFL. In that case
|
/* Used for DTLS and the message size larger than MFL. In that case
|
||||||
* the message can not be fragmented and the library should return
|
* the message can not be fragmented and the library should return
|
||||||
* MBEDTLS_ERR_SSL_BAD_INPUT_DATA error. This error must be returned
|
* MBEDTLS_ERR_SSL_BAD_INPUT_DATA error. This error must be returned
|
||||||
* to prevent a dead loop inside mbedtls_exchange_data(). */
|
* to prevent a dead loop inside mbedtls_test_ssl_exchange_data(). */
|
||||||
return ret;
|
return ret;
|
||||||
} else if (expected_fragments == 1) {
|
} else if (expected_fragments == 1) {
|
||||||
/* Used for TLS/DTLS and the message size lower than MFL */
|
/* Used for TLS/DTLS and the message size lower than MFL */
|
||||||
@ -1580,7 +1580,8 @@ int mbedtls_test_ssl_tls13_populate_session(mbedtls_ssl_session *session,
|
|||||||
}
|
}
|
||||||
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
|
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
|
||||||
|
|
||||||
int mbedtls_exchange_data(mbedtls_ssl_context *ssl_1,
|
int mbedtls_test_ssl_exchange_data(
|
||||||
|
mbedtls_ssl_context *ssl_1,
|
||||||
int msg_len_1, const int expected_fragments_1,
|
int msg_len_1, const int expected_fragments_1,
|
||||||
mbedtls_ssl_context *ssl_2,
|
mbedtls_ssl_context *ssl_2,
|
||||||
int msg_len_2, const int expected_fragments_2)
|
int msg_len_2, const int expected_fragments_2)
|
||||||
@ -1695,7 +1696,7 @@ exit:
|
|||||||
static int exchange_data(mbedtls_ssl_context *ssl_1,
|
static int exchange_data(mbedtls_ssl_context *ssl_1,
|
||||||
mbedtls_ssl_context *ssl_2)
|
mbedtls_ssl_context *ssl_2)
|
||||||
{
|
{
|
||||||
return mbedtls_exchange_data(ssl_1, 256, 1,
|
return mbedtls_test_ssl_exchange_data(ssl_1, 256, 1,
|
||||||
ssl_2, 256, 1);
|
ssl_2, 256, 1);
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED &&
|
#endif /* MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED &&
|
||||||
@ -1969,7 +1970,8 @@ void mbedtls_test_ssl_perform_handshake(
|
|||||||
|
|
||||||
if (options->cli_msg_len != 0 || options->srv_msg_len != 0) {
|
if (options->cli_msg_len != 0 || options->srv_msg_len != 0) {
|
||||||
/* Start data exchanging test */
|
/* Start data exchanging test */
|
||||||
TEST_ASSERT(mbedtls_exchange_data(&(client.ssl), options->cli_msg_len,
|
TEST_ASSERT(mbedtls_test_ssl_exchange_data(
|
||||||
|
&(client.ssl), options->cli_msg_len,
|
||||||
options->expected_cli_fragments,
|
options->expected_cli_fragments,
|
||||||
&(server.ssl), options->srv_msg_len,
|
&(server.ssl), options->srv_msg_len,
|
||||||
options->expected_srv_fragments)
|
options->expected_srv_fragments)
|
||||||
@ -2029,12 +2031,10 @@ void mbedtls_test_ssl_perform_handshake(
|
|||||||
#endif
|
#endif
|
||||||
/* Retest writing/reading */
|
/* Retest writing/reading */
|
||||||
if (options->cli_msg_len != 0 || options->srv_msg_len != 0) {
|
if (options->cli_msg_len != 0 || options->srv_msg_len != 0) {
|
||||||
TEST_ASSERT(mbedtls_exchange_data(
|
TEST_ASSERT(mbedtls_test_ssl_exchange_data(
|
||||||
&(client.ssl),
|
&(client.ssl), options->cli_msg_len,
|
||||||
options->cli_msg_len,
|
|
||||||
options->expected_cli_fragments,
|
options->expected_cli_fragments,
|
||||||
&(server.ssl),
|
&(server.ssl), options->srv_msg_len,
|
||||||
options->srv_msg_len,
|
|
||||||
options->expected_srv_fragments)
|
options->expected_srv_fragments)
|
||||||
== 0);
|
== 0);
|
||||||
}
|
}
|
||||||
|
@ -3085,7 +3085,8 @@ void force_bad_session_id_len()
|
|||||||
server.ssl.session_negotiate->id_len = 33;
|
server.ssl.session_negotiate->id_len = 33;
|
||||||
if (options.cli_msg_len != 0 || options.srv_msg_len != 0) {
|
if (options.cli_msg_len != 0 || options.srv_msg_len != 0) {
|
||||||
/* Start data exchanging test */
|
/* Start data exchanging test */
|
||||||
TEST_ASSERT(mbedtls_exchange_data(&(client.ssl), options.cli_msg_len,
|
TEST_ASSERT(mbedtls_test_ssl_exchange_data(
|
||||||
|
&(client.ssl), options.cli_msg_len,
|
||||||
options.expected_cli_fragments,
|
options.expected_cli_fragments,
|
||||||
&(server.ssl), options.srv_msg_len,
|
&(server.ssl), options.srv_msg_len,
|
||||||
options.expected_srv_fragments)
|
options.expected_srv_fragments)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user