Skip to contentSkip to conversation

disable DCO if --secret is specified

PATCH In review Antonio Quartulli 3 participants 3 messages Dec 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 disable DCO if --secret is specified

P2P mode with pre-shared key is deprecated, unsecure and should NOT be used. This said we still carry it around for a bit and we have to make sure it does not fights with DCO.

Disable DCO at all when --secret is specified.

---
 src/openvpn/dco.c | 6 ++++++
 1 file changed, 6 insertions(+)
src/openvpn/dco.c +6 -0
index d599dd7e..1cd698bf 100644
@@ -274,6 +274,12 @@ dco_check_startup_option(int msglevel, const struct options *o)
         return false;
     }
 
+    if (o->shared_secret_file)
+    {
+        msg(msglevel, "--secret is set. Disabling data channel offload");
+        return false;
+    }
+
     if (dev_type_enum(o->dev, o->dev_type) != DEV_TYPE_TUN)
     {
         msg(msglevel, "Note: dev-type not tun, disabling data channel offload.");
Signature · 1 line
2.37.4
Acked-by on v1 1/1
#1 lore raw

Nicely trivial, and gets the job done :-) -

Dec  7 11:21:02 ubuntu2004 tun-udp-p2p[1139052]: --secret is set. Disabling data channel offload

.. and subsequently, tests succeed, and the instance does not crash anymore. Thanks. (Tested only on the Linux/DCO Server + Client, because the code path is irrelevant on non-DCO systems)

I have added "Github: OpenVPN/openvpn#188" to the commit message, as discussed on IRC just now.

Your patch has been applied to the master and release/2.6 branch.

commit f5febf7f8998e425afb051cd6f965f4dd40b1659 (master) commit 952a33a879ee106ee0877b872ad3d6c58983b521 (release/2.6)

Author: Antonio Quartulli
Date:   Wed Dec 7 11:02:01 2022 +0100
     disable DCO if --secret is specified

     Signed-off-by: Antonio Quartulli <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg25629.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#2 lore raw
In reply to Antonio Quartulli

Am 07.12.22 um 11:02 schrieb Antonio Quartulli:

Quoted 16 lines

P2P mode with pre-shared key is deprecated, unsecure and should NOT be used. This said we still carry it around for a bit and we have to make sure it does not fights with DCO.

Disable DCO at all when --secret is specified.

---
  src/openvpn/dco.c | 6 ++++++
  1 file changed, 6 insertions(+)
src/openvpn/dco.c +0 -0
index d599dd7e..1cd698bf 100644

src/openvpn/dco.c dco_check_startup_option(int msglevel, const struct options *o) · line 281

Quoted 8 lines
src/openvpn/dco.c +5 -0
@@ -274,6 +274,12 @@ dco_check_startup_option(int msglevel, const struct options *o)
          return false;
      }
 
+    if (o->shared_secret_file)
+    {
+        msg(msglevel, "--secret is set. Disabling data channel offload");
+        return false;
+    }

I think you missing the mode when you have neither --secret nor any of the tls modes.

Arne