]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Initialise kt_cipher even when no crypto is enabled
authorArne Schwabe <arne@rfc2549.org>
Wed, 1 Dec 2021 18:07:27 +0000 (19:07 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 13 Dec 2021 21:01:39 +0000 (22:01 +0100)
This avoids special casing the cipher none/auth none case in other
parts, e.g. in the upcoming buffer/frame rework.

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

index 624b70878d48b97e06f0eff4aa643bebe29c3caf..5113351ae0964294d8baa674e9d003a04012adfe 100644 (file)
@@ -3068,9 +3068,15 @@ do_init_finalize_tls_frame(struct context *c)
  * No encryption or authentication.
  */
 static void
-do_init_crypto_none(const struct context *c)
+do_init_crypto_none(struct context *c)
 {
     ASSERT(!c->options.test_crypto);
+
+    /* Initialise key_type with auth/cipher "none", so the key_type struct is
+     * valid */
+    init_key_type(&c->c1.ks.key_type, "none", "none",
+                  c->options.test_crypto, true);
+
     msg(M_WARN,
         "******* WARNING *******: All encryption and authentication features "
         "disabled -- All data will be tunnelled as clear text and will not be "