]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Inline do_init_auth_token_key
authorArne Schwabe <arne@rfc2549.org>
Wed, 12 May 2021 13:15:05 +0000 (15:15 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 14 May 2021 12:10:41 +0000 (14:10 +0200)
The extra function does not really give a better understanding
of the code or any other benefit.  Inline it to make the code more
streamlined.

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

index 9b0c53495ed91c52cd4cda345ca1dcb5a95f749e..49c742928ab204d5ce38ed61cb2387503098ba96 100644 (file)
@@ -2672,22 +2672,6 @@ do_init_tls_wrap_key(struct context *c)
 
 }
 
-/*
- * Initialise the auth-token key context
- */
-static void
-do_init_auth_token_key(struct context *c)
-{
-    if (!c->options.auth_token_generate)
-    {
-        return;
-    }
-
-    auth_token_init_secret(&c->c1.ks.auth_token_key,
-                           c->options.auth_token_secret_file,
-                           c->options.auth_token_secret_file_inline);
-}
-
 /*
  * Initialize the persistent component of OpenVPN's TLS mode,
  * which is preserved across SIGUSR1 resets.
@@ -2762,7 +2746,12 @@ do_init_crypto_tls_c1(struct context *c)
         do_init_tls_wrap_key(c);
 
         /* initialise auth-token crypto support */
-        do_init_auth_token_key(c);
+        if (c->options.auth_token_generate)
+        {
+            auth_token_init_secret(&c->c1.ks.auth_token_key,
+                                   c->options.auth_token_secret_file,
+                                   c->options.auth_token_secret_file_inline);
+        }
 
 #if 0 /* was: #if ENABLE_INLINE_FILES --  Note that enabling this code will break restarts */
         if (options->priv_key_file_inline)