From: "cron2 (Code Review)" Date: Thu, 18 Jan 2024 17:49:33 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <6c153abf5da1fc4d1fcdeb34df369739eecfecd7-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="UFIk0foGpFQ="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: NTLM: when NTLMv1 is requested, try NTLMv2 instead List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --UFIk0foGpFQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/50= 0?usp=3Demail ) Change subject: NTLM: when NTLMv1 is requested, try NTLMv2 instead ...................................................................... NTLM: when NTLMv1 is requested, try NTLMv2 instead Commit 21910ebc2ee8a6138eb2af8d38056d2b94e59f9c removed support for NTLMv1 authentication. This adjusts the behavior for existing configurations that specify "ntlm" keyword. Do not error out hard, instead just try to upgrade. This should work fine in many cases and will avoid breaking user configs unnecessarily on upgrade. In addition it fixes an issue with the mentioned patch where "auto" wasn't working correctly for NTLM anymore. Change-Id: Iec74e88f86cd15328f993b6cdd0317ebda81563c Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Message-Id: <20240118151242.12169-1-gert@...1296...> URL: https://www.mail-archive.com/search?l=3Dmid&q=3D20240118151242.12169-1= -gert@...1296... Signed-off-by: Gert Doering --- M Changes.rst M doc/man-sections/proxy-options.rst M src/openvpn/proxy.c 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Changes.rst b/Changes.rst index 69c811d..58cb3db 100644 --- a/Changes.rst +++ b/Changes.rst @@ -12,8 +12,13 @@ ``--allow-deprecated-insecure-static-crypto`` but will be removed in OpenVPN 2.8. -NTLMv1 support has been removed because it is completely insecure. - NTLMv2 support is still available, but will removed in a future releas= e. +NTLMv1 authentication support for HTTP proxies has been removed. + This is considered an insecure method of authentication that uses + obsolete crypto algorithms. + NTLMv2 support is still available, but will be removed in a future + release. + When configured to authenticate with NTLMv1 (``ntlm`` keyword in + ``--http-proxy``) OpenVPN will try NTLMv2 instead. Overview of changes in 2.6 diff --git a/doc/man-sections/proxy-options.rst b/doc/man-sections/proxy-op= tions.rst index ad49c60..38c4578 100644 --- a/doc/man-sections/proxy-options.rst +++ b/doc/man-sections/proxy-options.rst @@ -48,6 +48,8 @@ Note that support for NTLMv1 proxies was removed with OpenVPN 2.7. + :code:`ntlm` now is an alias for :code:`ntlm2`; i.e. OpenVPN will always + attempt to use NTLMv2 authentication. --http-proxy-user-pass userpass Overwrite the username/password information for ``--http-proxy``. If spe= cified diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c index e081532..2e8d7a8 100644 --- a/src/openvpn/proxy.c +++ b/src/openvpn/proxy.c @@ -497,7 +497,7 @@ msg(M_FATAL, "HTTP_PROXY: server not specified"); } - ASSERT( o->port); + ASSERT(o->port); ALLOC_OBJ_CLEAR(p, struct http_proxy_info); p->options =3D *o; @@ -517,7 +517,8 @@ #if NTLM else if (!strcmp(o->auth_method_string, "ntlm")) { - msg(M_FATAL, "ERROR: NTLM v1 support has been removed. For now= , you can use NTLM v2 by selecting ntlm2 but it is deprecated as well."); + msg(M_WARN, "NTLM v1 authentication has been removed in OpenVP= N 2.7. Will try to use NTLM v2 authentication."); + p->auth_method =3D HTTP_AUTH_NTLM2; } else if (!strcmp(o->auth_method_string, "ntlm2")) { @@ -531,7 +532,9 @@ } } - /* only basic and NTLM/NTLMv2 authentication supported so far */ + /* When basic or NTLMv2 authentication is requested, get credentials n= ow. + * In case of "auto" negotiation credentials will be retrieved later o= nce + * we know whether we need any. */ if (p->auth_method =3D=3D HTTP_AUTH_BASIC || p->auth_method =3D=3D HTT= P_AUTH_NTLM2) { get_user_pass_http(p, true); @@ -644,7 +647,8 @@ =20 /* get user/pass if not previously given */ if (p->auth_method =3D=3D HTTP_AUTH_BASIC - || p->auth_method =3D=3D HTTP_AUTH_DIGEST) + || p->auth_method =3D=3D HTTP_AUTH_DIGEST + || p->auth_method =3D=3D HTTP_AUTH_NTLM2) { get_user_pass_http(p, false); } @@ -748,7 +752,7 @@ { processed =3D true; } - else if ((p->auth_method =3D=3D HTTP_AUTH_NTLM2) && !processed) /*= check for NTLM */ + else if (p->auth_method =3D=3D HTTP_AUTH_NTLM2 && !processed) /* c= heck for NTLM */ { #if NTLM /* look for the phase 2 response */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/500?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Iec74e88f86cd15328f993b6cdd0317ebda81563c Gerrit-Change-Number: 500 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --UFIk0foGpFQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

NTLM: when NTLMv1 is requested, try NTLMv2 ins=
tead

Commit 21910ebc2ee8a6138eb2af8d38056d2b94e59f9c removed
supp= ort for NTLMv1 authentication. This adjusts the
behavior for existing co= nfigurations that specify
"ntlm" keyword.

Do not error = out hard, instead just try to upgrade. This
should work fine in many cas= es and will avoid breaking
user configs unnecessarily on upgrade.
In addition it fixes an issue with the mentioned patch
where "auto= " wasn't working correctly for NTLM anymore.

Change-Id: Iec= 74e88f86cd15328f993b6cdd0317ebda81563c
Signed-off-by: Frank Lichtenheld = <frank@...2641...>
Acked-by: Arne Schwabe <arne-openvpn@...1830...= ...>
Message-Id: <20240118151242.12169-1-gert@...1296...>
UR= L: https://www.mail-archive.com/search?l=3Dmid&q=3D20240118151242.12169= -1-gert@...1296...
Signed-off-by: Gert Doering <gert@...1296...>---
M Changes.rst
M doc/man-sections/proxy-options.rst
M src/ope= nvpn/proxy.c
3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/Changes.rst b/Changes.rst
index 69c811d..58= cb3db 100644
--- a/Changes.rst
+++ b/Change= s.rst
@@ -12,8 +12,13 @@
``--allow-dep= recated-insecure-static-crypto`` but will be removed in
= OpenVPN 2.8.

-NTLMv1 support has been removed because it is completely insecur= e.
- NTLMv2 support = is still available, but will removed in a future release.
+NTLMv1 authentication support for HTT= P proxies has been removed.
+ This is considered an insecure method of authentication that us= es
+ obsolete cryp= to algorithms.
+ N= TLMv2 support is still available, but will be removed in a future+ release.
+ When configured to authenticate = with NTLMv1 (``ntlm`` keyword in
+ ``--http-proxy``) OpenVPN will try NTLMv2 instead.<= br>

Overview of changes in 2.6
diff --git a/doc/man-sections/proxy-options.rst b/doc/man-sec= tions/proxy-options.rst
index ad49c60..38c4578 100644
--- a/doc/man-sections/proxy-options.rst
+++ b/d= oc/man-sections/proxy-options.rst
@@ -48,6 +48,8 @@<= br> </http-proxy-user-pass>

Note that support for NTLMv1 proxies was removed with OpenVPN 2.7.
+ :code:`ntlm` now is= an alias for :code:`ntlm2`; i.e. OpenVPN will always
+ attempt to use NTLMv2 authentication.

--http-proxy-user-pass userpass Overwrite the username/password information for ``--http-proxy``.= If specified
diff --git a/src/openvpn/proxy.c b/src/openvp= n/proxy.c
index e081532..2e8d7a8 100644
---= a/src/openvpn/proxy.c
+++ b/src/openvpn/proxy.c
= @@ -497,7 +497,7 @@
msg(M_FATAL, "HTTP_= PROXY: server not specified");
}
=
- ASSERT( o->po= rt);
+ ASSERT(o-&g= t;port);

ALLOC_OBJ_CLEAR(p, struct h= ttp_proxy_info);
p->options =3D *o;
@@ -517,7 +517,8 @@

#if NTLM
els= e if (!strcmp(o->auth_method_string, "ntlm"))
= {
- = msg(M_FATAL, "ERROR: NTLM v1 support has been removed. For now, you c= an use NTLM v2 by selecting ntlm2 but it is deprecated as well.");

+ msg(M_WARN,= "NTLM v1 authentication has been removed in OpenVPN 2.7. Will try to = use NTLM v2 authentication.");
+ p->auth_method =3D HTTP_AUTH_NTLM2; }
else if (!strcmp(o->auth_met= hod_string, "ntlm2"))
{
= @@ -531,7 +532,9 @@
}
}

- /* on= ly basic and NTLM/NTLMv2 authentication supported so far */
+ /* When basic or NTLMv2 authent= ication is requested, get credentials now.

+ * In case of "auto" negotiation crede= ntials will be retrieved later once
+ * we know whether we need any. */
= if (p->auth_method =3D=3D HTTP_AUTH_BASIC || p->auth_method =3D=3D H= TTP_AUTH_NTLM2)
{
get_user_pa= ss_http(p, true);
@@ -644,7 +647,8 @@

/* get user/pass if not previously given */
if (p->auth_method =3D=3D HTTP_AUTH_BASIC

- || p->auth_method =3D=3D HTTP_AU= TH_DIGEST)
+ |= | p->auth_method =3D=3D HTTP_AUTH_DIGEST
+ || p->auth_method =3D=3D HTTP_AUTH_NTLM2= )
{
get_user_pass_http(p, fal= se);
}
@@ -748,7 +752,7 @@
<= span> {
processed =3D true;
= }
- = else if ((p->auth_method =3D=3D HTTP_AUTH_NTLM2) && !processe= d) /* check for NTLM */
+ else if (p->auth_method =3D=3D HTTP_AUTH_NTLM2 && !p= rocessed) /* check for NTLM */
{
= #if NTLM
/* look for the phase 2 response */

To view, visit change 500. To unsubscribe, or= for help writing mail filters, visit settings.

<= /div>
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iec74e88f86cd15328f993b6cdd0= 317ebda81563c
Gerrit-Change-Number: 500
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--UFIk0foGpFQ=--