mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-10-21 14:53:42 +03:00
Unify identical code
This is made possible by the endpoint init simplification. No behavior change. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@@ -2136,29 +2136,15 @@ void mbedtls_test_ssl_perform_handshake(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Client side */
|
/* Client side */
|
||||||
if (options->dtls != 0) {
|
TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&client,
|
||||||
TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&client,
|
MBEDTLS_SSL_IS_CLIENT,
|
||||||
MBEDTLS_SSL_IS_CLIENT,
|
options), 0);
|
||||||
options), 0);
|
|
||||||
} else {
|
|
||||||
TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&client,
|
|
||||||
MBEDTLS_SSL_IS_CLIENT,
|
|
||||||
options), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_ASSERT(set_ciphersuite(&client, options->cipher));
|
TEST_ASSERT(set_ciphersuite(&client, options->cipher));
|
||||||
|
|
||||||
/* Server side */
|
/* Server side */
|
||||||
if (options->dtls != 0) {
|
TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&server,
|
||||||
TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&server,
|
MBEDTLS_SSL_IS_SERVER,
|
||||||
MBEDTLS_SSL_IS_SERVER,
|
options), 0);
|
||||||
options), 0);
|
|
||||||
} else {
|
|
||||||
TEST_EQUAL(mbedtls_test_ssl_endpoint_init(&server,
|
|
||||||
MBEDTLS_SSL_IS_SERVER,
|
|
||||||
options), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
mbedtls_ssl_conf_authmode(&server.conf, options->srv_auth_mode);
|
mbedtls_ssl_conf_authmode(&server.conf, options->srv_auth_mode);
|
||||||
|
|
||||||
if (options->dtls) {
|
if (options->dtls) {
|
||||||
|
Reference in New Issue
Block a user