]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Don't print OCC warnings about 'key-method', 'keydir' and 'tls-auth'
authorSteffan Karger <steffan.karger@fox-it.com>
Sun, 7 Oct 2018 17:52:15 +0000 (19:52 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 7 Oct 2018 20:15:59 +0000 (22:15 +0200)
Like 'proto', a mismatch in key-method, keydir or tls-auth would fail
before we ever get to the point where we can print this warning.

This prepares for removing these from the occ string later on, but also
prepares for tls-crypt-v2, which allows a server to support tls-auth and
tls-crypt-v2 connections in parallel. Such a server will send 'keydir'
and 'tls-auth' in the occ string. This change removes the spurious
warnings about that in the client log.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20181007175215.25009-1-steffan@karger.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17618.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 3baae9ba52187166b7d0b05901732666477a2acb)

src/openvpn/options.c

index d1adfb65830dbb2f7f715b23bee697c1d6537fc3..52b9fb138f197627a679e3c70d6b5c2b4ba72f68 100644 (file)
@@ -3787,11 +3787,15 @@ options_warning_safe_scan2(const int msglevel,
                            const char *b1_name,
                            const char *b2_name)
 {
-    /* we will stop sending 'proto xxx' in OCC in a future version
-     * (because it's not useful), and to reduce questions when
-     * interoperating, we start not-printing a warning about it today
+    /* We will stop sending 'key-method', 'keydir', 'proto' and 'tls-auth' in
+     * OCC in a future version (because it's not useful). To reduce questions
+     * when interoperating, we no longer printing a warning about it.
      */
-    if (strncmp(p1, "proto ", 6) == 0)
+    if (strprefix(p1, "key-method ")
+        || strprefix(p1, "keydir ")
+        || strprefix(p1, "proto ")
+        || strprefix(p1, "tls-auth ")
+        || strprefix(p1, "tun-ipv6"))
     {
         return;
     }