Skip to content

Fix SSPI acceptor credentials - #857

Merged
Tess Gauthier (tgauth) merged 1 commit into
PowerShell:latestw_allfrom
chapeltech:sspi-acceptor-credentials
Jul 24, 2026
Merged

Tess Gauthier (tgauth) merged 1 commit into
PowerShell:latestw_allfrom
chapeltech:sspi-acceptor-credentials

Conversation

@elric1

Copy link
Copy Markdown

PR Summary

Fix the Windows SSPI shim when GSSAPIStrictAcceptorCheck is disabled.

PR Context

In that mode sshd passes GSS_C_NO_CREDENTIAL to gss_accept_sec_context(), which should mean "use the default acceptor credential"; the shim instead dereferenced it as a real credential handle.

Copilot AI review requested due to automatic review settings June 22, 2026 17:51

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes the Windows SSPI GSSAPI shim’s handling of GSS_C_NO_CREDENTIAL in gss_accept_sec_context() so that, when GSSAPIStrictAcceptorCheck is disabled, the server can accept contexts using the default inbound acceptor credentials instead of dereferencing a null credential handle.

Changes:

  • Detect acceptor_cred_handle == GSS_C_NO_CREDENTIAL and obtain a default inbound SSPI credential handle.
  • Use the selected credential handle (default vs supplied) when calling AcceptSecurityContext().

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

Comment thread contrib/win32/win32compat/gss-sspi.c Resolved
@elric1

Roland C. Dowdeswell (elric1) commented Jun 22, 2026 •

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="The Old Chapel Technology, Ltd"

@tgauth

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@tgauth Tess Gauthier (tgauth) left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Roland C. Dowdeswell (@elric1), thanks! This looks good. My only suggestion would be to create a helper for this, since it's similarly duplicated for the outbound case on lines 540-546, but I'm also willing to take it as-is.

@elric1

Copy link
Copy Markdown
Author

I've refactored it as you requested.

@tgauth

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@tgauth
Tess Gauthier (tgauth) merged commit 41d8351 into PowerShell:latestw_all Jul 24, 2026
8 checks passed
@elric1
Roland C. Dowdeswell (elric1) deleted the sspi-acceptor-credentials branch July 24, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants