From 98ecfdb440aeccb714014a89286401bb08c88ea5 Mon Sep 17 00:00:00 2001 From: Ben Taylor Date: Tue, 10 Jun 2025 07:47:13 +0100 Subject: [PATCH] corrected code style Signed-off-by: Ben Taylor --- programs/ssl/ssl_server2.c | 14 ++++++-------- tests/suites/test_suite_x509write.function | 5 +++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index e463c63046..28623bfc84 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -1035,8 +1035,9 @@ static int psk_callback(void *p_info, mbedtls_ssl_context *ssl, memcmp(name, cur->name, name_len) == 0) { if (MBEDTLS_SVC_KEY_ID_GET_KEY_ID(cur->slot) != 0) { return mbedtls_ssl_set_hs_psk_opaque(ssl, cur->slot); - } else - return mbedtls_ssl_set_hs_psk(ssl, cur->key, cur->key_len); + } else { + return mbedtls_ssl_set_hs_psk(ssl, cur->key, cur->key_len); + } } cur = cur->next; @@ -1936,8 +1937,7 @@ usage: #endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ else if (strcmp(p, "psk") == 0) { opt.psk = q; - } - else if (strcmp(p, "psk_opaque") == 0) { + } else if (strcmp(p, "psk_opaque") == 0) { opt.psk_opaque = atoi(q); } else if (strcmp(p, "psk_list_opaque") == 0) { opt.psk_list_opaque = atoi(q); @@ -1953,8 +1953,7 @@ usage: opt.psk_list = q; } else if (strcmp(p, "ecjpake_pw") == 0) { opt.ecjpake_pw = q; - } - else if (strcmp(p, "ecjpake_pw_opaque") == 0) { + } else if (strcmp(p, "ecjpake_pw_opaque") == 0) { opt.ecjpake_pw_opaque = atoi(q); } else if (strcmp(p, "force_ciphersuite") == 0) { @@ -3358,8 +3357,7 @@ reset: goto exit; } mbedtls_printf("using opaque password\n"); - } else - { + } else { if ((ret = mbedtls_ssl_set_hs_ecjpake_password(&ssl, (const unsigned char *) opt.ecjpake_pw, strlen(opt.ecjpake_pw))) != 0) { diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function index f42349cb5b..03746b4047 100644 --- a/tests/suites/test_suite_x509write.function +++ b/tests/suites/test_suite_x509write.function @@ -551,8 +551,9 @@ void x509_crt_check(char *subject_key_file, char *subject_pwd, // go into the MBEDTLS_ERR_ASN1_BUF_TOO_SMALL error case if (issuer_key_type != MBEDTLS_PK_RSA) { der_len /= 2; - } else - der_len -= 1; + } else { + der_len -= 1; + } ret = mbedtls_x509write_crt_der(&crt, buf, (size_t) (der_len)); TEST_ASSERT(ret == MBEDTLS_ERR_ASN1_BUF_TOO_SMALL);