From 28f883eba5c61f515a3ca58bf2a0b6af448f10c4 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Fri, 8 Apr 2022 07:55:27 -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 c84427cb9..5246187c2 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -5594,7 +5594,7 @@ void cid_sanity( ) } /* 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 }; @@ -5602,18 +5602,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 uint16_t iana_tls_group_list[] = { MBEDTLS_SSL_IANA_TLS_GROUP_SECP256R1, MBEDTLS_SSL_IANA_TLS_GROUP_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 @@ -5621,25 +5611,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, iana_tls_group_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, iana_tls_group_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), @@ -5670,8 +5648,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 );