]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix tls-version-min default once again
authorSelva Nair <selva.nair@gmail.com>
Tue, 2 Nov 2021 04:23:14 +0000 (00:23 -0400)
committerGert Doering <gert@greenie.muc.de>
Fri, 5 Nov 2021 20:50:05 +0000 (21:50 +0100)
commit 51be733ba236610dff6a1c361cf59172db97473a
claimed to correct this but did not do it properly.
(my fault). The check whether tls-version-min is set
by the user or not was still wrong.

Hope this fixes it for good.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20211102042314.19113-1-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23091.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c

index f8b91042094ddf8911b3b5a6d2070af32d4938c4..c912c8dd8420d20ee944b8efc28425f489586086 100644 (file)
@@ -3165,7 +3165,9 @@ static void
 options_set_backwards_compatible_options(struct options *o)
 {
     /* TLS min version is not set */
-    if ((o->ssl_flags & SSLF_TLS_VERSION_MIN_MASK) == 0)
+    int tls_ver_min = (o->ssl_flags >> SSLF_TLS_VERSION_MIN_SHIFT)
+                          & SSLF_TLS_VERSION_MIN_MASK;
+    if (tls_ver_min == 0)
     {
         int tls_ver_max = (o->ssl_flags >> SSLF_TLS_VERSION_MAX_SHIFT)
                           & SSLF_TLS_VERSION_MAX_MASK;