aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe2021-05-12 15:15:05 +0200
committerGert Doering2021-05-14 14:10:41 +0200
commit6cf4fa5a4a686fa99ccdc8b1df48616853bc6be6 (patch)
tree8cd4323462ce82d9aa60daf7eef1d7cc7764d306
parent84e14209232441fd6601d3efb7c7aa93bee4ce88 (diff)
downloadopenvpn-6cf4fa5a4a686fa99ccdc8b1df48616853bc6be6.zip
openvpn-6cf4fa5a4a686fa99ccdc8b1df48616853bc6be6.tar.gz
Inline do_init_auth_token_key
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>
-rw-r--r--src/openvpn/init.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index 9b0c534..49c7429 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -2673,22 +2673,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)