fix some code with obvious wrong coding style

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16918)
diff --git a/apps/dgst.c b/apps/dgst.c
index bd23b76..e75dd72 100644
--- a/apps/dgst.c
+++ b/apps/dgst.c
@@ -503,7 +503,7 @@
     file_cpy = app_malloc(mem_len, file);
     i = 0;
 
-    while(e < length) {
+    while (e < length) {
         const char c = file[e];
         if (c == '\n') {
             file_cpy[i++] = '\\';
diff --git a/apps/lib/app_libctx.c b/apps/lib/app_libctx.c
index 4b9ec40..2f68cb0 100644
--- a/apps/lib/app_libctx.c
+++ b/apps/lib/app_libctx.c
@@ -36,7 +36,7 @@
      */
     if (app_libctx == NULL) {
         if (!app_provider_load(NULL, "null")) {
-            opt_printf_stderr( "Failed to create null provider\n");
+            opt_printf_stderr("Failed to create null provider\n");
             return NULL;
         }
         app_libctx = OSSL_LIB_CTX_new();
diff --git a/apps/lib/app_rand.c b/apps/lib/app_rand.c
index e38d3a7..d3181e5 100644
--- a/apps/lib/app_rand.c
+++ b/apps/lib/app_rand.c
@@ -37,7 +37,7 @@
     char *p;
     int last, ret = 1;
 
-    for ( ; ; ) {
+    for (;;) {
         last = 0;
         for (p = name; *p != '\0' && *p != LIST_SEPARATOR_CHAR; p++)
             continue;
diff --git a/apps/lib/apps.c b/apps/lib/apps.c
index 6fe9942..b15abac 100644
--- a/apps/lib/apps.c
+++ b/apps/lib/apps.c
@@ -823,7 +823,7 @@
 
 static const char *format2string(int format)
 {
-    switch(format) {
+    switch (format) {
     case FORMAT_PEM:
         return "PEM";
     case FORMAT_ASN1:
@@ -1942,7 +1942,7 @@
             ERR_print_errors(bio_err);
             BIO_printf(bio_err,
                        "%s: Error adding %s name attribute \"/%s=%s\"\n",
-                       opt_getprog(), desc, typestr ,valstr);
+                       opt_getprog(), desc, typestr, valstr);
             goto err;
         }
     }
@@ -2845,9 +2845,9 @@
 #   include <floss.h(floss_write)>
 #  endif
 # endif
-int raw_write_stdout(const void *buf,int siz)
+int raw_write_stdout(const void *buf, int siz)
 {
-	return write(fileno(stdout),(void*)buf,siz);
+	return write(fileno(stdout), (void*)buf, siz);
 }
 #else
 # if defined(__TANDEM)
diff --git a/apps/lib/cmp_mock_srv.c b/apps/lib/cmp_mock_srv.c
index 1fb5adc..419b74c 100644
--- a/apps/lib/cmp_mock_srv.c
+++ b/apps/lib/cmp_mock_srv.c
@@ -14,7 +14,7 @@
 #include <openssl/cmp.h>
 #include <openssl/err.h>
 #include <openssl/cmperr.h>
- 
+
 /* the context for the CMP mock server */
 typedef struct
 {
diff --git a/apps/lib/s_cb.c b/apps/lib/s_cb.c
index c9a611a..1d31802 100644
--- a/apps/lib/s_cb.c
+++ b/apps/lib/s_cb.c
@@ -1537,7 +1537,7 @@
         return;
     }
 
-    BIO_printf(bio, "---\nAcceptable %s certificate CA names\n",cs);
+    BIO_printf(bio, "---\nAcceptable %s certificate CA names\n", cs);
     for (i = 0; i < sk_X509_NAME_num(sk); i++) {
         X509_NAME_print_ex(bio, sk_X509_NAME_value(sk, i), 0, get_nameopt());
         BIO_write(bio, "\n", 1);
diff --git a/apps/lib/vms_term_sock.c b/apps/lib/vms_term_sock.c
index 1b27699..a1aeb6d 100644
--- a/apps/lib/vms_term_sock.c
+++ b/apps/lib/vms_term_sock.c
@@ -120,7 +120,7 @@
 } SPTB;
 
 # ifdef TERM_SOCK_TEST
-
+
 /*----------------------------------------------------------------------------*/
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
@@ -160,7 +160,7 @@
 
 }
 # endif
-
+
 /*----------------------------------------------------------------------------*/
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
@@ -275,7 +275,7 @@
     return TERM_SOCK_SUCCESS;
 
 }
-
+
 /*----------------------------------------------------------------------------*/
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
@@ -441,7 +441,7 @@
     sin.sin_port = LocalHostPort ;
 
     status = connect (SockDesc2, (struct sockaddr *) &sin, sizeof(sin));
-    if (status < 0 ) {
+    if (status < 0) {
         LogMessage ("CreateSocketPair: connect () - %d", errno);
         sys$cantim (&sptb, 0);
         sys$cancel (TcpAcceptChan);
@@ -485,7 +485,7 @@
     return (0) ;
 
 }
-
+
 /*----------------------------------------------------------------------------*/
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
@@ -499,7 +499,7 @@
     return;
 
 }
-
+
 /*----------------------------------------------------------------------------*/
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
@@ -538,7 +538,7 @@
     return status;
 
 }
-
+
 /*----------------------------------------------------------------------------*/
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
diff --git a/apps/mac.c b/apps/mac.c
index 5f80ca2..08f06be 100644
--- a/apps/mac.c
+++ b/apps/mac.c
@@ -221,7 +221,7 @@
         for (i = 0; i < (int)len; ++i)
             BIO_printf(out, "%02X", buf[i]);
         if (outfile == NULL)
-            BIO_printf(out,"\n");
+            BIO_printf(out, "\n");
     }
 
     ret = 0;
diff --git a/apps/ocsp.c b/apps/ocsp.c
index 7a5f84e..8f0eaca 100644
--- a/apps/ocsp.c
+++ b/apps/ocsp.c
@@ -1132,7 +1132,7 @@
     OCSP_copy_nonce(bs, req);
 
     mctx = EVP_MD_CTX_new();
-    if ( mctx == NULL || !EVP_DigestSignInit(mctx, &pkctx, rmd, NULL, rkey)) {
+    if (mctx == NULL || !EVP_DigestSignInit(mctx, &pkctx, rmd, NULL, rkey)) {
         *resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR, NULL);
         goto end;
     }
diff --git a/apps/passwd.c b/apps/passwd.c
index 65cbd9e..bcb8804 100644
--- a/apps/passwd.c
+++ b/apps/passwd.c
@@ -601,7 +601,7 @@
     OPENSSL_strlcat(out_buf, ascii_salt, sizeof(out_buf));
 
     /* assert "$5$rounds=999999999$......salt......" */
-    if (strlen(out_buf) > 3 + 17 * rounds_custom + salt_len )
+    if (strlen(out_buf) > 3 + 17 * rounds_custom + salt_len)
         goto err;
 
     md = EVP_MD_CTX_new();
diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c
index 73012e3..d7290f7 100644
--- a/apps/pkeyutl.c
+++ b/apps/pkeyutl.c
@@ -729,7 +729,7 @@
             goto end;
         }
         mbuf = app_malloc(filesize, "oneshot sign/verify buffer");
-        switch(pkey_op) {
+        switch (pkey_op) {
         case EVP_PKEY_OP_VERIFY:
             buf_len = BIO_read(in, mbuf, filesize);
             if (buf_len != filesize) {
@@ -754,7 +754,7 @@
         goto end;
     }
 
-    switch(pkey_op) {
+    switch (pkey_op) {
     case EVP_PKEY_OP_VERIFY:
         for (;;) {
             buf_len = BIO_read(in, tbuf, TBUF_MAXSIZE);
diff --git a/apps/req.c b/apps/req.c
index 84ea9ba..7997ea7 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -781,7 +781,7 @@
                 goto end;
             }
 
-            if (!make_REQ(req, pkey, fsubj, multirdn, !gen_x509, chtype)){
+            if (!make_REQ(req, pkey, fsubj, multirdn, !gen_x509, chtype)) {
                 BIO_printf(bio_err, "Error making certificate request\n");
                 goto end;
             }
diff --git a/apps/s_client.c b/apps/s_client.c
index 760d2de..f23919b 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -1971,7 +1971,7 @@
 
     if (!noservername && (servername != NULL || dane_tlsa_domain == NULL)) {
         if (servername == NULL) {
-            if(host == NULL || is_dNS_name(host))
+            if (host == NULL || is_dNS_name(host))
                 servername = (host == NULL) ? "localhost" : host;
         }
         if (servername != NULL && !SSL_set_tlsext_host_name(con, servername)) {
@@ -2984,7 +2984,7 @@
                 BIO_printf(bio_err, "RENEGOTIATING\n");
                 SSL_renegotiate(con);
                 cbuf_len = 0;
-            } else if (!c_ign_eof && (cbuf[0] == 'K' || cbuf[0] == 'k' )
+            } else if (!c_ign_eof && (cbuf[0] == 'K' || cbuf[0] == 'k')
                     && cmdletters) {
                 BIO_printf(bio_err, "KEYUPDATE\n");
                 SSL_key_update(con,
diff --git a/crypto/LPdir_unix.c b/crypto/LPdir_unix.c
index ddf68b5..4151d1b 100644
--- a/crypto/LPdir_unix.c
+++ b/crypto/LPdir_unix.c
@@ -137,7 +137,7 @@
     if ((*ctx)->expect_file_generations) {
         char *p = (*ctx)->entry_name + strlen((*ctx)->entry_name);
 
-        while(p > (*ctx)->entry_name && isdigit(p[-1]))
+        while (p > (*ctx)->entry_name && isdigit(p[-1]))
             p--;
         if (p > (*ctx)->entry_name && p[-1] == ';')
             p[-1] = '\0';
diff --git a/crypto/aes/aes_x86core.c b/crypto/aes/aes_x86core.c
index da525b6..8e54e80 100644
--- a/crypto/aes/aes_x86core.c
+++ b/crypto/aes/aes_x86core.c
@@ -63,12 +63,13 @@
 #if 1
 static void prefetch256(const void *table)
 {
-    volatile unsigned long *t=(void *)table,ret;
+    volatile unsigned long *t = (void *)table, ret;
     unsigned long sum;
     int i;
 
     /* 32 is common least cache-line size */
-    for (sum=0,i=0;i<256/sizeof(t[0]);i+=32/sizeof(t[0]))   sum ^= t[i];
+    for (sum = 0, i = 0; i < 256/sizeof(t[0]); i += 32/sizeof(t[0]))
+        sum ^= t[i];
 
     ret = sum;
 }
diff --git a/crypto/aria/aria.c b/crypto/aria/aria.c
index 5e60bc5..6a1d713 100644
--- a/crypto/aria/aria.c
+++ b/crypto/aria/aria.c
@@ -498,7 +498,7 @@
     ARIA_ADD_ROUND_KEY(rk, reg0, reg1, reg2, reg3);
     rk++;
 
-    while(Nr -= 2){
+    while (Nr -= 2) {
         ARIA_SUBST_DIFF_EVEN(reg0, reg1, reg2, reg3);
         ARIA_ADD_ROUND_KEY(rk, reg0, reg1, reg2, reg3);
         rk++;
diff --git a/crypto/bio/bio_addr.c b/crypto/bio/bio_addr.c
index d18c849..dd18038 100644
--- a/crypto/bio/bio_addr.c
+++ b/crypto/bio/bio_addr.c
@@ -654,7 +654,7 @@
 {
     int ret = 0;                 /* Assume failure */
 
-    switch(family) {
+    switch (family) {
     case AF_INET:
 #ifdef AF_INET6
     case AF_INET6:
@@ -789,7 +789,7 @@
         he_fallback_address = INADDR_ANY;
         if (host == NULL) {
             he = &he_fallback;
-            switch(lookup_type) {
+            switch (lookup_type) {
             case BIO_LOOKUP_CLIENT:
                 he_fallback_address = INADDR_LOOPBACK;
                 break;
@@ -906,12 +906,12 @@
 
             /* The easiest way to create a linked list from an
                array is to start from the back */
-            for(addrlistp = he->h_addr_list; *addrlistp != NULL;
-                addrlistp++)
+            for (addrlistp = he->h_addr_list; *addrlistp != NULL;
+                 addrlistp++)
                 ;
 
-            for(addresses = addrlistp - he->h_addr_list;
-                addrlistp--, addresses-- > 0; ) {
+            for (addresses = addrlistp - he->h_addr_list;
+                 addrlistp--, addresses-- > 0; ) {
                 if (!addrinfo_wrap(he->h_addrtype, socktype,
                                    *addrlistp, he->h_length,
                                    se->s_port, &tmp_bai))
diff --git a/crypto/bn/asm/sparcv8.S b/crypto/bn/asm/sparcv8.S
index 9448700..e5402cc 100644
--- a/crypto/bn/asm/sparcv8.S
+++ b/crypto/bn/asm/sparcv8.S
@@ -381,7 +381,7 @@
 	inc	16,%o1
 	addxcc	%g3,%g4,%g3
 	st	%g3,[%o0+4]
-	
+
 	ld	[%o1-4],%g3
 	ld	[%o2+12],%g4
 	inc	16,%o2
@@ -469,7 +469,7 @@
 	inc	16,%o1
 	subxcc	%g3,%g4,%g4
 	st	%g4,[%o0+4]
-	
+
 	ld	[%o1-4],%g3
 	ld	[%o2+12],%g4
 	inc	16,%o2
@@ -1040,7 +1040,7 @@
 	addxcc	c_2,t_2,c_2	!=
 	st	c_1,rp(6)	!r[6]=c1;
 	st	c_2,rp(7)	!r[7]=c2;
-	
+
 	ret
 	restore	%g0,%g0,%o0
 
@@ -1448,7 +1448,7 @@
 	addxcc	c_2,t_2,c_2	!=
 	st	c_1,rp(6)	!r[6]=c1;
 	st	c_2,rp(7)	!r[7]=c2;
-	
+
 	ret
 	restore	%g0,%g0,%o0
 
diff --git a/crypto/bn/asm/sparcv8plus.S b/crypto/bn/asm/sparcv8plus.S
index 696dc7b..8a936f1 100644
--- a/crypto/bn/asm/sparcv8plus.S
+++ b/crypto/bn/asm/sparcv8plus.S
@@ -496,7 +496,7 @@
 	inc	16,%o1
 	addccc	%g1,%g2,%g1
 	stuw	%g1,[%o0+4]
-	
+
 	inc	16,%o2
 	addccc	%g3,%g4,%g3
 	stuw	%g3,[%o0+8]
@@ -1126,7 +1126,7 @@
 	srlx	t_1,32,c_12	!=
 	stuw	t_1,rp(6)	!r[6]=c1;
 	stuw	c_12,rp(7)	!r[7]=c2;
-	
+
 	ret
 	restore	%g0,%g0,%o0
 
@@ -1548,7 +1548,7 @@
 	srlx	t_1,32,c_12
 	stuw	t_1,rp(6)	!r[6]=c1;
 	stuw	c_12,rp(7)	!r[7]=c2;
-	
+
 	ret
 	restore	%g0,%g0,%o0
 
diff --git a/crypto/bn/bn_rsa_fips186_4.c b/crypto/bn/bn_rsa_fips186_4.c
index 794e008..bde9ffa 100644
--- a/crypto/bn/bn_rsa_fips186_4.c
+++ b/crypto/bn/bn_rsa_fips186_4.c
@@ -112,7 +112,7 @@
     BN_set_flags(p1, BN_FLG_CONSTTIME);
 
     /* Find the first odd number >= Xp1 that is probably prime */
-    for(;;) {
+    for (;;) {
         i++;
         BN_GENCB_call(cb, 0, i);
         /* MR test with trial division */
diff --git a/crypto/cmp/cmp_msg.c b/crypto/cmp/cmp_msg.c
index 10ef4cd..51b0998 100644
--- a/crypto/cmp/cmp_msg.c
+++ b/crypto/cmp/cmp_msg.c
@@ -1095,7 +1095,7 @@
     }
 
     msg = OSSL_CMP_MSG_new(libctx, propq);
-    if (msg == NULL){
+    if (msg == NULL) {
         ERR_raise(ERR_LIB_CMP, ERR_R_MALLOC_FAILURE);
         return NULL;
     }
diff --git a/crypto/cms/cms_env.c b/crypto/cms/cms_env.c
index 51a1d7d..ca8f84f 100644
--- a/crypto/cms/cms_env.c
+++ b/crypto/cms/cms_env.c
@@ -795,7 +795,7 @@
 {
     const char *alg = NULL;
 
-    switch(keylen) {
+    switch (keylen) {
     case 16:
         alg = "AES-128-WRAP";
         break;
diff --git a/crypto/cpuid.c b/crypto/cpuid.c
index 090f6fe..048689f 100644
--- a/crypto/cpuid.c
+++ b/crypto/cpuid.c
@@ -71,7 +71,7 @@
             base = 16, str++;
     }
 
-    while((digit = todigit(*str++)) < base)
+    while ((digit = todigit(*str++)) < base)
         ret = ret * base + digit;
 
     return ret;
@@ -80,7 +80,7 @@
 static variant_char *ossl_strchr(const variant_char *str, char srch)
 {   variant_char c;
 
-    while((c = *str)) {
+    while ((c = *str)) {
         if (c == srch)
             return (variant_char *)str;
         str++;
diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c
index 3a59544..79884c7 100644
--- a/crypto/ec/ec2_smpl.c
+++ b/crypto/ec/ec2_smpl.c
@@ -545,7 +545,7 @@
      * We have a curve defined by a Weierstrass equation
      *      y^2 + x*y = x^3 + a*x^2 + b.
      *  <=> x^3 + a*x^2 + x*y + b + y^2 = 0
-     *  <=> ((x + a) * x + y ) * x + b + y^2 = 0
+     *  <=> ((x + a) * x + y) * x + b + y^2 = 0
      */
     if (!BN_GF2m_add(lh, point->X, group->a))
         goto err;
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
index 9ca023b..6992238 100644
--- a/crypto/ec/ec_ameth.c
+++ b/crypto/ec/ec_ameth.c
@@ -574,7 +574,7 @@
         if (ecbits <= 0)
             goto err;
 
-        sz = (ecbits + 7 ) / 8;
+        sz = (ecbits + 7) / 8;
         if (!OSSL_PARAM_BLD_push_BN_pad(tmpl,
                                         OSSL_PKEY_PARAM_PRIV_KEY,
                                         priv_key, sz))
diff --git a/crypto/ec/ec_backend.c b/crypto/ec/ec_backend.c
index 381da71..2db1c13 100644
--- a/crypto/ec/ec_backend.c
+++ b/crypto/ec/ec_backend.c
@@ -295,7 +295,7 @@
     point_conversion_form_t genform;
 
     if (group == NULL) {
-        ERR_raise(ERR_LIB_EC,EC_R_PASSED_NULL_PARAMETER);
+        ERR_raise(ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER);
         return 0;
     }
 
diff --git a/crypto/ec/ecp_nistz256.c b/crypto/ec/ecp_nistz256.c
index a9982ca..ccd6895 100644
--- a/crypto/ec/ecp_nistz256.c
+++ b/crypto/ec/ecp_nistz256.c
@@ -1377,7 +1377,7 @@
     /*
      * The bottom 128 bit of the exponent are processed with fixed 4-bit window
      */
-    for(i = 0; i < 32; i++) {
+    for (i = 0; i < 32; i++) {
         /* expLo - the low 128 bits of the exponent we use (ord(p256) - 2),
          * split into nibbles */
         static const unsigned char expLo[32]  = {
diff --git a/crypto/ec/ecp_smpl.c b/crypto/ec/ecp_smpl.c
index bde8cad..13ce9bf 100644
--- a/crypto/ec/ecp_smpl.c
+++ b/crypto/ec/ecp_smpl.c
@@ -1423,8 +1423,8 @@
 /*-
  * Apply randomization of EC point projective coordinates:
  *
- *   (X, Y ,Z ) = (lambda^2*X, lambda^3*Y, lambda*Z)
- *   lambda = [1,group->field)
+ *   (X, Y, Z) = (lambda^2*X, lambda^3*Y, lambda*Z)
+ *   lambda = [1, group->field)
  *
  */
 int ossl_ec_GFp_simple_blind_coordinates(const EC_GROUP *group, EC_POINT *p,
diff --git a/crypto/ec/ecx_meth.c b/crypto/ec/ecx_meth.c
index 9098dec..9f9bf75 100644
--- a/crypto/ec/ecx_meth.c
+++ b/crypto/ec/ecx_meth.c
@@ -138,7 +138,7 @@
 {
     if (IS25519(pkey->ameth->pkey_id)) {
         return X25519_BITS;
-    } else if(ISX448(pkey->ameth->pkey_id)) {
+    } else if (ISX448(pkey->ameth->pkey_id)) {
         return X448_BITS;
     } else {
         return ED448_BITS;
diff --git a/crypto/evp/asymcipher.c b/crypto/evp/asymcipher.c
index b7784c8..b08e121 100644
--- a/crypto/evp/asymcipher.c
+++ b/crypto/evp/asymcipher.c
@@ -189,7 +189,7 @@
         ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
         return -2;
     }
-    switch(ctx->operation) {
+    switch (ctx->operation) {
     case EVP_PKEY_OP_ENCRYPT:
         if (ctx->pmeth->encrypt_init == NULL)
             return 1;
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
index 52b9e87..445a284 100644
--- a/crypto/evp/e_aes.c
+++ b/crypto/evp/e_aes.c
@@ -2149,7 +2149,7 @@
         if (!enc || !cctx->aes.ccm.tag_set)
             return 0;
 
-        if(arg < cctx->aes.ccm.m)
+        if (arg < cctx->aes.ccm.m)
             return 0;
 
         memcpy(ptr, cctx->aes.ccm.kmac_param.icv.b, cctx->aes.ccm.m);
diff --git a/crypto/evp/e_aria.c b/crypto/evp/e_aria.c
index 7e1fda3..4722f54 100644
--- a/crypto/evp/e_aria.c
+++ b/crypto/evp/e_aria.c
@@ -73,7 +73,7 @@
                                         EVP_CIPHER_CTX_get_key_length(ctx) * 8,
                                         EVP_CIPHER_CTX_get_cipher_data(ctx));
     if (ret < 0) {
-        ERR_raise(ERR_LIB_EVP,EVP_R_ARIA_KEY_SETUP_FAILED);
+        ERR_raise(ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED);
         return 0;
     }
     return 1;
@@ -216,7 +216,7 @@
                                  const unsigned char *iv, int enc)
 {
     int ret;
-    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX,ctx);
+    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX, ctx);
 
     if (!iv && !key)
         return 1;
@@ -227,7 +227,7 @@
         CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks,
                            (block128_f) ossl_aria_encrypt);
         if (ret < 0) {
-            ERR_raise(ERR_LIB_EVP,EVP_R_ARIA_KEY_SETUP_FAILED);
+            ERR_raise(ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED);
             return 0;
         }
 
@@ -255,7 +255,7 @@
 
 static int aria_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
 {
-    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX,c);
+    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX, c);
 
     switch (type) {
     case EVP_CTRL_INIT:
@@ -375,7 +375,7 @@
     case EVP_CTRL_COPY:
         {
             EVP_CIPHER_CTX *out = ptr;
-            EVP_ARIA_GCM_CTX *gctx_out = EVP_C_DATA(EVP_ARIA_GCM_CTX,out);
+            EVP_ARIA_GCM_CTX *gctx_out = EVP_C_DATA(EVP_ARIA_GCM_CTX, out);
             if (gctx->gcm.key) {
                 if (gctx->gcm.key != &gctx->ks)
                     return 0;
@@ -402,7 +402,7 @@
 static int aria_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                               const unsigned char *in, size_t len)
 {
-    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX,ctx);
+    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX, ctx);
     int rv = -1;
 
     /* Encrypt/decrypt must be performed in place */
@@ -458,7 +458,7 @@
 static int aria_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                           const unsigned char *in, size_t len)
 {
-    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX,ctx);
+    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX, ctx);
 
     /* If not set up, return error */
     if (!gctx->key_set)
@@ -513,7 +513,7 @@
                             const unsigned char *iv, int enc)
 {
     int ret;
-    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX,ctx);
+    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX, ctx);
 
     if (!iv && !key)
         return 1;
@@ -525,7 +525,7 @@
         CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
                            &cctx->ks, (block128_f) ossl_aria_encrypt);
         if (ret < 0) {
-            ERR_raise(ERR_LIB_EVP,EVP_R_ARIA_KEY_SETUP_FAILED);
+            ERR_raise(ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED);
             return 0;
         }
         cctx->str = NULL;
@@ -540,7 +540,7 @@
 
 static int aria_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
 {
-    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX,c);
+    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX, c);
 
     switch (type) {
     case EVP_CTRL_INIT:
@@ -624,7 +624,7 @@
     case EVP_CTRL_COPY:
         {
             EVP_CIPHER_CTX *out = ptr;
-            EVP_ARIA_CCM_CTX *cctx_out = EVP_C_DATA(EVP_ARIA_CCM_CTX,out);
+            EVP_ARIA_CCM_CTX *cctx_out = EVP_C_DATA(EVP_ARIA_CCM_CTX, out);
             if (cctx->ccm.key) {
                 if (cctx->ccm.key != &cctx->ks)
                     return 0;
@@ -641,7 +641,7 @@
 static int aria_ccm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                               const unsigned char *in, size_t len)
 {
-    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX,ctx);
+    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX, ctx);
     CCM128_CONTEXT *ccm = &cctx->ccm;
 
     /* Encrypt/decrypt must be performed in place */
@@ -689,7 +689,7 @@
 static int aria_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                           const unsigned char *in, size_t len)
 {
-    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX,ctx);
+    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX, ctx);
     CCM128_CONTEXT *ccm = &cctx->ccm;
 
     /* If not set up, return error */
diff --git a/crypto/evp/e_camellia.c b/crypto/evp/e_camellia.c
index 4f1f482..cb69516 100644
--- a/crypto/evp/e_camellia.c
+++ b/crypto/evp/e_camellia.c
@@ -193,7 +193,7 @@
                              const unsigned char *iv, int enc)
 {
     int ret, mode;
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY,ctx);
+    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
 
     ret = Camellia_set_key(key, EVP_CIPHER_CTX_get_key_length(ctx) * 8,
                            &dat->ks);
@@ -220,7 +220,7 @@
 static int camellia_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                                const unsigned char *in, size_t len)
 {
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY,ctx);
+    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
 
     if (dat->stream.cbc)
         (*dat->stream.cbc) (in, out, len, &dat->ks, ctx->iv,
@@ -238,7 +238,7 @@
 {
     size_t bl = EVP_CIPHER_CTX_get_block_size(ctx);
     size_t i;
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY,ctx);
+    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
 
     if (len < bl)
         return 1;
@@ -252,7 +252,7 @@
 static int camellia_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                                const unsigned char *in, size_t len)
 {
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY,ctx);
+    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
 
     int num = EVP_CIPHER_CTX_get_num(ctx);
     CRYPTO_ofb128_encrypt(in, out, len, &dat->ks, ctx->iv, &num, dat->block);
@@ -263,7 +263,7 @@
 static int camellia_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                                const unsigned char *in, size_t len)
 {
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY,ctx);
+    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
 
     int num = EVP_CIPHER_CTX_get_num(ctx);
     CRYPTO_cfb128_encrypt(in, out, len, &dat->ks, ctx->iv, &num,
@@ -275,7 +275,7 @@
 static int camellia_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                                 const unsigned char *in, size_t len)
 {
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY,ctx);
+    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
 
     int num = EVP_CIPHER_CTX_get_num(ctx);
     CRYPTO_cfb128_8_encrypt(in, out, len, &dat->ks, ctx->iv, &num,
@@ -287,7 +287,7 @@
 static int camellia_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                                 const unsigned char *in, size_t len)
 {
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY,ctx);
+    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
 
     if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS)) {
         int num = EVP_CIPHER_CTX_get_num(ctx);
@@ -326,7 +326,7 @@
 {
     int snum = EVP_CIPHER_CTX_get_num(ctx);
     unsigned int num;
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY,ctx);
+    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
 
     if (snum < 0)
         return 0;
diff --git a/crypto/evp/e_chacha20_poly1305.c b/crypto/evp/e_chacha20_poly1305.c
index 18e1c0b..103663b 100644
--- a/crypto/evp/e_chacha20_poly1305.c
+++ b/crypto/evp/e_chacha20_poly1305.c
@@ -498,7 +498,7 @@
 {
     EVP_CHACHA_AEAD_CTX *actx = aead_data(ctx);
 
-    switch(type) {
+    switch (type) {
     case EVP_CTRL_INIT:
         if (actx == NULL)
             actx = ctx->cipher_data
diff --git a/crypto/evp/e_idea.c b/crypto/evp/e_idea.c
index 4a4df4b..93da938 100644
--- a/crypto/evp/e_idea.c
+++ b/crypto/evp/e_idea.c
@@ -42,7 +42,7 @@
                            const unsigned char *in, size_t inl)
 {
     BLOCK_CIPHER_ecb_loop()
-        IDEA_ecb_encrypt(in + i, out + i, &EVP_C_DATA(EVP_IDEA_KEY,ctx)->ks);
+        IDEA_ecb_encrypt(in + i, out + i, &EVP_C_DATA(EVP_IDEA_KEY, ctx)->ks);
     return 1;
 }
 
@@ -64,12 +64,12 @@
             enc = 1;
     }
     if (enc)
-        IDEA_set_encrypt_key(key, &EVP_C_DATA(EVP_IDEA_KEY,ctx)->ks);
+        IDEA_set_encrypt_key(key, &EVP_C_DATA(EVP_IDEA_KEY, ctx)->ks);
     else {
         IDEA_KEY_SCHEDULE tmp;
 
         IDEA_set_encrypt_key(key, &tmp);
-        IDEA_set_decrypt_key(&tmp, &EVP_C_DATA(EVP_IDEA_KEY,ctx)->ks);
+        IDEA_set_decrypt_key(&tmp, &EVP_C_DATA(EVP_IDEA_KEY, ctx)->ks);
         OPENSSL_cleanse((unsigned char *)&tmp, sizeof(IDEA_KEY_SCHEDULE));
     }
     return 1;
diff --git a/crypto/evp/e_seed.c b/crypto/evp/e_seed.c
index 98c7385..65ddb57 100644
--- a/crypto/evp/e_seed.c
+++ b/crypto/evp/e_seed.c
@@ -36,6 +36,6 @@
 static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
                          const unsigned char *iv, int enc)
 {
-    SEED_set_key(key, &EVP_C_DATA(EVP_SEED_KEY,ctx)->ks);
+    SEED_set_key(key, &EVP_C_DATA(EVP_SEED_KEY, ctx)->ks);
     return 1;
 }
diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c
index 2b9c6c2..a618766 100644
--- a/crypto/evp/pmeth_lib.c
+++ b/crypto/evp/pmeth_lib.c
@@ -614,7 +614,7 @@
 {
     if (app_pkey_methods == NULL) {
         app_pkey_methods = sk_EVP_PKEY_METHOD_new(pmeth_cmp);
-        if (app_pkey_methods == NULL){
+        if (app_pkey_methods == NULL) {
             ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE);
             return 0;
         }
@@ -866,7 +866,7 @@
 
         for (p = params; p->key != NULL; p++) {
             /* Check the ctx actually understands this parameter */
-            if (OSSL_PARAM_locate_const(settable, p->key) == NULL )
+            if (OSSL_PARAM_locate_const(settable, p->key) == NULL)
                 return -2;
         }
     }
@@ -889,9 +889,9 @@
         const OSSL_PARAM *gettable = EVP_PKEY_CTX_gettable_params(ctx);
         const OSSL_PARAM *p;
 
-        for (p = params; p->key != NULL; p++ ) {
+        for (p = params; p->key != NULL; p++) {
             /* Check the ctx actually understands this parameter */
-            if (OSSL_PARAM_locate_const(gettable, p->key) == NULL )
+            if (OSSL_PARAM_locate_const(gettable, p->key) == NULL)
                 return -2;
         }
     }
diff --git a/crypto/ffc/ffc_params_generate.c b/crypto/ffc/ffc_params_generate.c
index f0601e1..12a5252 100644
--- a/crypto/ffc/ffc_params_generate.c
+++ b/crypto/ffc/ffc_params_generate.c
@@ -324,7 +324,7 @@
 
     /* find q */
     for (;;) {
-        if(!BN_GENCB_call(cb, 0, m++))
+        if (!BN_GENCB_call(cb, 0, m++))
             goto err;
 
         /* A.1.1.2 Step (5) : generate seed with size seed_len */
@@ -673,7 +673,7 @@
      * A.1.1.3 Step (10)
      * n = floor(L / hash_outlen) - 1
      */
-    n = (L - 1 ) / (mdsize << 3);
+    n = (L - 1) / (mdsize << 3);
 
     /* Calculate 2^(L-1): Used in step A.1.1.2 Step (11.3) */
     if (!BN_lshift(test, BN_value_one(), L - 1))
@@ -688,9 +688,9 @@
             *res = FFC_CHECK_Q_MISMATCH;
             goto err;
         }
-        if(!BN_GENCB_call(cb, 2, 0))
+        if (!BN_GENCB_call(cb, 2, 0))
             goto err;
-        if(!BN_GENCB_call(cb, 3, 0))
+        if (!BN_GENCB_call(cb, 3, 0))
             goto err;
 
         memcpy(seed_tmp, seed, seedlen);
diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c
index 63cf46a..b2fa4c5 100644
--- a/crypto/lhash/lhash.c
+++ b/crypto/lhash/lhash.c
@@ -276,7 +276,7 @@
         n = OPENSSL_realloc(lh->b,
                             (unsigned int)(sizeof(OPENSSL_LH_NODE *) * lh->pmax));
         if (n == NULL) {
-            /* fputs("realloc error in lhash",stderr); */
+            /* fputs("realloc error in lhash", stderr); */
             lh->error++;
             return;
         }
diff --git a/crypto/pkcs12/p12_sbag.c b/crypto/pkcs12/p12_sbag.c
index 7574c54..4593d59 100644
--- a/crypto/pkcs12/p12_sbag.c
+++ b/crypto/pkcs12/p12_sbag.c
@@ -124,7 +124,7 @@
     }
     bag->type = OBJ_nid2obj(type);
 
-    switch(vtype) {
+    switch (vtype) {
     case V_ASN1_OCTET_STRING:
         {
             ASN1_OCTET_STRING *strtmp = ASN1_OCTET_STRING_new();
@@ -161,7 +161,7 @@
     safebag->value.bag = bag;
     safebag->type = OBJ_nid2obj(NID_secretBag);
     return safebag;
- 
+
  err:
     PKCS12_BAGS_free(bag);
     return NULL;
diff --git a/crypto/ppccap.c b/crypto/ppccap.c
index 8bcfed2..dca3c53 100644
--- a/crypto/ppccap.c
+++ b/crypto/ppccap.c
@@ -263,7 +263,7 @@
     sigaction(SIGILL, &ill_act, &ill_oact);
 
 #ifndef OSSL_IMPLEMENT_GETAUXVAL
-    if (sigsetjmp(ill_jmp,1) == 0) {
+    if (sigsetjmp(ill_jmp, 1) == 0) {
         OPENSSL_fpu_probe();
         OPENSSL_ppccap_P |= PPC_FPU;
 
diff --git a/crypto/property/property_parse.c b/crypto/property/property_parse.c
index 3673fd7..3c0a6ff 100644
--- a/crypto/property/property_parse.c
+++ b/crypto/property/property_parse.c
@@ -576,7 +576,7 @@
         ++*needed;
         return;
     }
-    if(*remain == 1)
+    if (*remain == 1)
         **buf = '\0';
     else
         **buf = ch;
@@ -595,16 +595,16 @@
     if (*remain == 0)
         return;
 
-    if(*remain < len + 1)
+    if (*remain < len + 1)
         len = *remain - 1;
 
-    if(len > 0) {
+    if (len > 0) {
         strncpy(*buf, str, len);
         *buf += len;
         *remain -= len;
     }
 
-    if(len < olen && *remain == 1) {
+    if (len < olen && *remain == 1) {
         **buf = '\0';
         ++*buf;
         --*remain;
diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c
index dc18331..bb862f6 100644
--- a/crypto/rand/rand_egd.c
+++ b/crypto/rand/rand_egd.c
@@ -85,14 +85,14 @@
 
     socket_transport_name_get(AF_UNIX, current_transport, 20);
 
-    if (strcmp(current_transport,transport) == 0)
+    if (strcmp(current_transport, transport) == 0)
         return socket(family, type, protocol);
 
     /* set the requested socket transport */
     if (socket_transport_name_set(AF_UNIX, transport))
         return -1;
 
-    socket_rc = socket(family,type,protocol);
+    socket_rc = socket(family, type, protocol);
 
     /* set mode back to what it was */
     if (socket_transport_name_set(AF_UNIX, current_transport))
@@ -135,7 +135,7 @@
     setbuf(fp, NULL);
 
     /* Try to connect */
-    for ( ; ; ) {
+    for (;;) {
         if (connect(fd, (struct sockaddr *)&addr, i) == 0)
             break;
 # ifdef EISCONN
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index 82f4163..31edd4f 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -144,14 +144,14 @@
 # pragma environment restore
 #endif
 
-    for ( ; ; ) {
+    for (;;) {
         if (bytes > 0)
             n = (bytes <= RAND_LOAD_BUF_SIZE) ? (int)bytes : RAND_BUF_SIZE;
         else
             n = RAND_LOAD_BUF_SIZE;
         i = fread(buf, 1, n, in);
 #ifdef EINTR
-        if (ferror(in) && errno == EINTR){
+        if (ferror(in) && errno == EINTR) {
             clearerr(in);
             if (i == 0)
                 continue;
diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c
index b1580ca..043f509 100644
--- a/crypto/rsa/rsa_ameth.c
+++ b/crypto/rsa/rsa_ameth.c
@@ -216,7 +216,7 @@
                 return 0;
         }
     } else if (pss == NULL) {
-        if (BIO_puts(bp,"(INVALID PSS PARAMETERS)\n") <= 0)
+        if (BIO_puts(bp, "(INVALID PSS PARAMETERS)\n") <= 0)
             return 0;
         return 1;
     }
diff --git a/crypto/rsa/rsa_backend.c b/crypto/rsa/rsa_backend.c
index 4628326..dc397a6 100644
--- a/crypto/rsa/rsa_backend.c
+++ b/crypto/rsa/rsa_backend.c
@@ -46,7 +46,7 @@
     if (numbers == NULL)
         return 0;
 
-    for (i = 0; names[i] != NULL; i++){
+    for (i = 0; names[i] != NULL; i++) {
         p = OSSL_PARAM_locate_const(params, names[i]);
         if (p != NULL) {
             BIGNUM *tmp = NULL;
diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c
index 44c819a..1eebfea 100644
--- a/crypto/rsa/rsa_pmeth.c
+++ b/crypto/rsa/rsa_pmeth.c
@@ -394,7 +394,7 @@
             return 0;
         }
     } else {
-        switch(mdnid) {
+        switch (mdnid) {
         /* List of all supported RSA digests */
         case NID_sha1:
         case NID_sha224:
diff --git a/crypto/rsa/rsa_sp800_56b_gen.c b/crypto/rsa/rsa_sp800_56b_gen.c
index df22405..0d9b8f4 100644
--- a/crypto/rsa/rsa_sp800_56b_gen.c
+++ b/crypto/rsa/rsa_sp800_56b_gen.c
@@ -125,7 +125,7 @@
     if (!ossl_bn_rsa_fips186_4_gen_prob_primes(rsa->p, Xpo, p1, p2, Xp, Xp1, Xp2,
                                                nbits, e, ctx, cb))
         goto err;
-    for(;;) {
+    for (;;) {
         /* (Step 5) Generate q, Xq*/
         if (!ossl_bn_rsa_fips186_4_gen_prob_primes(rsa->q, Xqo, q1, q2, Xq, Xq1,
                                                    Xq2, nbits, e, ctx, cb))
diff --git a/crypto/sha/keccak1600.c b/crypto/sha/keccak1600.c
index ccbf12b..17909a7 100644
--- a/crypto/sha/keccak1600.c
+++ b/crypto/sha/keccak1600.c
@@ -1242,11 +1242,11 @@
         printf(++i % 16 && i != sizeof(out) ? " " : "\n");
     }
 
-    if (memcmp(out,result,sizeof(out))) {
-        fprintf(stderr,"failure\n");
+    if (memcmp(out, result, sizeof(out))) {
+        fprintf(stderr, "failure\n");
         return 1;
     } else {
-        fprintf(stderr,"success\n");
+        fprintf(stderr, "success\n");
         return 0;
     }
 }
diff --git a/crypto/sm2/sm2_key.c b/crypto/sm2/sm2_key.c
index 9d0b920..e3a10d3 100644
--- a/crypto/sm2/sm2_key.c
+++ b/crypto/sm2/sm2_key.c
@@ -29,7 +29,7 @@
     if (eckey == NULL
             || (group = EC_KEY_get0_group(eckey)) == NULL
             || (priv_key = EC_KEY_get0_private_key(eckey)) == NULL
-            || (order = EC_GROUP_get0_order(group)) == NULL ) {
+            || (order = EC_GROUP_get0_order(group)) == NULL) {
         ERR_raise(ERR_LIB_SM2, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
diff --git a/crypto/srp/srp_vfy.c b/crypto/srp/srp_vfy.c
index e8beb60..2f36b27 100644
--- a/crypto/srp/srp_vfy.c
+++ b/crypto/srp/srp_vfy.c
@@ -628,7 +628,7 @@
         if (N_bn_alloc == NULL)
             goto err;
         N_bn = N_bn_alloc;
-        if ((len = t_fromb64(tmp, sizeof(tmp) ,g)) <= 0)
+        if ((len = t_fromb64(tmp, sizeof(tmp), g)) <= 0)
             goto err;
         g_bn_alloc = BN_bin2bn(tmp, len, NULL);
         if (g_bn_alloc == NULL)
diff --git a/crypto/store/store_lib.c b/crypto/store/store_lib.c
index 7dcb939..833ec8f 100644
--- a/crypto/store/store_lib.c
+++ b/crypto/store/store_lib.c
@@ -135,8 +135,8 @@
             if (loader_ctx == NULL) {
                 OSSL_STORE_LOADER_free(fetched_loader);
                 fetched_loader = NULL;
-            } else if(!loader_set_params(fetched_loader, loader_ctx,
-                                         params, propq)) {
+            } else if (!loader_set_params(fetched_loader, loader_ctx,
+                                          params, propq)) {
                 (void)fetched_loader->p_close(loader_ctx);
                 OSSL_STORE_LOADER_free(fetched_loader);
                 fetched_loader = NULL;
diff --git a/crypto/x509/pcy_cache.c b/crypto/x509/pcy_cache.c
index 1339f99..79b16c9 100644
--- a/crypto/x509/pcy_cache.c
+++ b/crypto/x509/pcy_cache.c
@@ -54,7 +54,7 @@
                 goto bad_policy;
             }
             cache->anyPolicy = data;
-        } else if (sk_X509_POLICY_DATA_find(cache->data, data) >=0 ) {
+        } else if (sk_X509_POLICY_DATA_find(cache->data, data) >=0) {
             ret = -1;
             goto bad_policy;
         } else if (!sk_X509_POLICY_DATA_push(cache->data, data)) {
diff --git a/crypto/x509/pcy_node.c b/crypto/x509/pcy_node.c
index 9d9a7ea..04aba64 100644
--- a/crypto/x509/pcy_node.c
+++ b/crypto/x509/pcy_node.c
@@ -93,7 +93,7 @@
     if (tree) {
         if (tree->extra_data == NULL)
             tree->extra_data = sk_X509_POLICY_DATA_new_null();
-        if (tree->extra_data == NULL){
+        if (tree->extra_data == NULL) {
             ERR_raise(ERR_LIB_X509V3, ERR_R_MALLOC_FAILURE);
             goto node_error;
         }
diff --git a/crypto/x509/v3_admis.c b/crypto/x509/v3_admis.c
index bee9cc9..cd875e9 100644
--- a/crypto/x509/v3_admis.c
+++ b/crypto/x509/v3_admis.c
@@ -103,7 +103,7 @@
             || BIO_printf(bp, "\n") <= 0)
             goto err;
     }
-    if (namingAuthority->namingAuthorityUrl != NULL ) {
+    if (namingAuthority->namingAuthorityUrl != NULL) {
         if (BIO_printf(bp, "%*s  namingAuthorityUrl: ", ind, "") <= 0
             || ASN1_STRING_print(bp, namingAuthority->namingAuthorityUrl) <= 0
             || BIO_printf(bp, "\n") <= 0)
diff --git a/crypto/x509/v3_pcia.c b/crypto/x509/v3_pcia.c
index 7f5985f..478de61 100644
--- a/crypto/x509/v3_pcia.c
+++ b/crypto/x509/v3_pcia.c
@@ -47,18 +47,16 @@
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
 
-ASN1_SEQUENCE(PROXY_POLICY) =
-        {
-        ASN1_SIMPLE(PROXY_POLICY,policyLanguage,ASN1_OBJECT),
-        ASN1_OPT(PROXY_POLICY,policy,ASN1_OCTET_STRING)
+ASN1_SEQUENCE(PROXY_POLICY) = {
+        ASN1_SIMPLE(PROXY_POLICY, policyLanguage, ASN1_OBJECT),
+        ASN1_OPT(PROXY_POLICY, policy, ASN1_OCTET_STRING)
 } ASN1_SEQUENCE_END(PROXY_POLICY)
 
 IMPLEMENT_ASN1_FUNCTIONS(PROXY_POLICY)
 
-ASN1_SEQUENCE(PROXY_CERT_INFO_EXTENSION) =
-        {
-        ASN1_OPT(PROXY_CERT_INFO_EXTENSION,pcPathLengthConstraint,ASN1_INTEGER),
-        ASN1_SIMPLE(PROXY_CERT_INFO_EXTENSION,proxyPolicy,PROXY_POLICY)
+ASN1_SEQUENCE(PROXY_CERT_INFO_EXTENSION) = {
+        ASN1_OPT(PROXY_CERT_INFO_EXTENSION, pcPathLengthConstraint, ASN1_INTEGER),
+        ASN1_SIMPLE(PROXY_CERT_INFO_EXTENSION, proxyPolicy, PROXY_POLICY)
 } ASN1_SEQUENCE_END(PROXY_CERT_INFO_EXTENSION)
 
 IMPLEMENT_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c
index 0e5b18f..1039bad 100644
--- a/crypto/x509/x509_vfy.c
+++ b/crypto/x509/x509_vfy.c
@@ -3286,7 +3286,7 @@
         return 0;
     case X509_TRUST_UNTRUSTED:
     default:
-        switch(ctx->error) {
+        switch (ctx->error) {
         case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
         case X509_V_ERR_CERT_NOT_YET_VALID:
         case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
diff --git a/crypto/x509/x_crl.c b/crypto/x509/x_crl.c
index d77746a..6ae9b94 100644
--- a/crypto/x509/x_crl.c
+++ b/crypto/x509/x_crl.c
@@ -20,9 +20,9 @@
 static int setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp);
 
 ASN1_SEQUENCE(X509_REVOKED) = {
-        ASN1_EMBED(X509_REVOKED,serialNumber, ASN1_INTEGER),
-        ASN1_SIMPLE(X509_REVOKED,revocationDate, ASN1_TIME),
-        ASN1_SEQUENCE_OF_OPT(X509_REVOKED,extensions, X509_EXTENSION)
+        ASN1_EMBED(X509_REVOKED, serialNumber, ASN1_INTEGER),
+        ASN1_SIMPLE(X509_REVOKED, revocationDate, ASN1_TIME),
+        ASN1_SEQUENCE_OF_OPT(X509_REVOKED, extensions, X509_EXTENSION)
 } ASN1_SEQUENCE_END(X509_REVOKED)
 
 static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r);
diff --git a/demos/digest/BIO_f_md.c b/demos/digest/BIO_f_md.c
index 2ecc53e..0a1f319 100644
--- a/demos/digest/BIO_f_md.c
+++ b/demos/digest/BIO_f_md.c
@@ -47,7 +47,7 @@
     char *digest_value=NULL;
     int j;
 
-    input = BIO_new_fd( fileno(stdin), 1 );
+    input = BIO_new_fd(fileno(stdin), 1);
     if (input == NULL) {
         fprintf(stderr, "BIO_new_fd() for stdin returned NULL\n");
         goto cleanup;
@@ -63,7 +63,7 @@
      * The algorithm name is case insensitive. 
      * See providers(7) for details about algorithm fetching
      */
-    md = EVP_MD_fetch( library_context, "SHA3-512", NULL );
+    md = EVP_MD_fetch(library_context, "SHA3-512", NULL);
     if (md == NULL) {
         fprintf(stderr, "EVP_MD_fetch did not find SHA3-512.\n");
         goto cleanup;
@@ -81,7 +81,7 @@
         goto cleanup;
     }
     /* set our bio_digest BIO to digest data */
-    if (BIO_set_md(bio_digest,md) != 1) {
+    if (BIO_set_md(bio_digest, md) != 1) {
            fprintf(stderr, "BIO_set_md failed.\n");
            goto cleanup;
     }
@@ -89,9 +89,9 @@
      * We will use BIO chaining so that as we read, the digest gets updated
      * See the man page for BIO_push
      */
-    BIO *reading = BIO_push( bio_digest, input );
-    
-    while( BIO_read(reading, buffer, sizeof(buffer)) > 0 )
+    BIO *reading = BIO_push(bio_digest, input);
+
+    while (BIO_read(reading, buffer, sizeof(buffer)) > 0)
         ;
 
     /*-
@@ -102,12 +102,12 @@
         fprintf(stderr, "BIO_gets(bio_digest) failed\n");
         goto cleanup;
     }
-    for (j=0; j<digest_size; j++) {
+    for (j = 0; j < digest_size; j++) {
         fprintf(stdout, "%02x", (unsigned char)digest_value[j]);
     }
     fprintf(stdout, "\n");
     result = 0;
-    
+
 cleanup:
     if (result != 0) 
         ERR_print_errors_fp(stderr);
diff --git a/demos/digest/EVP_MD_stdin.c b/demos/digest/EVP_MD_stdin.c
index 71a3d32..43a820f 100644
--- a/demos/digest/EVP_MD_stdin.c
+++ b/demos/digest/EVP_MD_stdin.c
@@ -124,7 +124,7 @@
 int main(void)
 {
     int result = 1;
-    BIO *input = BIO_new_fd( fileno(stdin), 1 );
+    BIO *input = BIO_new_fd(fileno(stdin), 1);
 
     if (input != NULL) {
         result = demonstrate_digest(input);
diff --git a/demos/kdf/pbkdf2.c b/demos/kdf/pbkdf2.c
index 3e0adae..ae0a63b 100644
--- a/demos/kdf/pbkdf2.c
+++ b/demos/kdf/pbkdf2.c
@@ -35,7 +35,7 @@
 static unsigned char pbkdf2_salt[] = {
     'N', 'a', 'C', 'l'
 };
-    
+
 /*
  * The iteration parameter can be variable or hard coded.  The disadvantage with
  * hard coding them is that they cannot easily be adjusted for future
diff --git a/engines/e_afalg.c b/engines/e_afalg.c
index 2c08cbb..1935084 100644
--- a/engines/e_afalg.c
+++ b/engines/e_afalg.c
@@ -787,7 +787,7 @@
      * now, as bind_aflag can only be called by one thread at a
      * time.
      */
-    for(i = 0; i < OSSL_NELEM(afalg_cipher_nids); i++) {
+    for (i = 0; i < OSSL_NELEM(afalg_cipher_nids); i++) {
         if (afalg_aes_cbc(afalg_cipher_nids[i]) == NULL) {
             AFALGerr(AFALG_F_BIND_AFALG, AFALG_R_INIT_FAILED);
             return 0;
@@ -916,7 +916,7 @@
 static int free_cbc(void)
 {
     short unsigned int i;
-    for(i = 0; i < OSSL_NELEM(afalg_cipher_nids); i++) {
+    for (i = 0; i < OSSL_NELEM(afalg_cipher_nids); i++) {
         EVP_CIPHER_meth_free(cbc_handle[i]._hidden);
         cbc_handle[i]._hidden = NULL;
     }
diff --git a/engines/e_capi.c b/engines/e_capi.c
index 6f223a6..3c747cb 100644
--- a/engines/e_capi.c
+++ b/engines/e_capi.c
@@ -425,7 +425,7 @@
         /* Setup RSA_METHOD */
         rsa_capi_idx = RSA_get_ex_new_index(0, NULL, NULL, NULL, 0);
         ossl_rsa_meth = RSA_PKCS1_OpenSSL();
-        if (   !RSA_meth_set_pub_enc(capi_rsa_method,
+        if (!RSA_meth_set_pub_enc(capi_rsa_method,
                                      RSA_meth_get_pub_enc(ossl_rsa_meth))
             || !RSA_meth_set_pub_dec(capi_rsa_method,
                                      RSA_meth_get_pub_dec(ossl_rsa_meth))
@@ -444,7 +444,7 @@
         /* Setup DSA Method */
         dsa_capi_idx = DSA_get_ex_new_index(0, NULL, NULL, NULL, 0);
         ossl_dsa_meth = DSA_OpenSSL();
-        if (   !DSA_meth_set_sign(capi_dsa_method, capi_dsa_do_sign)
+        if (!DSA_meth_set_sign(capi_dsa_method, capi_dsa_do_sign)
             || !DSA_meth_set_verify(capi_dsa_method,
                                     DSA_meth_get_verify(ossl_dsa_meth))
             || !DSA_meth_set_finish(capi_dsa_method, capi_dsa_free)
diff --git a/engines/e_devcrypto.c b/engines/e_devcrypto.c
index fa01317..adf53d8 100644
--- a/engines/e_devcrypto.c
+++ b/engines/e_devcrypto.c
@@ -633,7 +633,7 @@
         fprintf (stderr, "Cipher %s, NID=%d, /dev/crypto info: id=%d, ",
                  name ? name : "unknown", cipher_data[i].nid,
                  cipher_data[i].devcryptoid);
-        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION ) {
+        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION) {
             fprintf (stderr, "CIOCGSESSION (session open call) failed\n");
             continue;
         }
diff --git a/engines/e_ossltest.c b/engines/e_ossltest.c
index 0506faa..df0805b 100644
--- a/engines/e_ossltest.c
+++ b/engines/e_ossltest.c
@@ -765,7 +765,7 @@
     if (ret <= 0)
         return ret;
 
-    switch(type) {
+    switch (type) {
     case EVP_CTRL_AEAD_GET_TAG:
         /* Always give the same tag */
         memset(ptr, 0, EVP_GCM_TLS_TAG_LEN);
diff --git a/include/openssl/ct.h.in b/include/openssl/ct.h.in
index 16086b3..3fc2aaa 100644
--- a/include/openssl/ct.h.in
+++ b/include/openssl/ct.h.in
@@ -85,7 +85,7 @@
  */
 CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx,
                                               const char *propq);
-                                                       
+
 /*
  * The same as CT_POLICY_EVAL_CTX_new_ex() but the default library
  * context and property query string is used.
diff --git a/providers/common/provider_seeding.c b/providers/common/provider_seeding.c
index 0edbb87..d67ddf7 100644
--- a/providers/common/provider_seeding.c
+++ b/providers/common/provider_seeding.c
@@ -62,7 +62,7 @@
 
 size_t ossl_prov_get_nonce(PROV_CTX *prov_ctx, unsigned char **pout,
                            size_t min_len, size_t max_len,
-                           const void *salt,size_t salt_len)
+                           const void *salt, size_t salt_len)
 {
     if (c_get_nonce == NULL)
         return 0;
diff --git a/providers/implementations/ciphers/cipher_chacha20.c b/providers/implementations/ciphers/cipher_chacha20.c
index 386c865..d957ff6 100644
--- a/providers/implementations/ciphers/cipher_chacha20.c
+++ b/providers/implementations/ciphers/cipher_chacha20.c
@@ -193,7 +193,7 @@
     { OSSL_FUNC_CIPHER_FINAL, (void (*)(void))chacha20_final },
     { OSSL_FUNC_CIPHER_CIPHER, (void (*)(void))chacha20_cipher},
     { OSSL_FUNC_CIPHER_GET_PARAMS, (void (*)(void))chacha20_get_params },
-    { OSSL_FUNC_CIPHER_GETTABLE_PARAMS,(void (*)(void))chacha20_gettable_params },
+    { OSSL_FUNC_CIPHER_GETTABLE_PARAMS, (void (*)(void))chacha20_gettable_params },
     { OSSL_FUNC_CIPHER_GET_CTX_PARAMS, (void (*)(void))chacha20_get_ctx_params },
     { OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS,
         (void (*)(void))chacha20_gettable_ctx_params },
diff --git a/providers/implementations/ciphers/ciphercommon_block.c b/providers/implementations/ciphers/ciphercommon_block.c
index 6e6bb09..2ac23bf 100644
--- a/providers/implementations/ciphers/ciphercommon_block.c
+++ b/providers/implementations/ciphers/ciphercommon_block.c
@@ -110,7 +110,7 @@
     size_t pad, i;
     size_t len = *buflen;
 
-    if(len != blocksize) {
+    if (len != blocksize) {
         ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
         return 0;
     }
diff --git a/providers/implementations/encode_decode/encode_key2any.c b/providers/implementations/encode_decode/encode_key2any.c
index 9ee12a9..b1d95fc 100644
--- a/providers/implementations/encode_decode/encode_key2any.c
+++ b/providers/implementations/encode_decode/encode_key2any.c
@@ -67,7 +67,7 @@
 /* Free the blob allocated during key_to_paramstring_fn */
 static void free_asn1_data(int type, void *data)
 {
-    switch(type) {
+    switch (type) {
     case V_ASN1_OBJECT:
         ASN1_OBJECT_free(data);
         break;
diff --git a/providers/implementations/exchange/dh_exch.c b/providers/implementations/exchange/dh_exch.c
index ea05b31..6edf57e 100644
--- a/providers/implementations/exchange/dh_exch.c
+++ b/providers/implementations/exchange/dh_exch.c
@@ -460,7 +460,7 @@
     if (p != NULL
             && !OSSL_PARAM_set_utf8_string(p, pdhctx->kdf_md == NULL
                                            ? ""
-                                           : EVP_MD_get0_name(pdhctx->kdf_md))){
+                                           : EVP_MD_get0_name(pdhctx->kdf_md))) {
         return 0;
     }
 
diff --git a/providers/implementations/exchange/ecdh_exch.c b/providers/implementations/exchange/ecdh_exch.c
index 35d665f..64b163f 100644
--- a/providers/implementations/exchange/ecdh_exch.c
+++ b/providers/implementations/exchange/ecdh_exch.c
@@ -377,7 +377,7 @@
     if (p != NULL
             && !OSSL_PARAM_set_utf8_string(p, pectx->kdf_md == NULL
                                            ? ""
-                                           : EVP_MD_get0_name(pectx->kdf_md))){
+                                           : EVP_MD_get0_name(pectx->kdf_md))) {
         return 0;
     }
 
@@ -450,7 +450,7 @@
     }
 
     if ((group = EC_KEY_get0_group(pecdhctx->k)) == NULL
-            || (cofactor = EC_GROUP_get0_cofactor(group)) == NULL )
+            || (cofactor = EC_GROUP_get0_cofactor(group)) == NULL)
         return 0;
 
     /*
diff --git a/providers/implementations/kdfs/pbkdf1.c b/providers/implementations/kdfs/pbkdf1.c
index af715ef..c93ff9b 100644
--- a/providers/implementations/kdfs/pbkdf1.c
+++ b/providers/implementations/kdfs/pbkdf1.c
@@ -185,7 +185,7 @@
             return 0;
 
     if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SALT)) != NULL)
-        if (!kdf_pbkdf1_set_membuf(&ctx->salt, &ctx->salt_len,p))
+        if (!kdf_pbkdf1_set_membuf(&ctx->salt, &ctx->salt_len, p))
             return 0;
 
     if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_ITER)) != NULL)
diff --git a/providers/implementations/kdfs/pbkdf2.c b/providers/implementations/kdfs/pbkdf2.c
index fe24702..16acf30 100644
--- a/providers/implementations/kdfs/pbkdf2.c
+++ b/providers/implementations/kdfs/pbkdf2.c
@@ -194,7 +194,7 @@
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH);
             return 0;
         }
-        if (!pbkdf2_set_membuf(&ctx->salt, &ctx->salt_len,p))
+        if (!pbkdf2_set_membuf(&ctx->salt, &ctx->salt_len, p))
             return 0;
     }
 
diff --git a/providers/implementations/kdfs/pkcs12kdf.c b/providers/implementations/kdfs/pkcs12kdf.c
index 2037b45..7f461fe 100644
--- a/providers/implementations/kdfs/pkcs12kdf.c
+++ b/providers/implementations/kdfs/pkcs12kdf.c
@@ -236,7 +236,7 @@
             return 0;
 
     if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SALT)) != NULL)
-        if (!pkcs12kdf_set_membuf(&ctx->salt, &ctx->salt_len,p))
+        if (!pkcs12kdf_set_membuf(&ctx->salt, &ctx->salt_len, p))
             return 0;
 
     if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PKCS12_ID)) != NULL)
diff --git a/providers/implementations/kdfs/pvkkdf.c b/providers/implementations/kdfs/pvkkdf.c
index 2dad630..051c625 100644
--- a/providers/implementations/kdfs/pvkkdf.c
+++ b/providers/implementations/kdfs/pvkkdf.c
@@ -173,7 +173,7 @@
             return 0;
 
     if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SALT)) != NULL) {
-        if (!pvk_set_membuf(&ctx->salt, &ctx->salt_len,p))
+        if (!pvk_set_membuf(&ctx->salt, &ctx->salt_len, p))
             return 0;
     }
 
diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c
index 24d4df5..eeff1c7 100644
--- a/providers/implementations/keymgmt/ec_kmgmt.c
+++ b/providers/implementations/keymgmt/ec_kmgmt.c
@@ -215,7 +215,7 @@
         ecbits = EC_GROUP_order_bits(ecg);
         if (ecbits <= 0)
             goto err;
-        sz = (ecbits + 7 ) / 8;
+        sz = (ecbits + 7) / 8;
 
         if (!ossl_param_build_set_bn_pad(tmpl, params,
                                          OSSL_PKEY_PARAM_PRIV_KEY,
diff --git a/providers/implementations/rands/drbg_hash.c b/providers/implementations/rands/drbg_hash.c
index 6deb0a2..99853a7 100644
--- a/providers/implementations/rands/drbg_hash.c
+++ b/providers/implementations/rands/drbg_hash.c
@@ -113,7 +113,7 @@
             memcpy(out, vtmp, outlen);
             OPENSSL_cleanse(vtmp, hash->blocklen);
             break;
-        } else if(!EVP_DigestFinal(ctx, out, NULL)) {
+        } else if (!EVP_DigestFinal(ctx, out, NULL)) {
             return 0;
         }
 
@@ -212,7 +212,7 @@
     if (outlen == 0)
         return 1;
     memcpy(hash->vtmp, hash->V, drbg->seedlen);
-    for(;;) {
+    for (;;) {
         if (!EVP_DigestInit_ex(hash->ctx, ossl_prov_digest_md(&hash->digest),
                                NULL)
                 || !EVP_DigestUpdate(hash->ctx, hash->vtmp, drbg->seedlen))
diff --git a/providers/implementations/rands/seeding/rand_unix.c b/providers/implementations/rands/seeding/rand_unix.c
index 750afca..f394927 100644
--- a/providers/implementations/rands/seeding/rand_unix.c
+++ b/providers/implementations/rands/seeding/rand_unix.c
@@ -176,7 +176,7 @@
         /* Get wall clock time, take 8 bits. */
         clock_gettime(CLOCK_REALTIME, &ts);
         v = (unsigned char)(ts.tv_nsec & 0xFF);
-        ossl_rand_pool_add(pool, arg, &v, sizeof(v) , 2);
+        ossl_rand_pool_add(pool, arg, &v, sizeof(v), 2);
     }
     return ossl_rand_pool_entropy_available(pool);
 }
diff --git a/providers/implementations/rands/seeding/rand_vms.c b/providers/implementations/rands/seeding/rand_vms.c
index abc06ff..30a97bf 100644
--- a/providers/implementations/rands/seeding/rand_vms.c
+++ b/providers/implementations/rands/seeding/rand_vms.c
@@ -388,7 +388,7 @@
         uint32_t status;
         uint32_t efn;
         IOSB iosb;
-        $DESCRIPTOR(SYSDEVICE,"SYS$SYSDEVICE:");
+        $DESCRIPTOR(SYSDEVICE, "SYS$SYSDEVICE:");
 
         if ((status = sys$getdviw(EFN$C_ENF, 0, &SYSDEVICE, DVI_items,
                                   0, 0, 0, 0, 0)) != SS$_NORMAL) {
diff --git a/providers/implementations/rands/seeding/rand_vxworks.c b/providers/implementations/rands/seeding/rand_vxworks.c
index 12be935..de26b86 100644
--- a/providers/implementations/rands/seeding/rand_vxworks.c
+++ b/providers/implementations/rands/seeding/rand_vxworks.c
@@ -136,7 +136,7 @@
             RANDOM_NUM_GEN_STATUS status = randStatus();
 
             if ((status == RANDOM_NUM_GEN_ENOUGH_ENTROPY)
-                    || (status == RANDOM_NUM_GEN_MAX_ENTROPY) ) {
+                    || (status == RANDOM_NUM_GEN_MAX_ENTROPY)) {
                 result = randBytes(buffer, bytes_needed);
                 if (result == OK)
                     ossl_rand_pool_add_end(pool, bytes_needed, 8 * bytes_needed);
diff --git a/providers/implementations/signature/rsa_sig.c b/providers/implementations/signature/rsa_sig.c
index 298d789..2ebf17a 100644
--- a/providers/implementations/signature/rsa_sig.c
+++ b/providers/implementations/signature/rsa_sig.c
@@ -124,7 +124,7 @@
                              const char *mdname, const char *mgf1_mdname,
                              int mdnid)
 {
-    switch(prsactx->pad_mode) {
+    switch (prsactx->pad_mode) {
         case RSA_NO_PADDING:
             if (mdname != NULL || mdnid != NID_undef) {
                 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE);
@@ -196,7 +196,7 @@
 static int rsa_pss_compute_saltlen(PROV_RSA_CTX *ctx)
 {
     int saltlen = ctx->saltlen;
- 
+
     if (saltlen == RSA_PSS_SALTLEN_DIGEST) {
         saltlen = EVP_MD_get_size(ctx->md);
     } else if (saltlen == RSA_PSS_SALTLEN_AUTO || saltlen == RSA_PSS_SALTLEN_MAX) {
@@ -232,7 +232,7 @@
         return NULL;
     }
 
-    switch(ctx->pad_mode) {
+    switch (ctx->pad_mode) {
     case RSA_PKCS1_PADDING:
         ret = ossl_DER_w_algorithmIdentifier_MDWithRSAEncryption(&pkt, -1,
                                                                  ctx->mdnid);
diff --git a/ssl/d1_msg.c b/ssl/d1_msg.c
index 10438a3..b4ad41c 100644
--- a/ssl/d1_msg.c
+++ b/ssl/d1_msg.c
@@ -49,7 +49,7 @@
     i = do_dtls1_write(s, SSL3_RT_ALERT, &buf[0], sizeof(buf), 0, &written);
     if (i <= 0) {
         s->s3.alert_dispatch = 1;
-        /* fprintf( stderr, "not done with alert\n" ); */
+        /* fprintf(stderr, "not done with alert\n"); */
     } else {
         (void)BIO_flush(s->wbio);
 
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 01044de..b2a5fb0 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -812,7 +812,7 @@
     const SSL_CIPHER *cp;
     int reverse = 0;
 
-    OSSL_TRACE_BEGIN(TLS_CIPHER){
+    OSSL_TRACE_BEGIN(TLS_CIPHER) {
         BIO_printf(trc_out,
                    "Applying rule %d with %08x/%08x/%08x/%08x/%08x %08x (%d)\n",
                    rule, alg_mkey, alg_auth, alg_enc, alg_mac, min_tls,
@@ -1001,7 +1001,7 @@
 
     retval = 1;
     l = rule_str;
-    for ( ; ; ) {
+    for (;;) {
         ch = *l;
 
         if (ch == '\0')
diff --git a/ssl/ssl_init.c b/ssl/ssl_init.c
index 2948c30..e996a80 100644
--- a/ssl/ssl_init.c
+++ b/ssl/ssl_init.c
@@ -35,7 +35,7 @@
     SSL_COMP_get_compression_methods();
 #endif
     ssl_sort_cipher_list();
-    OSSL_TRACE(INIT,"ossl_init_ssl_base: SSL_add_ssl_module()\n");
+    OSSL_TRACE(INIT, "ossl_init_ssl_base: SSL_add_ssl_module()\n");
     /*
      * We ignore an error return here. Not much we can do - but not that bad
      * either. We can still safely continue.
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 501977f..3d20305 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -3939,7 +3939,7 @@
 
 const char *ssl_protocol_to_string(int version)
 {
-    switch(version)
+    switch (version)
     {
     case TLS1_3_VERSION:
         return "TLSv1.3";
diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c
index e8e57cd..3afb18c 100644
--- a/ssl/statem/extensions_srvr.c
+++ b/ssl/statem/extensions_srvr.c
@@ -1017,7 +1017,7 @@
         }
 
 #ifndef OPENSSL_NO_PSK
-        if(sess == NULL
+        if (sess == NULL
                 && s->psk_server_callback != NULL
                 && idlen <= PSK_MAX_IDENTITY_LEN) {
             char *pskid = NULL;
diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c
index d12d1e9..61f035c 100644
--- a/ssl/statem/statem_clnt.c
+++ b/ssl/statem/statem_clnt.c
@@ -3198,7 +3198,7 @@
         return 0;
     }
 
-    if (EVP_PKEY_encrypt_init(pkey_ctx) <= 0 ) {
+    if (EVP_PKEY_encrypt_init(pkey_ctx) <= 0) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         goto err;
     };
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index d0d8d26..271f5b4 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -1707,7 +1707,7 @@
     s->s3.send_connection_binding = 0;
     /* Check what signalling cipher-suite values were received. */
     if (scsvs != NULL) {
-        for(i = 0; i < sk_SSL_CIPHER_num(scsvs); i++) {
+        for (i = 0; i < sk_SSL_CIPHER_num(scsvs); i++) {
             c = sk_SSL_CIPHER_value(scsvs, i);
             if (SSL_CIPHER_get_id(c) == SSL3_CK_SCSV) {
                 if (s->renegotiate) {
diff --git a/ssl/tls13_enc.c b/ssl/tls13_enc.c
index 1238892..a9fcf12 100644
--- a/ssl/tls13_enc.c
+++ b/ssl/tls13_enc.c
@@ -640,7 +640,7 @@
     }
 
     /* check whether cipher is known */
-    if(!ossl_assert(cipher != NULL))
+    if (!ossl_assert(cipher != NULL))
         goto err;
 
     if (!derive_secret_key_and_iv(s, which & SSL3_CC_WRITE, md, cipher,
diff --git a/test/bftest.c b/test/bftest.c
index 8da47bc..9a197b4 100644
--- a/test/bftest.c
+++ b/test/bftest.c
@@ -465,7 +465,7 @@
 # endif
 
     while ((o = opt_next()) != OPT_EOF) {
-        switch(o) {
+        switch (o) {
         case OPT_PRINT:
             print_test_data();
             return 1;
diff --git a/test/bio_enc_test.c b/test/bio_enc_test.c
index aeca062..8ece2b6 100644
--- a/test/bio_enc_test.c
+++ b/test/bio_enc_test.c
@@ -172,7 +172,7 @@
 
 static int do_test_bio_cipher(const EVP_CIPHER* cipher, int idx)
 {
-    switch(idx)
+    switch (idx)
     {
         case 0:
             return do_bio_cipher(cipher, KEY, NULL);
diff --git a/test/bntest.c b/test/bntest.c
index 86fa163..a09e8ed 100644
--- a/test/bntest.c
+++ b/test/bntest.c
@@ -712,7 +712,7 @@
 
 static int test_gf2m_mod(void)
 {
-    BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL, *e = NULL;
+    BIGNUM *a = NULL, *b[2] = {NULL, NULL}, *c = NULL, *d = NULL, *e = NULL;
     int i, j, st = 0;
 
     if (!TEST_ptr(a = BN_new())
@@ -805,7 +805,7 @@
 
 static int test_gf2m_sqr(void)
 {
-    BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
+    BIGNUM *a = NULL, *b[2] = {NULL, NULL}, *c = NULL, *d = NULL;
     int i, j, st = 0;
 
     if (!TEST_ptr(a = BN_new())
@@ -844,7 +844,7 @@
 
 static int test_gf2m_modinv(void)
 {
-    BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
+    BIGNUM *a = NULL, *b[2] = {NULL, NULL}, *c = NULL, *d = NULL;
     int i, j, st = 0;
 
     if (!TEST_ptr(a = BN_new())
@@ -881,7 +881,7 @@
 
 static int test_gf2m_moddiv(void)
 {
-    BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
+    BIGNUM *a = NULL, *b[2] = {NULL, NULL}, *c = NULL, *d = NULL;
     BIGNUM *e = NULL, *f = NULL;
     int i, j, st = 0;
 
@@ -925,7 +925,7 @@
 
 static int test_gf2m_modexp(void)
 {
-    BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
+    BIGNUM *a = NULL, *b[2] = {NULL, NULL}, *c = NULL, *d = NULL;
     BIGNUM *e = NULL, *f = NULL;
     int i, j, st = 0;
 
@@ -973,7 +973,7 @@
 
 static int test_gf2m_modsqrt(void)
 {
-    BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
+    BIGNUM *a = NULL, *b[2] = {NULL, NULL}, *c = NULL, *d = NULL;
     BIGNUM *e = NULL, *f = NULL;
     int i, j, st = 0;
 
@@ -1018,7 +1018,7 @@
 
 static int test_gf2m_modsolvequad(void)
 {
-    BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
+    BIGNUM *a = NULL, *b[2] = {NULL, NULL}, *c = NULL, *d = NULL;
     BIGNUM *e = NULL;
     int i, j, s = 0, t, st = 0;
 
@@ -1757,7 +1757,7 @@
 # define BOTTOM_BIT_NOTOUCH 0
         if (!TEST_true(BN_rand(n, bytes * 8, TOP_BIT_ON, BOTTOM_BIT_NOTOUCH)))
             goto err;
-        if (!TEST_int_eq(BN_num_bytes(n),A) bytes
+        if (!TEST_int_eq(BN_num_bytes(n), A) bytes
                 || TEST_int_eq(BN_bn2bin(n, reference), bytes))
             goto err;
         /* Empty buffer should fail. */
diff --git a/test/clienthellotest.c b/test/clienthellotest.c
index 2f6d336..a86f1ab 100644
--- a/test/clienthellotest.c
+++ b/test/clienthellotest.c
@@ -91,7 +91,7 @@
     if (!TEST_true(SSL_CTX_set_max_proto_version(ctx, 0)))
         goto end;
 
-    switch(currtest) {
+    switch (currtest) {
     case TEST_SET_SESSION_TICK_DATA_VER_NEG:
 #if !defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_TLS1_2)
         /* TLSv1.3 is enabled and TLSv1.2 is disabled so can't do this test */
diff --git a/test/constant_time_test.c b/test/constant_time_test.c
index 044100b..ad54dbe 100644
--- a/test/constant_time_test.c
+++ b/test/constant_time_test.c
@@ -85,9 +85,9 @@
                             const char *op_name, size_t a, size_t b,
                             int is_true)
 {
-    if (is_true && !TEST_size_t_eq(op(a,b), CONSTTIME_TRUE_S))
+    if (is_true && !TEST_size_t_eq(op(a, b), CONSTTIME_TRUE_S))
         return 0;
-    if (!is_true && !TEST_uint_eq(op(a,b), CONSTTIME_FALSE_S))
+    if (!is_true && !TEST_uint_eq(op(a, b), CONSTTIME_FALSE_S))
         return 0;
     return 1;
 }
diff --git a/test/defltfips_test.c b/test/defltfips_test.c
index 8b6dc0d..790ec7e 100644
--- a/test/defltfips_test.c
+++ b/test/defltfips_test.c
@@ -70,7 +70,7 @@
     }
 
     argc = test_get_argument_count();
-    switch(argc) {
+    switch (argc) {
     case 0:
         is_fips = 0;
         bad_fips = 0;
diff --git a/test/dhtest.c b/test/dhtest.c
index cb8d9a7..bd99b06 100644
--- a/test/dhtest.c
+++ b/test/dhtest.c
@@ -577,7 +577,7 @@
 
         if (!TEST_ptr(priv_key = BN_bin2bn(td->xB, td->xB_len, NULL))
                 || !TEST_ptr(pub_key = BN_bin2bn(td->yB, td->yB_len, NULL))
-                || !TEST_true( DH_set0_key(dhB, pub_key, priv_key)))
+                || !TEST_true(DH_set0_key(dhB, pub_key, priv_key)))
             goto bad_err;
         priv_key = pub_key = NULL;
 
diff --git a/test/ectest.c b/test/ectest.c
index c08b14b..56a0674 100644
--- a/test/ectest.c
+++ b/test/ectest.c
@@ -2861,11 +2861,11 @@
         goto err;
 
     /* create two `EVP_PKEY`s from the `EC_KEY`s */
-    if(!TEST_ptr(pkey1 = EVP_PKEY_new())
+    if (!TEST_ptr(pkey1 = EVP_PKEY_new())
             || !TEST_int_eq(EVP_PKEY_assign_EC_KEY(pkey1, eckey1), 1))
         goto err;
     eckey1 = NULL; /* ownership passed to pkey1 */
-    if(!TEST_ptr(pkey2 = EVP_PKEY_new())
+    if (!TEST_ptr(pkey2 = EVP_PKEY_new())
             || !TEST_int_eq(EVP_PKEY_assign_EC_KEY(pkey2, eckey2), 1))
         goto err;
     eckey2 = NULL; /* ownership passed to pkey2 */
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index 22cc3b3..df97f44 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -1021,7 +1021,7 @@
         0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13
     };
 
-    if (tst == 0 ) {
+    if (tst == 0) {
         if (!TEST_ptr(pkey = load_example_rsa_key()))
                 goto out;
     } else if (tst == 1) {
@@ -2882,7 +2882,7 @@
     if (nullprov != NULL && idx < 6)
         return TEST_skip("Test does not support a non-default library context");
 
-    switch(idx) {
+    switch (idx) {
     case 0:
         type = EVP_aes_128_cbc();
         /* FALLTHROUGH */
@@ -3026,7 +3026,7 @@
     if (lgcyprov == NULL && idx < 3)
         return TEST_skip("Test requires legacy provider to be loaded");
 
-    switch(idx) {
+    switch (idx) {
     case 0:
         type = EVP_CIPHER_fetch(testctx, "des-cbc", testpropq);
         ref_iv = cbc_state_des;
@@ -3300,7 +3300,7 @@
 static int evp_init_seq_set_iv(EVP_CIPHER_CTX *ctx, const EVP_INIT_TEST_st *t)
 {
     int res = 0;
-    
+
     if (t->ivlen != 0) {
         if (!TEST_true(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, t->ivlen, NULL)))
             goto err;
@@ -3817,7 +3817,7 @@
     if (testctx != NULL)
         return 1;
 
-    switch(idx) {
+    switch (idx) {
     case 0:
     case 6:
         id = EVP_PKEY_RSA;
diff --git a/test/evp_kdf_test.c b/test/evp_kdf_test.c
index 145e64f..7fde5ea 100644
--- a/test/evp_kdf_test.c
+++ b/test/evp_kdf_test.c
@@ -1496,7 +1496,7 @@
     return ret;
 }
 
-static int test_kdfs_same( EVP_KDF *kdf1, EVP_KDF *kdf2)
+static int test_kdfs_same(EVP_KDF *kdf1, EVP_KDF *kdf2)
 {
     /* Fast path in case the two are the same algorithm pointer */
     if (kdf1 == kdf2)
diff --git a/test/evp_test.c b/test/evp_test.c
index eda8c82..819371c 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -944,7 +944,7 @@
             in += in_len - 1;
             in_len = 1;
         }
-        if (in_len > 0 ) {
+        if (in_len > 0) {
             if (!EVP_CipherUpdate(ctx, tmp + out_misalign + tmplen, &chunklen,
                                   in, 1))
                 goto err;
@@ -2879,12 +2879,12 @@
         goto end;
     }
 
-    if ((rv = EVP_PKEY_eq(pair->privk, pair->pubk)) != 1 ) {
-        if ( 0 == rv ) {
+    if ((rv = EVP_PKEY_eq(pair->privk, pair->pubk)) != 1) {
+        if (0 == rv) {
             t->err = "KEYPAIR_MISMATCH";
-        } else if ( -1 == rv ) {
+        } else if (-1 == rv) {
             t->err = "KEYPAIR_TYPE_MISMATCH";
-        } else if ( -2 == rv ) {
+        } else if (-2 == rv) {
             t->err = "UNSUPPORTED_KEY_COMPARISON";
         } else {
             TEST_error("Unexpected error in key comparison");
@@ -3601,7 +3601,7 @@
         }
         klist = &public_keys;
     } else if (strcmp(pp->key, "PrivateKeyRaw") == 0
-               || strcmp(pp->key, "PublicKeyRaw") == 0 ) {
+               || strcmp(pp->key, "PublicKeyRaw") == 0) {
         char *strnid = NULL, *keydata = NULL;
         unsigned char *keybin;
         size_t keylen;
diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c
index d44aa4b..780a71b 100644
--- a/test/helpers/handshake.c
+++ b/test/helpers/handshake.c
@@ -1520,7 +1520,7 @@
      * The handshake succeeds once both peers have succeeded. If one peer
      * errors out, we also let the other peer retry (and presumably fail).
      */
-    for(;;) {
+    for (;;) {
         if (client_turn) {
             do_connect_step(test_ctx, &client, phase);
             status = handshake_status(client.status, server.status,
diff --git a/test/helpers/pkcs12.c b/test/helpers/pkcs12.c
index a87683d..d5269e6 100644
--- a/test/helpers/pkcs12.c
+++ b/test/helpers/pkcs12.c
@@ -517,7 +517,7 @@
         attr_obj = X509_ATTRIBUTE_get0_object(attr);
         OBJ_obj2txt(attr_txt, 100, attr_obj, 0);
 
-        while(p_attr->oid != NULL) {
+        while (p_attr->oid != NULL) {
             /* Find a matching attribute type */
             if (strcmp(p_attr->oid, attr_txt) == 0) {
                 if (!TEST_int_eq(X509_ATTRIBUTE_count(attr), 1))
diff --git a/test/helpers/ssltestlib.c b/test/helpers/ssltestlib.c
index 2d992cd..795cff2 100644
--- a/test/helpers/ssltestlib.c
+++ b/test/helpers/ssltestlib.c
@@ -49,7 +49,7 @@
     if (method_tls_dump == NULL) {
         method_tls_dump = BIO_meth_new(BIO_TYPE_TLS_DUMP_FILTER,
                                         "TLS dump filter");
-        if (   method_tls_dump == NULL
+        if (method_tls_dump == NULL
             || !BIO_meth_set_write(method_tls_dump, tls_dump_write)
             || !BIO_meth_set_read(method_tls_dump, tls_dump_read)
             || !BIO_meth_set_puts(method_tls_dump, tls_dump_puts)
@@ -469,7 +469,7 @@
         thispkt->type = type;
     }
 
-    for(i = 0; (looppkt = sk_MEMPACKET_value(ctx->pkts, i)) != NULL; i++) {
+    for (i = 0; (looppkt = sk_MEMPACKET_value(ctx->pkts, i)) != NULL; i++) {
         /* Check if we found the right place to insert this packet */
         if (looppkt->num > thispkt->num) {
             if (sk_MEMPACKET_insert(ctx->pkts, thispkt, i) == 0)
@@ -767,7 +767,7 @@
 {
     int flags;
 
-    flags = fcntl(fd,F_GETFL,0);
+    flags = fcntl(fd, F_GETFL, 0);
     if (flags == -1)
         return flags;
     flags = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
@@ -806,7 +806,7 @@
     if (set_nb(afd) == -1)
         goto out;
 
-    while (sfd == -1 || !cfd_connected ) {
+    while (sfd == -1 || !cfd_connected) {
         sfd = accept(afd, NULL, 0);
         if (sfd == -1 && errno != EAGAIN)
             goto out;
diff --git a/test/modes_internal_test.c b/test/modes_internal_test.c
index 32fb756..7ba4b98 100644
--- a/test/modes_internal_test.c
+++ b/test/modes_internal_test.c
@@ -869,7 +869,7 @@
     if (A.data != NULL)
         CRYPTO_gcm128_aad(&ctx, A.data, A.size);
     if (P.data != NULL)
-        if (!TEST_int_ge(CRYPTO_gcm128_encrypt( &ctx, P.data, out, P.size), 0))
+        if (!TEST_int_ge(CRYPTO_gcm128_encrypt(&ctx, P.data, out, P.size), 0))
             return 0;
     if (!TEST_false(CRYPTO_gcm128_finish(&ctx, T.data, 16))
             || (C.data != NULL
diff --git a/test/ossl_store_test.c b/test/ossl_store_test.c
index b45d1d5..ba1bc6f 100644
--- a/test/ossl_store_test.c
+++ b/test/ossl_store_test.c
@@ -105,7 +105,7 @@
     const char *urifmt;
     char uri[PATH_MAX];
 
-    switch(idx) {
+    switch (idx) {
 #ifndef OPENSSL_NO_DH
     case 0:
         type = "DH";
diff --git a/test/param_build_test.c b/test/param_build_test.c
index bfa463a..332a4cb 100644
--- a/test/param_build_test.c
+++ b/test/param_build_test.c
@@ -48,7 +48,7 @@
         || !TEST_ptr(params_blt = OSSL_PARAM_BLD_to_param(bld)))
         goto err;
 
-    switch(tstid) {
+    switch (tstid) {
     case 0:
         params = params_blt;
         break;
@@ -179,7 +179,7 @@
                                                     data2_size))
         || !TEST_ptr(params_blt = OSSL_PARAM_BLD_to_param(bld)))
         goto err;
-    switch(tstid) {
+    switch (tstid) {
     case 0:
         params = params_blt;
         break;
@@ -284,7 +284,7 @@
 
     if (!TEST_ptr(bld))
         goto err;
-    
+
     for (i = 0; i < n; i++) {
         names[i][0] = 'A' + (i / 26) - 1;
         names[i][1] = 'a' + (i % 26) - 1;
diff --git a/test/params_api_test.c b/test/params_api_test.c
index 48e2f89..320de12 100644
--- a/test/params_api_test.c
+++ b/test/params_api_test.c
@@ -505,7 +505,7 @@
     params[n++] = OSSL_PARAM_construct_octet_ptr("octptr", &vp, 0);
     params[n] = OSSL_PARAM_construct_end();
 
-    switch(tstid) {
+    switch (tstid) {
     case 0:
         p = params;
         break;
@@ -620,7 +620,7 @@
         goto err;
     /* Match the return size to avoid trailing garbage bytes */
     cp->data_size = cp->return_size;
-    if(!TEST_true(OSSL_PARAM_get_BN(cp, &bn2))
+    if (!TEST_true(OSSL_PARAM_get_BN(cp, &bn2))
         || !TEST_BN_eq(bn, bn2))
         goto err;
     ret = 1;
diff --git a/test/pkcs12_format_test.c b/test/pkcs12_format_test.c
index d4129d2..ff2c5c0 100644
--- a/test/pkcs12_format_test.c
+++ b/test/pkcs12_format_test.c
@@ -426,7 +426,7 @@
 static int test_single_key_with_attrs(void)
 {
     PKCS12_BUILDER *pb = new_pkcs12_builder("1keyattrs.p12");
-    
+
     /* Generate/encode */
     start_pkcs12(pb);
 
@@ -522,7 +522,7 @@
 static int test_cert_key_with_attrs_and_mac(void)
 {
     PKCS12_BUILDER *pb = new_pkcs12_builder("1cert1key.p12");
-    
+
     /* Generate/encode */
     start_pkcs12(pb);
 
@@ -553,7 +553,7 @@
 static int test_cert_key_encrypted_content(void)
 {
     PKCS12_BUILDER *pb = new_pkcs12_builder("1cert1key_enc.p12");
-    
+
     /* Generate/encode */
     start_pkcs12(pb);
 
@@ -585,7 +585,7 @@
 {
     PKCS12_BUILDER *pb = new_pkcs12_builder("1secret.p12");
     int custom_nid = get_custom_oid();
-    
+
     /* Generate/encode */
     start_pkcs12(pb);
 
@@ -664,7 +664,7 @@
 {
     PKCS12_BUILDER *pb = new_pkcs12_builder("multi_contents.p12");
     int custom_nid = get_custom_oid();
-    
+
     /* Generate/encode */
     start_pkcs12(pb);
 
diff --git a/test/provfetchtest.c b/test/provfetchtest.c
index ca154dd..1d09e6a 100644
--- a/test/provfetchtest.c
+++ b/test/provfetchtest.c
@@ -246,7 +246,7 @@
             || !TEST_ptr(dummyprov = OSSL_PROVIDER_load(libctx, "dummy-prov")))
         goto err;
 
-    switch(tst) {
+    switch (tst) {
     case 0:
         decoder = OSSL_DECODER_fetch(libctx, "DUMMY", NULL);
         if (!TEST_ptr(decoder))
diff --git a/test/ssl_old_test.c b/test/ssl_old_test.c
index 6a206d5..adeb010 100644
--- a/test/ssl_old_test.c
+++ b/test/ssl_old_test.c
@@ -1908,7 +1908,7 @@
     {
         int st_connect = 0, st_accept = 0;
 
-        while(!st_connect || !st_accept) {
+        while (!st_connect || !st_accept) {
             if (!st_connect) {
                 if (BIO_do_connect(client) <= 0) {
                     if (!BIO_should_retry(client))
diff --git a/test/sslapitest.c b/test/sslapitest.c
index fbec107..35556d0 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -6564,7 +6564,7 @@
     PACKET pkt, pkt2, pkt3;
     unsigned int MFL_code = 0, type = 0;
 
-    if (!TEST_uint_gt( len = BIO_get_mem_data( bio, (char **) &data ), 0 ) )
+    if (!TEST_uint_gt(len = BIO_get_mem_data(bio, (char **) &data), 0))
         goto end;
 
     memset(&pkt, 0, sizeof(pkt));
@@ -6572,7 +6572,7 @@
     memset(&pkt3, 0, sizeof(pkt3));
 
     if (!TEST_long_gt(len, 0)
-            || !TEST_true( PACKET_buf_init( &pkt, data, len ) )
+            || !TEST_true(PACKET_buf_init(&pkt, data, len))
                /* Skip the record header */
             || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
                /* Skip the handshake message header */
diff --git a/test/sslcorrupttest.c b/test/sslcorrupttest.c
index d270d42..57ce2a8 100644
--- a/test/sslcorrupttest.c
+++ b/test/sslcorrupttest.c
@@ -110,7 +110,7 @@
     if (method_tls_corrupt == NULL) {
         method_tls_corrupt = BIO_meth_new(BIO_TYPE_CUSTOM_FILTER,
                                           "TLS corrupt filter");
-        if (   method_tls_corrupt == NULL
+        if (method_tls_corrupt == NULL
             || !BIO_meth_set_write(method_tls_corrupt, tls_corrupt_write)
             || !BIO_meth_set_read(method_tls_corrupt, tls_corrupt_read)
             || !BIO_meth_set_puts(method_tls_corrupt, tls_corrupt_puts)
diff --git a/test/stack_test.c b/test/stack_test.c
index 3d60ef6..d44e6fc 100644
--- a/test/stack_test.c
+++ b/test/stack_test.c
@@ -150,7 +150,7 @@
             goto end;
         }
     for (i = 0; i < n_exfinds; i++)
-        if (!TEST_int_eq(sk_sint_find_ex(s, &exfinds[i].value), exfinds[i].ex)){
+        if (!TEST_int_eq(sk_sint_find_ex(s, &exfinds[i].value), exfinds[i].ex)) {
             TEST_info("int sorted find_ex absent %d", i);
             goto end;
         }
diff --git a/test/tls13ccstest.c b/test/tls13ccstest.c
index 3a3fa8c..1ec2ee2 100644
--- a/test/tls13ccstest.c
+++ b/test/tls13ccstest.c
@@ -42,7 +42,7 @@
     if (method_watchccs == NULL) {
         method_watchccs = BIO_meth_new(BIO_TYPE_WATCHCCS_FILTER,
                                        "Watch CCS filter");
-        if (   method_watchccs == NULL
+        if (method_watchccs == NULL
             || !BIO_meth_set_write(method_watchccs, watchccs_write)
             || !BIO_meth_set_read(method_watchccs, watchccs_read)
             || !BIO_meth_set_puts(method_watchccs, watchccs_puts)
@@ -193,7 +193,7 @@
             } else {
                 badccs = 1;
             }
-        } else if(rectype == SSL3_RT_APPLICATION_DATA) {
+        } else if (rectype == SSL3_RT_APPLICATION_DATA) {
             if (bio == s_to_c_fbio)
                 sappdataseen = 1;
             else
diff --git a/test/uitest.c b/test/uitest.c
index 9013126..8659b0b 100644
--- a/test/uitest.c
+++ b/test/uitest.c
@@ -37,7 +37,7 @@
     int ok = 0;
 
     if (!TEST_ptr(ui_method =
-                  UI_UTIL_wrap_read_pem_callback( test_pem_password_cb, 0))
+                  UI_UTIL_wrap_read_pem_callback(test_pem_password_cb, 0))
             || !TEST_ptr(ui = UI_new_method(ui_method)))
         goto err;