fix(pam-rdp): stable acceptor certificate - #376
Conversation
The acceptor generated a fresh self-signed certificate per session. mstsc opens a second connection after the user accepts the certificate dialog and compares the certificate it receives against the one just approved, so a per-session cert never matched and it aborted the second handshake with "an unexpected server authentication certificate was received from the remote computer". Generate it once per process instead. Also adds the logging that made this diagnosable: the crate depended on tracing but nothing installed a subscriber, so every event from the bridge and IronRDP was discarded and failures surfaced as a bare status code. The Rust error string now reaches Go and zerolog instead of a static sentinel. sspi is pinned to info in the default filter regardless of LOG_LEVEL; it logs serialized TSCredentials, which contain the injected password in cleartext, at debug and below.
|
💬 Discussion in Slack: #pr-review-cli-376-fix-pam-rdp-stable-acceptor-certificate Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
|
| Filename | Overview |
|---|---|
| packages/pam/handlers/rdp/native/src/bridge.rs | Reuses internally consistent TLS certificate and CredSSP public-key material across process-local RDP sessions and adds protocol timing diagnostics. |
| packages/pam/handlers/rdp/native/src/ffi.rs | Stores session failure details and exposes a bounded, UTF-8-safe C ABI accessor whose lifecycle matches the Go wait-before-free contract. |
| packages/pam/handlers/rdp/bridge_cgo_shared.go | Retrieves Rust failure details before freeing the bridge and adds contextual session-failure logging. |
| packages/pam/handlers/rdp/native/src/logging.rs | Installs an idempotent tracing subscriber and prevents ordinary LOG_LEVEL changes from enabling credential-bearing SSPI debug output. |
| packages/pam/handlers/rdp/native/Cargo.toml | Adds the pure-Rust tracing subscriber dependency with a restricted feature set. |
| packages/pam/handlers/rdp/native/include/rdp_bridge.h | Extends the bridge ABI with the bounded last-session-error retrieval contract. |
Reviews (1): Last reviewed commit: "fix(pam-rdp): stable acceptor certificat..." | Re-trigger Greptile
The RDP acceptor generated a fresh self-signed certificate per session, so mstsc's second connection saw a different cert than the one the user had just approved and aborted the handshake.