From: Arne Schwabe Date: Wed, 1 Dec 2021 18:07:27 +0000 (+0100) Subject: Initialise kt_cipher even when no crypto is enabled X-Git-Tag: v2.6_beta1~351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02d8f792893965a653e6bc99e039e169ad70bef9;p=thirdparty%2Fopenvpn.git Initialise kt_cipher even when no crypto is enabled 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 Acked-by: Gert Doering 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 --- diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 624b70878..5113351ae 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -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 "