From: Arne Schwabe Date: Wed, 12 May 2021 13:15:05 +0000 (+0200) Subject: Inline do_init_auth_token_key X-Git-Tag: v2.6_beta1~504 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6cf4fa5a4a686fa99ccdc8b1df48616853bc6be6;p=thirdparty%2Fopenvpn.git 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 Acked-by: Gert Doering 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 --- diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 9b0c53495..49c742928 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -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)