Skip to content

Commit

Permalink
configure: allow to disable NTLM
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Arne Schwabe <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg27863.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
flichtenheld authored and cron2 committed Dec 30, 2023
1 parent 1396072 commit 1da3496
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ AC_ARG_ENABLE(
[enable_x509_alt_username="no"]
)

AC_ARG_ENABLE(
[ntlm],
[AS_HELP_STRING([--disable-ntlm], [disable NTLMv2 proxy support @<:@default=yes@:>@])],
,
[enable_ntlm="yes"]
)

AC_ARG_ENABLE(
[plugins],
[AS_HELP_STRING([--disable-plugins], [disable plug-in support @<:@default=yes@:>@])],
Expand Down Expand Up @@ -1302,6 +1309,7 @@ test "${enable_small}" = "yes" && AC_DEFINE([ENABLE_SMALL], [1], [Enable smaller
test "${enable_fragment}" = "yes" && AC_DEFINE([ENABLE_FRAGMENT], [1], [Enable internal fragmentation support])
test "${enable_port_share}" = "yes" && AC_DEFINE([ENABLE_PORT_SHARE], [1], [Enable TCP Server port sharing])

test "${enable_ntlm}" = "yes" && AC_DEFINE([ENABLE_NTLM], [1], [Enable NTLMv2 proxy support])
test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes])
if test "${have_export_keying_material}" = "yes"; then
AC_DEFINE(
Expand Down
3 changes: 1 addition & 2 deletions src/openvpn/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -6755,8 +6755,7 @@ add_option(struct options *options,
if (p[3])
{
/* auto -- try to figure out proxy addr, port, and type automatically */
/* semiauto -- given proxy addr:port, try to figure out type automatically */
/* (auto|semiauto)-nct -- disable proxy auth cleartext protocols (i.e. basic auth) */
/* auto-nct -- disable proxy auth cleartext protocols (i.e. basic auth) */
if (streq(p[3], "auto"))
{
ho->auth_retry = PAR_ALL;
Expand Down
6 changes: 3 additions & 3 deletions src/openvpn/proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,6 @@ establish_http_proxy_passthru(struct http_proxy_info *p,
{
struct gc_arena gc = gc_new();
char buf[512];
char buf2[129];
char get[80];
int status;
int nparms;
bool ret = false;
Expand Down Expand Up @@ -758,6 +756,7 @@ establish_http_proxy_passthru(struct http_proxy_info *p,
{
#if NTLM
/* look for the phase 2 response */
char buf2[129];

while (true)
{
Expand All @@ -768,7 +767,8 @@ establish_http_proxy_passthru(struct http_proxy_info *p,
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", sizeof(buf2) - 1);
nparms = sscanf(buf, get, buf2);
buf2[128] = 0; /* we only need the beginning - ensure it's null terminated. */

Expand Down
2 changes: 2 additions & 0 deletions src/openvpn/syshead.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,9 @@ socket_defined(const socket_descriptor_t sd)
/*
* Should we include NTLM proxy functionality
*/
#ifdef ENABLE_NTLM
#define NTLM 1
#endif

/*
* Should we include proxy digest auth functionality
Expand Down

0 comments on commit 1da3496

Please sign in to comment.