fix(dgw): correct CredSSP credential injection for RDCleanPath #1668
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.
Fixes several issues in the RDCleanPath credential injection flow:
Used wrong public key for client-side CredSSP: was using target server's public key instead of gateway's own public key. When performing credential injection, the client performs CredSSP authentication against the gateway.
Hardcoded HYBRID_EX security protocol regardless of client support: now properly negotiates based on what the client actually advertises.
Global cache for gateway public key only stored one entry: if multiple TLS acceptors with different certificates existed, wrong key could be returned. Now uses per-acceptor caching keyed by config pointer.
Missing
intercept_connect_confirmcall: the Connect Initial PDU wasn't being intercepted to update the server_selected_protocol field, causing protocol mismatch issues.Token mismatch not verified: credential entry token wasn't compared against the received cleanpath PDU token.
Redundant authorization:
handle_with_credential_injectionwas re-authorizing the token whenprocess_cleanpathalready does it. Now reuses claims fromprocess_cleanpath.Unused
_credential_storeparameter inprocess_cleanpath.TLS utilities (
extract_tls_server_public_key,GetPeerCert,get_cached_gateway_public_key) moved from rdp_proxy.rs to tls.rs.Unnecessary
Sync + 'staticbounds on async stream types reduced to justSend.Replaced
#[allow(...)]with#[expect(...)]for suppressions.Simplified
NetworkClientstruct intosend_network_requestfunction.Various error handling improvements using
.context()instead ofanyhow::anyhow!().Updated sspi-rs with important fixes.
Changelog: ignore