Skip to content

spnego_sspi: honor CURLOPT_GSSAPI_DELEGATION on Windows SSPI builds#21528

Closed
xsgao-github wants to merge 1 commit into
curl:masterfrom
xsgao-github:master
Closed

spnego_sspi: honor CURLOPT_GSSAPI_DELEGATION on Windows SSPI builds#21528
xsgao-github wants to merge 1 commit into
curl:masterfrom
xsgao-github:master

Conversation

@xsgao-github
Copy link
Copy Markdown
Contributor

@xsgao-github xsgao-github commented May 7, 2026

What

This PR aims to make CURLOPT_GSSAPI_DELEGATION effective on Windows builds that use SSPI (instead of a native GSS-API implementation), so Kerberos delegation can be requested during SPNEGO/Negotiate authentication.

Fix

Store CURLOPT_GSSAPI_DELEGATION in data->set.gssapi_delegation on SSPI builds by extending existing HAVE_GSSAPI compile guards.
Request SSPI delegation in InitializeSecurityContext() when delegation is enabled.

Tests

Add unit test unit3302 to verify the option value is stored/masked correctly.

Closes #2859

@github-actions github-actions Bot added the tests label May 7, 2026
@testclutch
Copy link
Copy Markdown

Analysis of PR #21528 at b7d4c901:

Test 3302 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 2 different CI jobs (the link just goes to one of them).

Generated by Testclutch

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make CURLOPT_GSSAPI_DELEGATION effective on Windows builds that use SSPI (instead of a native GSS-API implementation), so Kerberos delegation can be requested during SPNEGO/Negotiate authentication.

Changes:

  • Store CURLOPT_GSSAPI_DELEGATION in data->set.gssapi_delegation on SSPI builds by extending existing HAVE_GSSAPI compile guards.
  • Request SSPI delegation in InitializeSecurityContext() when delegation is enabled.
  • Add unit test unit3302 + test case test3302 to verify the option value is stored/masked correctly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/unit3302.c New unit test verifying CURLOPT_GSSAPI_DELEGATION stores/masks flags correctly.
tests/unit/Makefile.inc Registers unit3302.c in the unit test build.
tests/data/test3302 Adds a test definition for the new unit test.
tests/data/Makefile.am Registers test3302 in the test cases list.
lib/vauth/spnego_sspi.c Adds SSPI InitializeSecurityContext() request flags for delegation.
lib/urldata.h Makes UserDefined.gssapi_delegation available on SSPI builds.
lib/setopt.c Enables the CURLOPT_GSSAPI_DELEGATION setopt handler on SSPI builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/vauth/spnego_sspi.c Outdated
@xsgao-github xsgao-github force-pushed the master branch 3 times, most recently from 2a20da4 to 47f100f Compare May 9, 2026 16:00
Comment thread tests/unit/unit3302.c Outdated
@vszakats
Copy link
Copy Markdown
Member

vszakats commented May 11, 2026

IMO a more human-readable non-LLM generated commit message would improve this patch.

…ws builds that use SSPI (instead of a native GSS-API implementation), so Kerberos delegation can be requested during SPNEGO/Negotiate authentication.

Changes:

Store CURLOPT_GSSAPI_DELEGATION in data->set.gssapi_delegation on SSPI builds by extending existing HAVE_GSSAPI compile guards.
Request SSPI delegation in InitializeSecurityContext() when delegation is enabled.
Add unit test unit3302 + test case test3302 to verify the option value is stored/masked correctly.
@bagder bagder closed this in cc6777d May 12, 2026
@bagder
Copy link
Copy Markdown
Member

bagder commented May 12, 2026

thanks!

outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Make CURLOPT_GSSAPI_DELEGATION effective on Windows builds that use SSPI
(instead of a native GSS-API implementation), so Kerberos delegation can
be requested during SPNEGO/Negotiate authentication.

Closes curl#21528
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

Kerberos unconstrained delegation doesn't work

5 participants