spnego: add --disable-negotiate-ntlm compile-time option

Add configure and CMake options to define CURL_DISABLE_NEGOTIATE_NTLM,
which gates the NTLM blocking logic in the SSPI and GSS-API SPNEGO
code paths behind a compile-time flag.

Add a 'SPNEGO-no-NTLM' feature string to curl --version output and
gate the SPNEGO NTLM blocking tests on the negotiate-ntlm-disabled
feature.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
This commit is contained in:
Matthew John Cheetham 2026-04-14 14:11:00 +01:00
parent 3ea51e7a1f
commit 0267a63dc0
11 changed files with 48 additions and 0 deletions

View file

@ -30,6 +30,7 @@ SPNEGO skips auth when NTLM blocked by CURL_DISABLE_NEGOTIATE_NTLM
<features>
GSS-API
Debug
negotiate-ntlm-disabled
</features>
<setenv>
CURL_STUB_GSS_CREDS="NTLM_Alice"

View file

@ -42,6 +42,7 @@ SPNEGO with Kerberos still works when built with CURL_DISABLE_NEGOTIATE_NTLM
<features>
GSS-API
Debug
negotiate-ntlm-disabled
</features>
<setenv>
CURL_STUB_GSS_CREDS="KRB5_Alice"

View file

@ -690,6 +690,8 @@ sub checksystemfeatures {
$feature{"Kerberos"} = $feat =~ /Kerberos/i;
# SPNEGO enabled
$feature{"SPNEGO"} = $feat =~ /SPNEGO/i;
# SPNEGO NTLM disabled (compile-time)
$feature{"negotiate-ntlm-disabled"} = $feat =~ /SPNEGO-no-NTLM/i;
# TLS-SRP enabled
$feature{"TLS-SRP"} = $feat =~ /TLS-SRP/i;
# PSL enabled