From: "cron2 (Code Review)" Date: Sat, 30 Dec 2023 15:22:37 +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="rUU8oOxa9a4="; 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 Cc: plaisthos , openvpn-devel --rUU8oOxa9a4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/37= 8?usp=3Demail ) 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(-) 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 +/* 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: merged --rUU8oOxa9a4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

configure: allow to disable NTLM

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

Change-Id: I199f83e2db5fc7c48a0ac9280cdbf9fa45f42= 300
Signed-off-by: Frank Lichtenheld <frank@...2641...>
Acked-b= y: Arne Schwabe <arne-openvpn@...1227...>
Message-Id: <20231230= 143817.4880-1-gert@...1296...>
URL: https://www.mail-archive.com/open= vpn-devel@lists.sourceforge.net/msg27863.html
Signed-off-by: Gert Doerin= g <gert@...1296...>
---
M config.h.cmake.in
M configure.acM src/openvpn/options.c
M src/openvpn/proxy.c
M src/openvpn/syshead= .h
5 files changed, 17 insertions(+), 5 deletions(-)

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 @@
<= span> /* Enable LZO compression library */
#cmakedefine EN= ABLE_LZO

+/* Enable NTLMv2 proxy support */
+#define ENABLE_NTLM 1
+
/* Enable management server capabi= lity */
#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 s= upport @<:@default=3Dyes@:>@])],
+ ,
+ [enable_ntlm=3D"yes"]
+)
+
+AC_ARG_ENABLE(<= br> [plugins],
[AS_HELP_STRING([--disable-plugins]= , [disable plug-in support @<:@default=3Dyes@:>@])],
= ,
@@ -1302,6 +1309,7 @@
test "${ena= ble_fragment}" =3D "yes" && AC_DEFINE([ENABLE_FRAGME= NT], [1], [Enable internal fragmentation support])
test &q= uot;${enable_port_share}" =3D "yes" && AC_DEFINE([EN= ABLE_PORT_SHARE], [1], [Enable TCP Server port sharing])
<= /span>
+test "${enable_= ntlm}" =3D "yes" && AC_DEFINE([ENABLE_NTLM], [1], [E= nable NTLMv2 proxy support])
test "${enable_crypto_of= b_cfb}" =3D "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE]= , [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/ope= nvpn/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 figu= re out proxy addr, port, and type automatically */
- /* semiauto -- given proxy addr:po= rt, try to figure out type automatically */
- /* (auto|semiauto)-nct -- disable proxy a= uth cleartext protocols (i.e. basic auth) */
+ /* auto-nct -- disable proxy auth clea= rtext protocols (i.e. basic 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..3b= 6f7df 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];
- c= har buf2[129];
- cha= r 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, &qu= ot;%%*s NTLM %%%ds", (int) sizeof(buf2) - 1);
+ char get[80];
+ openvpn_snprintf(g= et, 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 null terminated. */

diff --git a/s= rc/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

/*<= /span>
* Should we include proxy digest auth functionality

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

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: merged
--rUU8oOxa9a4=--