]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Minor style change to improve code style
authorArne Schwabe <arne@rfc2549.org>
Thu, 16 Apr 2020 11:39:29 +0000 (13:39 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 19 Apr 2020 10:29:27 +0000 (12:29 +0200)
These are small manual changes that are done to improve the code
style and also make the result of uncrustify better without mixing
manual changes/automatic changes into a single commit.

- Make prototype and function identical for gc_addspecial. Also fixes
  uncrustify misparsing the embedded function pointer decleration
- Disallow uncrustify to reformat link_socket_init_phase1, which it
  messes up
- Format the the parameters of a call of  mbedtls_ssl_tls_prf to
  be more inline with the rest of our function calls with multiple
  arguments

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20200416113930.15192-2-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19748.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/buffer.c
src/openvpn/socket.h
src/openvpn/ssl_mbedtls.c

index 8575e29595ac6b3104e49aa3f1f73bf706984f09..b32bc8b2629a185404db37d95dafe08dcc261450 100644 (file)
@@ -474,7 +474,7 @@ x_gc_freespecial(struct gc_arena *a)
 }
 
 void
-gc_addspecial(void *addr, void (free_function)(void *), struct gc_arena *a)
+gc_addspecial(void *addr, void (*free_function)(void *), struct gc_arena *a)
 {
     ASSERT(a);
     struct gc_entry_special *e;
index e95547d1a840ca81cf4b9e35ade63f53c384db69..38e5138d257af70cd139091762f8e8e1121a140e 100644 (file)
@@ -296,7 +296,8 @@ int openvpn_connect(socket_descriptor_t sd,
 /*
  * Initialize link_socket object.
  */
-
+/* *INDENT-OFF* uncrustify misparses this function declarion because of
+ * embedded #if/#endif tell it to skip this section */
 void
 link_socket_init_phase1(struct link_socket *sock,
                         const char *local_host,
@@ -327,6 +328,7 @@ link_socket_init_phase1(struct link_socket *sock,
                         int mark,
                         struct event_timeout *server_poll_timeout,
                         unsigned int sockflags);
+/* Reenable uncrustify *INDENT-ON* */
 
 void link_socket_init_phase2(struct link_socket *sock,
                              const struct frame *frame,
index 51669278136db45b1637d378fa7bd3fcb2637c12..5cb7951d263e2004679e54e1f921fc2c6dd653bc 100644 (file)
@@ -209,10 +209,10 @@ int mbedtls_ssl_export_keys_cb(void *p_expkey, const unsigned char *ms,
     memcpy(client_server_random + 32, server_random, 32);
 
     const size_t ms_len = sizeof(ks_ssl->ctx->session->master);
-    int ret = mbedtls_ssl_tls_prf(
-            tls_prf_type, ms, ms_len, session->opt->ekm_label,
-            client_server_random, sizeof(client_server_random),
-            ks_ssl->exported_key_material, session->opt->ekm_size);
+    int ret = mbedtls_ssl_tls_prf(tls_prf_type, ms, ms_len,
+                                  session->opt->ekm_label, client_server_random,
+                                  sizeof(client_server_random), ks_ssl->exported_key_material,
+                                  session->opt->ekm_size);
 
     if (!mbed_ok(ret))
     {