From 3f44e5b11a140bb62dc45df9c9cae2c7b1a4dfd4 Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Mon, 24 Oct 2022 13:12:19 +0100 Subject: [PATCH] Refactor macro-spanning if in ssl_server2.c Signed-off-by: David Horstmann --- programs/ssl/ssl_server2.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 7526bc6cf5..5f84f9fc30 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -2537,15 +2537,17 @@ int main( int argc, char *argv[] ) if( ret != 0 ) break; } - if( ret == 0 ) #endif /* MBEDTLS_PEM_PARSE_C */ - for( i = 0; mbedtls_test_cas_der[i] != NULL; i++ ) + if( ret == 0 ) { - ret = mbedtls_x509_crt_parse_der( &cacert, - (const unsigned char *) mbedtls_test_cas_der[i], - mbedtls_test_cas_der_len[i] ); - if( ret != 0 ) - break; + for( i = 0; mbedtls_test_cas_der[i] != NULL; i++ ) + { + ret = mbedtls_x509_crt_parse_der( &cacert, + (const unsigned char *) mbedtls_test_cas_der[i], + mbedtls_test_cas_der_len[i] ); + if( ret != 0 ) + break; + } } } if( ret < 0 )