gss-api: stub gss_inquire_context for debug builds

The GSS-API debug stub did not implement gss_inquire_context, so
the NTLM-detection logic in spnego_gssapi.c could not be exercised
without a real Kerberos environment.

Add stub_gss_inquire_context that returns the NTLMSSP OID when the
stub context is in NTLM mode and the Kerberos OID otherwise. Wrap it
behind Curl_gss_inquire_context so the stub is transparently
selected when CURL_STUB_GSS_CREDS is set.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
This commit is contained in:
Matthew John Cheetham 2026-03-23 14:10:46 +00:00
parent e16ac344de
commit 8f21383178
3 changed files with 66 additions and 4 deletions

View file

@ -248,9 +248,9 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
OM_uint32 inquire_major, inquire_minor;
gss_OID mech_type = GSS_C_NO_OID;
inquire_major = gss_inquire_context(&inquire_minor, nego->context,
NULL, NULL, NULL, &mech_type,
NULL, NULL, NULL);
inquire_major = Curl_gss_inquire_context(&inquire_minor,
nego->context,
&mech_type);
if(!GSS_ERROR(inquire_major) && mech_type &&
mech_type->length == ntlmssp_oid.length &&
!memcmp(mech_type->elements, ntlmssp_oid.elements,