Use TLS channel binding in Negotiate authentication - #68317
Merged
DeagleGross merged 3 commits intoAug 13, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the Negotiate authentication handler to forward the TLS endpoint channel binding token (CBT) into managed NegotiateAuthentication so that NTLM/Kerberos over HTTPS can be cryptographically bound to the underlying TLS channel, and ensures the CBT’s lifetime is preserved across multi-round handshakes.
Changes:
- Pass
ITlsConnectionFeatureendpoint CBT bytes into the connection-scoped Negotiate state at creation time. - Introduce an owned
ChannelBindingimplementation (NegotiateChannelBinding) and ensure it is disposed with the Negotiate state. - Add/extend tests to validate CBT forwarding, fallback behavior when CBT is unavailable, and reuse across multi-round exchanges.
Show a summary per file
| File | Description |
|---|---|
| src/Security/Authentication/Negotiate/src/NegotiateHandler.cs | Reads TLS endpoint CBT (when available) and passes it into state creation. |
| src/Security/Authentication/Negotiate/src/Internal/INegotiateStateFactory.cs | Extends the factory contract to accept a CBT payload. |
| src/Security/Authentication/Negotiate/src/Internal/NegotiateStateFactory.cs | Forwards CBT into NegotiateState. |
| src/Security/Authentication/Negotiate/src/Internal/NegotiateState.cs | Creates NegotiateAuthentication with a ChannelBinding and owns/disposes it. |
| src/Security/Authentication/Negotiate/src/Internal/NegotiateChannelBinding.cs | New owned ChannelBinding implementation that copies CBT bytes into unmanaged memory. |
| src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs | Adds tests for CBT behavior and extends the test connection to expose TLS feature behavior. |
| src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateChannelBindingTests.cs | New unit test verifying CBT bytes are copied/owned by NegotiateChannelBinding. |
| src/Security/Authentication/Negotiate/test/Negotiate.Test/EventTests.cs | Updates the test factory implementation for the new CBT-aware signature. |
Review details
Tip
Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Lite
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
BrennanConroy
approved these changes
Aug 12, 2026
Youssef1313
approved these changes
Aug 12, 2026
Youssef1313
left a comment
Member
There was a problem hiding this comment.
Only reviewed the last commit. Previous commits previously approved by @BrennanConroy.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NegotiateAuthenticationcontextsResolves #68315