krb5: fix detecting channel binding feature

Use the already detected `gssapi/gssapi_krb5.h` MIT Kerberos header
to pull in `gssapi_ext.h`, which in turn sets `GSS_C_CHANNEL_BOUND_FLAG`
if supported. Channel binding is present in MIT Kerberos 1.19+.

Also:
- lib: de-duplicate GSS-API header includes.
- vauth: de-duplicate `urldata.h` includes.
- drop interim feature macro in favor of the native GSS one.

Assisted-by: Max Faxälv
Reported-by: Max Faxälv
Bug: https://github.com/curl/curl/pull/19164#issuecomment-3551687025
Follow-up to 8616e5aada #19164
Closes #19603
Closes #19760
This commit is contained in:
Viktor Szakats 2025-11-29 15:23:58 +01:00
parent dabfae84f0
commit 4aed2dcc89
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
18 changed files with 13 additions and 56 deletions

View file

@ -120,7 +120,7 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn,
neg_ctx->sslContext = conn->sslContext;
#endif
/* Check if the connection is using SSL and get the channel binding data */
#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING
#ifdef GSS_C_CHANNEL_BOUND_FLAG
#ifdef USE_SSL
curlx_dyn_init(&neg_ctx->channel_binding_data, SSL_CB_MAX_SIZE + 1);
if(Curl_conn_is_ssl(conn, FIRSTSOCKET)) {
@ -134,13 +134,13 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn,
#else
curlx_dyn_init(&neg_ctx->channel_binding_data, 1);
#endif /* USE_SSL */
#endif /* CURL_GSSAPI_HAS_CHANNEL_BINDING */
#endif /* GSS_C_CHANNEL_BOUND_FLAG */
/* Initialize the security context and decode our challenge */
result = Curl_auth_decode_spnego_message(data, userp, passwdp, service,
host, header, neg_ctx);
#ifdef CURL_GSSAPI_HAS_CHANNEL_BINDING
#ifdef GSS_C_CHANNEL_BOUND_FLAG
curlx_dyn_free(&neg_ctx->channel_binding_data);
#endif