From 1a44a159ef4a311cd590b62c4bc5ee547f4679be Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Fri, 7 Feb 2020 08:21:32 -0500 Subject: [PATCH] Change the order of endpoint initialization steps Wrong order caused the `protected_record_size` to be of wrong size, hence causing the server to receive a malformed message in case of a DTLS test. --- tests/suites/test_suite_ssl.function | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index dc34eced3a..2b0988d10f 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -792,14 +792,13 @@ int mbedtls_endpoint_init( mbedtls_endpoint *ep, int endpoint_type, int pk_alg ) mbedtls_mock_tcp_recv_nb, NULL ); - ret = mbedtls_ssl_setup( &( ep->ssl ), &( ep->conf ) ); - TEST_ASSERT( ret == 0 ); - ret = mbedtls_ssl_config_defaults( &( ep->conf ), endpoint_type, MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT ); TEST_ASSERT( ret == 0 ); + ret = mbedtls_ssl_setup( &( ep->ssl ), &( ep->conf ) ); + TEST_ASSERT( ret == 0 ); ret = mbedtls_endpoint_certificate_init( ep, pk_alg ); TEST_ASSERT( ret == 0 );