]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove tls_init_control_channel_frame_parameters wrapper function
authorArne Schwabe <arne@rfc2549.org>
Fri, 22 Apr 2022 13:40:30 +0000 (15:40 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 24 Apr 2022 18:06:51 +0000 (20:06 +0200)
While calling this wrapper function is strictly more correct, these
indirection layer with tiny wrapper make the code more complex and
going through more layer than it really needs to.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220422134038.3801239-2-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24172.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c
src/openvpn/ssl.c
src/openvpn/ssl.h

index af2bc1be55a5283b05add5ff2e29ab4e045f6aa1..e41bb9d4b8c50e0591bb52725eb40adae9b28417 100644 (file)
@@ -2989,7 +2989,7 @@ do_init_frame_tls(struct context *c)
     }
     if (c->c2.tls_auth_standalone)
     {
-        tls_auth_standalone_finalize(c->c2.tls_auth_standalone, &c->c2.frame);
+        tls_init_control_channel_frame_parameters(&c->c2.frame, &c->c2.tls_auth_standalone->frame);
         frame_print(&c->c2.tls_auth_standalone->frame, D_MTU_INFO,
                     "TLS-Auth MTU parms");
     }
index 911d97f8eb09cb35586c7bf699733d71d6bb645d..a28ecce536ebb73fb7a342c5303f7aa6d9868636 100644 (file)
@@ -295,11 +295,7 @@ tls_limit_reneg_bytes(const char *ciphername, int *reneg_bytes)
     }
 }
 
-/*
- * Max number of bytes we will add
- * to control channel packet.
- */
-static void
+void
 tls_init_control_channel_frame_parameters(const struct frame *data_channel_frame,
                                           struct frame *frame)
 {
@@ -1284,7 +1280,6 @@ void
 tls_multi_init_finalize(struct tls_multi *multi, const struct frame *frame)
 {
     tls_init_control_channel_frame_parameters(frame, &multi->opt.frame);
-
     /* initialize the active and untrusted sessions */
 
     tls_session_init(multi, &multi->session[TM_ACTIVE]);
@@ -1322,13 +1317,6 @@ tls_auth_standalone_init(struct tls_options *tls_options,
     return tas;
 }
 
-void
-tls_auth_standalone_finalize(struct tls_auth_standalone *tas,
-                             const struct frame *frame)
-{
-    tls_init_control_channel_frame_parameters(frame, &tas->frame);
-}
-
 /*
  * Set local and remote option compatibility strings.
  * Used to verify compatibility of local and remote option
index cf754ad283cddc08042d7d19b0cdde90fc317f78..6684aa2baa57c9daede1575f435c9b4795c06587 100644 (file)
@@ -209,10 +209,11 @@ struct tls_auth_standalone *tls_auth_standalone_init(struct tls_options *tls_opt
                                                      struct gc_arena *gc);
 
 /*
- * Finalize a standalone tls-auth verification object.
+ * Setups the control channel frame size parameters from the data channel
+ * parameters
  */
-void tls_auth_standalone_finalize(struct tls_auth_standalone *tas,
-                                  const struct frame *frame);
+void tls_init_control_channel_frame_parameters(const struct frame *data_channel_frame,
+                                               struct frame *frame);
 
 /*
  * Set local and remote option compatibility strings.