mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-25 16:51:10 +00:00
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.
This commit is contained in:
parent
f46b9128b6
commit
1a44a159ef
|
@ -792,14 +792,13 @@ int mbedtls_endpoint_init( mbedtls_endpoint *ep, int endpoint_type, int pk_alg )
|
||||||
mbedtls_mock_tcp_recv_nb,
|
mbedtls_mock_tcp_recv_nb,
|
||||||
NULL );
|
NULL );
|
||||||
|
|
||||||
ret = mbedtls_ssl_setup( &( ep->ssl ), &( ep->conf ) );
|
|
||||||
TEST_ASSERT( ret == 0 );
|
|
||||||
|
|
||||||
ret = mbedtls_ssl_config_defaults( &( ep->conf ), endpoint_type,
|
ret = mbedtls_ssl_config_defaults( &( ep->conf ), endpoint_type,
|
||||||
MBEDTLS_SSL_TRANSPORT_STREAM,
|
MBEDTLS_SSL_TRANSPORT_STREAM,
|
||||||
MBEDTLS_SSL_PRESET_DEFAULT );
|
MBEDTLS_SSL_PRESET_DEFAULT );
|
||||||
TEST_ASSERT( ret == 0 );
|
TEST_ASSERT( ret == 0 );
|
||||||
|
|
||||||
|
ret = mbedtls_ssl_setup( &( ep->ssl ), &( ep->conf ) );
|
||||||
|
TEST_ASSERT( ret == 0 );
|
||||||
ret = mbedtls_endpoint_certificate_init( ep, pk_alg );
|
ret = mbedtls_endpoint_certificate_init( ep, pk_alg );
|
||||||
TEST_ASSERT( ret == 0 );
|
TEST_ASSERT( ret == 0 );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue