From: "cron2 (Code Review)" Date: Sat, 30 Dec 2023 15:22:35 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="bPD9NxE/uB0="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: configure: allow to disable NTLM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --bPD9NxE/uB0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#4) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/378?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by plaisthos Change subject: configure: allow to disable NTLM ...................................................................... configure: allow to disable NTLM Since we want to get rid of it, might be useful to allow users to remove the support completely. Change-Id: I199f83e2db5fc7c48a0ac9280cdbf9fa45f42300 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Message-Id: <20231230143817.4880-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27= 863.html Signed-off-by: Gert Doering --- M config.h.cmake.in M configure.ac M src/openvpn/options.c M src/openvpn/proxy.c M src/openvpn/syshead.h 5 files changed, 17 insertions(+), 5 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/78/378/4 diff --git a/config.h.cmake.in b/config.h.cmake.in index 6c846f2..2cdfdcc 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -35,6 +35,9 @@ /* Enable LZO compression library */ #cmakedefine ENABLE_LZO =20 +/* Enable NTLMv2 proxy support */ +#define ENABLE_NTLM 1 + /* Enable management server capability */ #define ENABLE_MANAGEMENT 1 diff --git a/configure.ac b/configure.ac index 2823f04..22ed448 100644 --- a/configure.ac +++ b/configure.ac @@ -95,6 +95,13 @@ ) AC_ARG_ENABLE( + [ntlm], + [AS_HELP_STRING([--disable-ntlm], [disable NTLMv2 proxy support @<:@defau= lt=3Dyes@:>@])], + , + [enable_ntlm=3D"yes"] +) + +AC_ARG_ENABLE( [plugins], [AS_HELP_STRING([--disable-plugins], [disable plug-in support @<:@default= =3Dyes@:>@])], , @@ -1302,6 +1309,7 @@ test "${enable_fragment}" =3D "yes" && AC_DEFINE([ENABLE_FRAGMENT], [1], [= Enable internal fragmentation support]) test "${enable_port_share}" =3D "yes" && AC_DEFINE([ENABLE_PORT_SHARE], [1= ], [Enable TCP Server port sharing]) +test "${enable_ntlm}" =3D "yes" && AC_DEFINE([ENABLE_NTLM], [1], [Enable N= TLMv2 proxy support]) test "${enable_crypto_ofb_cfb}" =3D "yes" && AC_DEFINE([ENABLE_OFB_CFB_MOD= E], [1], [Enable OFB and CFB cipher modes]) if test "${have_export_keying_material}" =3D "yes"; then AC_DEFINE( diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 1521872..4c00353 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -6755,8 +6755,7 @@ if (p[3]) { /* auto -- try to figure out proxy addr, port, and type automa= tically */ - /* semiauto -- given proxy addr:port, try to figure out type a= utomatically */ - /* (auto|semiauto)-nct -- disable proxy auth cleartext protoco= ls (i.e. basic auth) */ + /* auto-nct -- disable proxy auth cleartext protocols (i.e. ba= sic auth) */ if (streq(p[3], "auto")) { ho->auth_retry =3D PAR_ALL; diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c index 76e27cb..3b6f7df 100644 --- a/src/openvpn/proxy.c +++ b/src/openvpn/proxy.c @@ -638,8 +638,6 @@ { struct gc_arena gc =3D gc_new(); char buf[512]; - char buf2[129]; - char get[80]; int status; int nparms; bool ret =3D false; @@ -758,6 +756,7 @@ { #if NTLM /* look for the phase 2 response */ + char buf2[129]; while (true) { @@ -768,7 +767,8 @@ chomp(buf); msg(D_PROXY, "HTTP proxy returned: '%s'", buf); - openvpn_snprintf(get, sizeof get, "%%*s NTLM %%%ds", (int)= sizeof(buf2) - 1); + char get[80]; + openvpn_snprintf(get, sizeof(get), "%%*s NTLM %%%zus", siz= eof(buf2) - 1); nparms =3D sscanf(buf, get, buf2); buf2[128] =3D 0; /* we only need the beginning - ensure it= 's null terminated. */ diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index 7181b94..a021c91 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -472,7 +472,9 @@ /* * Should we include NTLM proxy functionality */ +#ifdef ENABLE_NTLM #define NTLM 1 +#endif /* * Should we include proxy digest auth functionality -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/378?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: I199f83e2db5fc7c48a0ac9280cdbf9fa45f42300 Gerrit-Change-Number: 378 Gerrit-PatchSet: 4 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --bPD9NxE/uB0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #4 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outda= ted and were removed: Code-Review+2 by plaisthos

configure: allow to disable NTLM

Since we= want to get rid of it, might be useful to
allow users to remove the sup= port completely.

Change-Id: I199f83e2db5fc7c48a0ac9280cdbf9fa45f4230= 0
Signed-off-by: Frank Lichtenheld <frank@...2641...>
Acked-by:= Arne Schwabe <arne-openvpn@...1227...>
Message-Id: <2023123014= 3817.4880-1-gert@...1296...>
URL: https://www.mail-archive.com/openvp= n-devel@lists.sourceforge.net/msg27863.html
Signed-off-by: Gert Doering = <gert@...1296...>
---
M config.h.cmake.in
M configure.ac
= M src/openvpn/options.c
M src/openvpn/proxy.c
M src/openvpn/syshead.h=
5 files changed, 17 insertions(+), 5 deletions(-)

git pull ss=
h://gerrit.openvpn.net:29418/openvpn refs/changes/78/378/4
diff --=
git a/config.h.cmake.in b/config.h.cmake.in
index 6c846f2..= 2cdfdcc 100644
--- a/config.h.cmake.in
+++ = b/config.h.cmake.in
@@ -35,6 +35,9 @@
/* E= nable LZO compression library */
#cmakedefine ENABLE_LZO

+/* = Enable NTLMv2 proxy support */
+#define ENABLE_NTLM 1
+
/* Enable management server capability */
#define ENABLE_MANAGEMENT 1

diff --git a/configure.ac b/configure.ac

index 2823f04..2= 2ed448 100644
--- a/configure.ac
+++ b/conf= igure.ac
@@ -95,6 +95,13 @@
)

AC_ARG_ENABLE(
+ [ntlm],
+ [AS_HELP_STRING([--disable-ntlm], [disable NTLMv2 proxy support @&l= t;:@default=3Dyes@:>@])],
+ ,
+ [enable= _ntlm=3D"yes"]
+)
+
+AC_ARG_ENABLE(
= [plugins],
[AS_HELP_STRING([--disable-plugins], [disable= plug-in support @<:@default=3Dyes@:>@])],
,=
@@ -1302,6 +1309,7 @@
test "${enable_fragme= nt}" =3D "yes" && AC_DEFINE([ENABLE_FRAGMENT], [1], = [Enable internal fragmentation support])
test "${enab= le_port_share}" =3D "yes" && AC_DEFINE([ENABLE_PORT_= SHARE], [1], [Enable TCP Server port sharing])

= +test "${enable_ntlm}"= ; =3D "yes" && AC_DEFINE([ENABLE_NTLM], [1], [Enable NTLM= v2 proxy support])
test "${enable_crypto_ofb_cfb}&quo= t; =3D "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [En= able OFB and CFB cipher modes])
if test "${have_expor= t_keying_material}" =3D "yes"; then
AC_DEF= INE(
diff --git a/src/openvpn/options.c b/src/openvpn/optio= ns.c
index 1521872..4c00353 100644
--- a/sr= c/openvpn/options.c
+++ b/src/openvpn/options.c
<= span>@@ -6755,8 +6755,7 @@
if (p[3])
{
/* auto -- try to figure out pro= xy addr, port, and type automatically */
- /* semiauto -- given proxy addr:port, try to= figure out type automatically */
- /* (auto|semiauto)-nct -- disable proxy auth cleart= ext protocols (i.e. basic auth) */
+ /* auto-nct -- disable proxy auth cleartext prot= ocols (i.e. basic auth) */
if (streq(p[3], &qu= ot;auto"))
{
= ho->auth_retry =3D PAR_ALL;
diff --git a/src/openvp= n/proxy.c b/src/openvpn/proxy.c
index 76e27cb..3b6f7df 1006= 44
--- a/src/openvpn/proxy.c
+++ b/src/open= vpn/proxy.c
@@ -638,8 +638,6 @@
{ struct gc_arena gc =3D gc_new();
char buf= [512];
- char buf2[1= 29];
- char get[80];=
int status;
int nparms; bool ret =3D false;
@@ -758,6 +756,7 @@=
{
#if NTLM
= /* look for the phase 2 response */
+ char buf2[129];

while (true)
{
@@ -768,7 +767,8 @@
chomp(buf); msg(D_PROXY, "HTTP proxy returned: '%s= 9;", buf);

- openvpn_snprintf(get, sizeof get, "%%*s NT= LM %%%ds", (int) sizeof(buf2) - 1);
+ char get[80];
+ openvpn_snprintf(get, sizeof= (get), "%%*s NTLM %%%zus", sizeof(buf2) - 1);
= nparms =3D sscanf(buf, get, buf2);
= buf2[128] =3D 0; /* we only need the beginning - ensure it's nul= l terminated. */

diff --git a/src/openvpn= /syshead.h b/src/openvpn/syshead.h
index 7181b94..a021c91 1= 00644
--- a/src/openvpn/syshead.h
+++ b/src= /openvpn/syshead.h
@@ -472,7 +472,9 @@
/*<= /span>
* Should we include NTLM proxy functionality
*/

+#ifdef ENAB= LE_NTLM
#define NTLM 1
+#endif

/*
= * Should we include proxy digest auth functionality

To view, visit change 378. To unsubscribe, or for help writ= ing mail filters, visit sett= ings.

<= link itemprop=3D"url" href=3D"http://gerrit.openvpn.net/c/openvpn/+/378?usp= =3Demail"/>
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I199f83e2db5fc7c48a0ac9280cd= bf9fa45f42300
Gerrit-Change-Number: 378
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--bPD9NxE/uB0=--