]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
compat-mode: add --data-cipher-fallback auomatically if requested
authorAntonio Quartulli <a@unstable.cc>
Sat, 4 Sep 2021 09:56:27 +0000 (11:56 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 20 Sep 2021 15:23:38 +0000 (17:23 +0200)
For compatibility with OpenVPN older than 2.4.0, the
'--data-cipher-fallback' argument is automatically added with the same
value as specified by '--cipher'.

This happens only when the user specifies compat-mode with a version
older than 2.4.0.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20210904095629.6273-6-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22798.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
doc/man-sections/generic-options.rst
src/openvpn/options.c

index 8b26cd1ab90a91cfae9be54c33de5ff2c2a0d25e..3e099e129ee0d4ae5e9abae873097c10342175c9 100644 (file)
@@ -68,6 +68,8 @@ which mode OpenVPN is configured as.
     to the configuration if no other compression options are present.
   - 2.4.x or lower: The cipher in ``--cipher`` is appended to
     ``--data-ciphers``
+  - 2.3.x or lower: ``--data-cipher-fallback`` is automatically added with
+    the same cipher as ``--cipher``
 
 --config file
   Load additional config options from ``file`` where each line corresponds
index 4085502f088d2b717a69fd6e0f6626ad0e72753b..4b6655d92dffb0ee8be306667395d4c30e432b89 100644 (file)
@@ -3176,6 +3176,13 @@ options_set_backwards_compatible_options(struct options *o)
         append_cipher_to_ncp_list(o, o->ciphername);
     }
 
+    /* Versions < 2.4.0 additionally might be compiled with --enable-small and
+     * not have OCC strings required for "poor man's NCP" */
+    if (o->ciphername && need_compatibility_before(o, 20400))
+    {
+        o->enable_ncp_fallback = true;
+    }
+
     /* Compression is deprecated and we do not want to announce support for it
      * by default anymore, additionally DCO breaks with compression.
      *