From 86029e04b415806c6d2d7ff05cde4337dedf94a4 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Fri, 15 Apr 2022 06:50:56 -0400 Subject: [PATCH] Remove RSA & DTLS dependency in raw key agreement test Signed-off-by: Andrzej Kurek --- tests/suites/test_suite_ssl.function | 36 ++++++---------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index d540c594b..9be76f045 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -4556,7 +4556,7 @@ exit: } /* END_CASE */ -/* BEGIN_CASE depends_on:MBEDTLS_X509_CRT_PARSE_C:MBEDTLS_USE_PSA_CRYPTO:MBEDTLS_PKCS1_V15:MBEDTLS_SSL_PROTO_TLS1_2:MBEDTLS_RSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SSL_PROTO_DTLS:MBEDTLS_ENTROPY_C:MBEDTLS_RSA_C:MBEDTLS_ECP_DP_SECP384R1_ENABLED:MBEDTLS_CTR_DRBG_C:MBEDTLS_ECP_C */ +/* BEGIN_CASE depends_on:MBEDTLS_X509_CRT_PARSE_C:MBEDTLS_USE_PSA_CRYPTO:MBEDTLS_PKCS1_V15:MBEDTLS_SSL_PROTO_TLS1_2:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_ENTROPY_C:MBEDTLS_RSA_C:MBEDTLS_ECP_DP_SECP384R1_ENABLED:MBEDTLS_CTR_DRBG_C:MBEDTLS_ECP_C:MBEDTLS_ECDSA_C */ void raw_key_agreement_fail( ) { enum { BUFFSIZE = 17000 }; @@ -4564,18 +4564,8 @@ void raw_key_agreement_fail( ) mbedtls_psa_stats_t stats; size_t free_slots_before = -1; -#if defined(MBEDTLS_TIMING_C) - mbedtls_timing_delay_context timer_client, timer_server; -#endif mbedtls_ecp_group_id curve_list[] = { MBEDTLS_ECP_DP_SECP256R1, MBEDTLS_ECP_DP_NONE }; - - mbedtls_test_message_queue server_queue, client_queue; - mbedtls_test_message_socket_context server_context, client_context; - - mbedtls_message_socket_init( &server_context ); - mbedtls_message_socket_init( &client_context ); - USE_PSA_INIT( ); /* Client side, force SECP256R1 to make one key bitflip fail @@ -4583,25 +4573,13 @@ void raw_key_agreement_fail( ) * curve (as opposed to a Montgomery curve) has a high chance of * making it invalid. */ TEST_ASSERT( mbedtls_endpoint_init( &client, MBEDTLS_SSL_IS_CLIENT, - MBEDTLS_PK_RSA, &client_context, - &client_queue, - &server_queue, curve_list ) == 0 ); -#if defined(MBEDTLS_TIMING_C) - mbedtls_ssl_set_timer_cb( &client.ssl, &timer_client, - mbedtls_timing_set_delay, - mbedtls_timing_get_delay ); -#endif + MBEDTLS_PK_ECDSA, NULL, NULL, + NULL, curve_list ) == 0 ); /* Server side */ TEST_ASSERT( mbedtls_endpoint_init( &server, MBEDTLS_SSL_IS_SERVER, - MBEDTLS_PK_RSA, &server_context, - &server_queue, - &client_queue, NULL ) == 0 ); -#if defined(MBEDTLS_TIMING_C) - mbedtls_ssl_set_timer_cb( &server.ssl, &timer_server, - mbedtls_timing_set_delay, - mbedtls_timing_get_delay ); -#endif + MBEDTLS_PK_ECDSA, NULL, NULL, + NULL, NULL ) == 0 ); TEST_ASSERT( mbedtls_mock_socket_connect( &(client.socket), &(server.socket), @@ -4632,8 +4610,8 @@ void raw_key_agreement_fail( ) TEST_ASSERT( free_slots_before == stats.empty_slots ); exit: - mbedtls_endpoint_free( &client, &client_context ); - mbedtls_endpoint_free( &server, &server_context ); + mbedtls_endpoint_free( &client, NULL ); + mbedtls_endpoint_free( &server, NULL ); mbedtls_psa_get_stats( &stats ); TEST_ASSERT( stats.empty_slots == MBEDTLS_PSA_KEY_SLOT_COUNT );