fix(credssp): server side CresSSP + SPNEGO + NTLM#689
Merged
Conversation
Co-authored-by: Ki Hyun Park <justkihyun1998@gmail.com>
b618a27 to
1b8b24c
Compare
Benoît Cortier (CBenoit)
approved these changes
Jun 17, 2026
Benoît Cortier (CBenoit)
left a comment
Member
There was a problem hiding this comment.
LGTM! Thank you for the initial research Ki Hyun Park (@kihyun1998)
There was a problem hiding this comment.
Pull request overview
This PR reworks the CredSSP server-side negotiation flow to correctly handle SPNEGO+NTLM (with mechListMIC) by allowing the server to return the acceptor’s final SPNEGO token and defer pubKeyAuth to the following leg, matching CredSspClient behavior and Windows RDP servers. It also adds a regression test to cover the previously-unexercised Negotiate+NTLM pairing.
Changes:
- Add a server-side intermediate
PubKeyInfostate to support a two-legmechListMIC-then-pubKeyAuthexchange. - Extract server
pubKeyAuthdecrypt/encrypt logic into a helper to avoid duplication. - Add
credssp_negotiate_ntlmclient↔server test to pin the 4-step handshake flow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/credssp/mod.rs |
Updates CredSSP server state machine to support an additional leg for SPNEGO+NTLM MIC completion before pubKeyAuth. |
tests/sspi/client_server/credssp.rs |
Adds a regression test covering Negotiate-mode with NTLM pinned, ensuring the handshake converges. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+668
to
+672
| } else { | ||
| ts_request.nego_tokens = Some(output_token.remove(0).buffer); | ||
|
|
||
| self.state = CredSspState::AuthInfo; | ||
| self.state = CredSspState::PubKeyInfo; | ||
| } |
| .as_ref() | ||
| .unwrap() | ||
| .peer_version | ||
| .expect("an decrypt public key server function cannot be fired without any incoming TSRequest"); |
Ki Hyun Park (kihyun1998)
added a commit
to kihyun1998/sspi-rs
that referenced
this pull request
Jun 18, 2026
The tests/sspi/client_server module is gated on all(network_client, __test-data), but no test-matrix row enabled __test-data, so the client<->server pairing tests (credssp_ntlm, credssp_kerberos, and the credssp_negotiate_ntlm regression test merged in Devolutions#689) never ran in CI. That gap is how Devolutions#687 shipped unnoticed. This adds __test-data to the three root-manifest matrix rows. The suite is hermetic (KdcMock / NetworkClientMock, no real network).
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.
Hi,
This PR fixes the same problem as #688. I rework the fix. See this comment for more details: #688 (comment)
closes #687