From 07432b9d0cc3a7ec82e1e92e6230550774f6fc6c Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 27 May 2025 21:07:44 +0200 Subject: [PATCH] Unify identical code This is made possible by the endpoint init simplification. No behavior change. Signed-off-by: Gilles Peskine --- tests/src/test_helpers/ssl_helpers.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/tests/src/test_helpers/ssl_helpers.c b/tests/src/test_helpers/ssl_helpers.c index 3e02a24ef2..184c0cd05b 100644 --- a/tests/src/test_helpers/ssl_helpers.c +++ b/tests/src/test_helpers/ssl_helpers.c @@ -2136,29 +2136,15 @@ void mbedtls_test_ssl_perform_handshake( #endif /* Client side */ - if (options->dtls != 0) { - TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&client, - MBEDTLS_SSL_IS_CLIENT, - options), 0); - } else { - TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&client, - MBEDTLS_SSL_IS_CLIENT, - options), 0); - } - + TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&client, + MBEDTLS_SSL_IS_CLIENT, + options), 0); TEST_ASSERT(set_ciphersuite(&client, options->cipher)); /* Server side */ - if (options->dtls != 0) { - TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&server, - MBEDTLS_SSL_IS_SERVER, - options), 0); - } else { - TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&server, - MBEDTLS_SSL_IS_SERVER, - options), 0); - } - + TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&server, + MBEDTLS_SSL_IS_SERVER, + options), 0); mbedtls_ssl_conf_authmode(&server.conf, options->srv_auth_mode); if (options->dtls) {