mirror of
https://github.com/Devolutions/IronRDP.git
synced 2026-11-23 00:14:10 +00:00
master
130 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0eb2d9d6b7 |
feat: add RDP session replay web component stack (#1216)
Add browser playback of recorded RDP sessions through a protocol-agnostic Svelte player, an RDP WASM backend, and a demo with local-file and HTTP range data sources. Consumers provide the recordings; this does not add a recording mechanism. Replay requires post-decryption Fast-Path captures. The HTTP demo validates its index and bounds range requests and playback fetches. --------- Co-authored-by: Marc-André Moreau <mamoreau@devolutions.net> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> |
||
|
|
f96f664abf |
build(deps): bump the patch group across 1 directory with 2 updates (#2373)
Bumps the patch group with 2 updates in the / directory: [yuv](https://github.com/awxkee/yuvutils-rs) and [log](https://github.com/rust-lang/log). Updates `yuv` from 0.8.19 to 0.8.20 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/awxkee/yuvutils-rs/releases">yuv's releases</a>.</em></p> <blockquote> <h2>0.8.20</h2> <h2>What's Changed</h2> <ul> <li>Exact 8-bit widening in the SSE and AVX2 YUV to RGB paths by <a href="https://github.com/vlad-salone"><code>@vlad-salone</code></a> in <a href="https://redirect.github.com/awxkee/yuvutils-rs/pull/145">awxkee/yuvutils-rs#145</a></li> <li>Fix remained expanding, bump version by <a href="https://github.com/awxkee"><code>@awxkee</code></a> in <a href="https://redirect.github.com/awxkee/yuvutils-rs/pull/147">awxkee/yuvutils-rs#147</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/vlad-salone"><code>@vlad-salone</code></a> made their first contribution in <a href="https://redirect.github.com/awxkee/yuvutils-rs/pull/145">awxkee/yuvutils-rs#145</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/awxkee/yuvutils-rs/compare/0.8.19...0.8.20">https://github.com/awxkee/yuvutils-rs/compare/0.8.19...0.8.20</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/awxkee/yuvutils-rs/commit/c7ad0daa5e73390a6c6690da6d6842b0b957fee2"><code>c7ad0da</code></a> Merge pull request <a href="https://redirect.github.com/awxkee/yuvutils-rs/issues/147">#147</a> from awxkee/dev9_26</li> <li><a href="https://github.com/awxkee/yuvutils-rs/commit/e74610383603672f14279875389ba679201985ff"><code>e746103</code></a> Fix remained expanding, bump version</li> <li><a href="https://github.com/awxkee/yuvutils-rs/commit/f51f5654407250520f9a0ff30a62dd11afc91a0b"><code>f51f565</code></a> Merge pull request <a href="https://redirect.github.com/awxkee/yuvutils-rs/issues/145">#145</a> from vlad-salone/fix/exact-8bit-widening</li> <li><a href="https://github.com/awxkee/yuvutils-rs/commit/3c1b42ea3b646ab85e8b787713cac087235d5d49"><code>3c1b42e</code></a> Exact 8-bit widening in the SSE and AVX2 YUV to RGB paths</li> <li>See full diff in <a href="https://github.com/awxkee/yuvutils-rs/compare/0.8.19...0.8.20">compare view</a></li> </ul> </details> <br /> Updates `log` from 0.4.34 to 0.4.35 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/rust-lang/log/releases">log's releases</a>.</em></p> <blockquote> <h2>v0.4.35</h2> <p>This release doesn't include source changes. It verifies <code>log</code>'s new CI/CD processes.</p> <h3>Other</h3> <ul> <li>rework CI/CD to align with Rust project standards</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-lang/log/blob/main/CHANGELOG.md">log's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/rust-lang/log/compare/v0.4.34...v0.4.35">0.4.35</a> - 2026-10-30</h2> <p>This release doesn't include source changes. It verifies <code>log</code>'s new CI/CD processes.</p> <h3>Other</h3> <ul> <li>rework CI/CD to align with Rust project standards</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/rust-lang/log/commit/a46450ba763280c29d35b53aa8ad0ff1fc1d78d0"><code>a46450b</code></a> Update CHANGELOG.md</li> <li><a href="https://github.com/rust-lang/log/commit/a715f17690f2a95872fd13f23547f3acdf3655e9"><code>a715f17</code></a> chore: release v0.4.35</li> <li><a href="https://github.com/rust-lang/log/commit/b4e2b1277ec9e490e7c269635300f94ba2740bcd"><code>b4e2b12</code></a> Merge pull request <a href="https://redirect.github.com/rust-lang/log/issues/747">#747</a> from rust-lang/chore/release-plz-mgnt</li> <li><a href="https://github.com/rust-lang/log/commit/6b490b69c202a3b5d03411a492834e8f626b6335"><code>6b490b6</code></a> run fmt</li> <li><a href="https://github.com/rust-lang/log/commit/2c7fd52b74c064abccf0d29b8a89fa20fc046d7e"><code>2c7fd52</code></a> simplify some crate release tasks for easier automation</li> <li><a href="https://github.com/rust-lang/log/commit/5bc5545f5f0e01615da3893b658ec9e5c2b1bcdc"><code>5bc5545</code></a> Merge pull request <a href="https://redirect.github.com/rust-lang/log/issues/745">#745</a> from marcoienibot/release-plz-disable-semver-check</li> <li><a href="https://github.com/rust-lang/log/commit/4234b8c4985a409d6be755c63795b9f0c5a20741"><code>4234b8c</code></a> Disable release-plz semver check</li> <li><a href="https://github.com/rust-lang/log/commit/95918fffe6e0ceb7b275db2625977d8e15b3ce58"><code>95918ff</code></a> Merge pull request <a href="https://redirect.github.com/rust-lang/log/issues/744">#744</a> from Kobzol/trusted-publishing</li> <li><a href="https://github.com/rust-lang/log/commit/e7ed747e69f3e3d2400e33b4dc7767eadfbaf302"><code>e7ed747</code></a> Fix Zizmor lints</li> <li><a href="https://github.com/rust-lang/log/commit/e87a3c6b1a2b2ae8866da0d0d282e468a1fba40a"><code>e87a3c6</code></a> Setup trusted publishing</li> <li>Additional commits viewable in <a href="https://github.com/rust-lang/log/compare/0.4.34...v0.4.35">compare view</a></li> </ul> </details> <br /> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
b9bd944276 |
feat: add MS-RDPEPNP Plug and Play device redirection (#2318)
Adds [MS-RDPEPNP] Plug and Play device redirection: the `PNPDR` and
`FileRedirectorChannel` dynamic virtual channels, client side.
## New crate: `ironrdp-rdpepnp`
- `no_std` + `alloc`, no I/O.
- Encode/decode for every message on both channels (PNP_INFO and the
server/client I/O packets, including custom events).
- `PnpInfoClient` (`PNPDR`): version exchange, announces the configured
devices on Server Logon, and supports adding or removing devices later
in the session.
- `FileRedirectorListener`: one processor per `FileRedirectorChannel`
instance (one per server file handle). CreateFile is refused for devices
that were never announced. Read, Write, IOControl and cancel requests go
to an embedder-supplied `PnpBackend` / `PnpFile`.
- Each request gets a completion handle that sends exactly one reply,
from any thread. A dropped handle replies `E_ABORT`, and a reply larger
than the request allows becomes `ERROR_INSUFFICIENT_BUFFER`.
- Protocol violations (duplicate request ID, unknown function ID)
disable that channel instance instead of returning an error, because a
processor error ends the whole RDP session.
## Client wiring
`ironrdp-client` gets a `pnp` feature (part of `all`) and
`ConfigBuilder::with_pnp_redirection(PnpConfig { devices, backend })`.
Replies that complete later go through the session input queue.
## Tests
- 36 tests in `ironrdp-testsuite-core`: the spec's sample bytes from
sections 4.1–4.4 plus the client state machines against a mock backend,
each citing its spec section.
- Fuzz decode and round-trip oracles for the new PDUs.
## Not covered
- There is no native backend. Embedders implement `PnpBackend`, and the
README says so.
- Not tested against a live Windows server.
- Late replies use the bounded input queue, so a full queue drops the
reply and the server's request stays pending (logged). Camera and
WebAuthn replies have the same limitation.
[MS-RDPEPNP]:
https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpepnp/
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
fbf2599863 |
feat(client): add MS-RDPECI core input dynamic channel (#2319)
Add the ironrdp-rdpeci crate with the MS-RDPECI PDUs and a client processor for the Microsoft::Windows::RDS::CoreInput dynamic channel. Input events reuse the fast-path input event type, since MS-RDPECI packs events in the same format. The client can opt in with the `core-input` feature and ChannelConfig::core_input. Once the server opens the channel and selects version 1.0, keyboard and mouse input is sent over it; otherwise input stays on fast-path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
5dd64fb8d0 |
feat: add MS-RDPET telemetry virtual channel (#2320)
Adds [MS-RDPET] (Remote Desktop Protocol: Telemetry Virtual Channel Extension). Servers that advertise the `Microsoft::Windows::RDS::Telemetry` DVC use the client's connection timing report to measure logon and first-frame latency. ## New crate: `ironrdp-rdpet` - `pdu::TelemetryPdu`: encodes and decodes RDP_TELEMETRY_PDU (§2.2.1). Decoding rejects an Id other than 0x01 and a Length other than 0x12. - `client::TelemetryClient`: a DVC processor. `send_report` encodes the report for the open channel and returns an error when the channel is not open. Any data the server sends on the channel is logged and ignored, because the spec defines no server-to-client message. - `no_std` + `alloc`. The crate does no I/O and reads no clock. Version 0.1.0, `release = false` in release-plz.toml. ## `ironrdp-client` wiring - New `telemetry` feature, included in `all` but not on by default, plus a `ChannelConfig::telemetry` option (off by default like the location channel; enable with `with_telemetry(true)`). - Measures time from the start of each connection attempt to two milestones: - EGFX channel opened. - First EGFX message received. CapsConfirm is the first EGFX message (MS-RDPEGFX §1.7). - Sends one report per connection, in a session-loop iteration that has no other DVC batch to send, and never in the iteration that opens the telemetry channel (so it follows that channel's DRDYNVC Create Response). - Both credential-prompt fields are 0 because the client never prompts interactively, as the spec requires in that case. - A connection without EGFX sends no report, which the spec allows (§3.2.5.1). ## Tests - `ironrdp-testsuite-core/tests/rdpet`: wire layout, rejection of a wrong Id, wrong Length or truncated PDU, channel name, client send and no-send (MS-RDPET §2.1, §2.2.1). - `ironrdp-testsuite-extra/tests/client/telemetry.rs`: the report state machine — milestone timing, ordering after the channel's Create Response, waiting for an iteration without another batch, one report per connection, and a property test against a reference model over arbitrary iteration sequences. - The PDU is also added to the fuzzing oracles (decode and round trip). ## Not tested - No run against a live Windows server: neither the end-to-end report delivery nor the client milestone timing was checked against a real server. - No test builds a live session, so the session-loop call site and the mapping from session state to observations are marked `UNTESTED:`. - Locally, `cargo xtask ci` passed fmt, typos, tests, lints and the feature matrix, and the lockfile and public-deps checks pass. The run stopped at the WASM check because `wasm2wat` is missing on this machine, so that check and the fuzz and web steps after it did not run locally. CI covers them. - No server processor yet: it is deferred until `ironrdp-server` can register it. The `ironrdp` meta crate does not re-export the crate. [MS-RDPET]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpet/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
bbd1b879ce |
feat: add the MS-RDPEMSC mouse cursor dynamic channel (#2321)
Implements [MS-RDPEMSC] (the `Microsoft::Windows::RDS::MouseCursor` dynamic channel) and connects it to the client's existing pointer handling. The channel is **off by default** because it hasn't been run against a real Windows or AVD server yet. With it off, the client declines the channel as before, and pointer updates stay on the fast path. To turn it on, call `ConfigBuilder::with_mouse_cursor_channel(true)`: ```rust let builder = builder.with_mouse_cursor_channel(true); ``` You can also set `ChannelConfig::mouse_cursor = true` directly. ## New crate: `ironrdp-rdpemsc` - **PDUs** (`no_std`): encode and decode for the capability advertise, capability confirm and pointer update messages. - TS_POINTERATTRIBUTE and TS_LARGEPOINTERATTRIBUTE have the same byte layout as in MS-RDPBCGR, so the update payloads reuse the codecs in `ironrdp_pdu::pointer`. - `PointerUpdate::as_pointer_update_data()` converts an update into the existing `PointerUpdateData`. - Encoding a version 1 capability set that carries data returns an error, matching what the decoder accepts. - **`MouseCursorClient`**: sends the version 1 capabilities when the channel starts, and becomes ready only when the server confirms version 1. - Pointer updates are queued for the caller, up to 64 of them. Updates that arrive before the confirmation are queued too. - When the queue is full, it first drops updates that a later one replaces: older positions, older visible-pointer changes, and older shapes for the same cache slot. Applying what's left gives the same position, visible pointer and pointer cache. The oldest update is dropped only if the queue still holds a shape for 64 different cache slots; the client advertises 32. - Unexpected or malformed messages are logged and ignored. - **`MouseCursorServer`**: when the client advertises version 1, it replies with a version 1 confirmation and becomes ready. It is not wired into `ironrdp-server` yet. ## Wiring - `ironrdp-session`: new `ActiveStage::process_pointer_update(image, PointerUpdateData)`. It uses the same pointer cache, server-pointer setting and software rendering as fast-path pointer updates. The update-to-output loop in `process` moved into a private helper that both paths share. The helper also widens the first graphics update to a full refresh after a graphics reset. - `ironrdp-client`: - New `ChannelConfig::mouse_cursor` field, `false` by default, set with `with_mouse_cursor_channel`. - When it is on, `rdp.rs` registers `MouseCursorClient` on the DRDYNVC client. - The new `mouse_cursor::present` applies the queued updates after each session loop iteration, the same way `video::present` does. When the channel isn't registered, it does nothing. - Also updated: fuzzing oracles (decode and round-trip), the `ARCHITECTURE.md` entry, and both lockfiles. ## Tests (`ironrdp-testsuite-core/tests/rdpemsc`) - Spec examples from §4.1.1, §4.1.2, §4.2.1 and §4.2.2. - Large pointer layout (§2.2.2.6), the optional pad byte, the hidden, default and cached updates, and capability size and signature checks, including the encode-side check. - Client and server behaviour: - the handshake, including that a confirmation of capabilities the client didn't advertise leaves it not ready; - ignoring unexpected messages, and reset on close. - The queue: - a cached update still finds a shape sent 64 updates earlier; - the oldest update is dropped only when every queued update is a shape for a different cache slot; - a property test checks that the queued updates leave the same pointer state as all received updates. - Through `ActiveStage`: a cached pointer gives the same image as the shape that filled its slot, and position updates are applied. - A proptest round trip that also checks `encode` writes exactly `size()` bytes. ## Not tested - I haven't run it against a real Windows or AVD server, which is why it is off by default. - `mouse_cursor::present` in the client has no test of its own. The pieces on either side (client queueing and `ActiveStage::process_pointer_update`) are tested. - Locally, `cargo xtask ci` passed fmt, typos, tests, clippy, the feature matrix, dependencies, captures and the WASM build. It stopped at `wasm2wat`, which isn't installed. The fuzz step (needs `cargo-fuzz` on nightly) and the web step (npm) didn't run. `cargo xtask check locks` passes. - The Soft-Sync comment in `crates/ironrdp-dvc/src/client.rs` still names MouseCursor as a declined channel. I left it alone because the MS-RDPECI change touches the same line. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
35066e86bb |
feat: add the MS-RDPETXT text input virtual channel (#2317)
Adds `ironrdp-rdpetxt`, an implementation of [MS-RDPETXT] (Text Input Virtual Channel Extension), and wires its client side into `ironrdp-client`. The crate encodes and decodes every RDPTXT PDU: 34 server-to-client and 29 client-to-server PDUs on `TextInput_ServerToClientDVC` and `TextInput_ClientToServerDVC`. The `pdu` module builds without `std`. A reply never travels on the channel its request arrived on, so each side shares one state between its two DVC processors, and the session drains queued PDUs through `pending_messages` on the sending channel, as `ironrdp-rdpevor` does. Decoding reads exactly the size the header announces and ignores trailing fields that later minor versions append (section 1.7). `client::TextInputClient` answers the version exchange, sends the acknowledgements the specification asks of a client, tracks the focused remote edit control, and inserts committed text into it. It hosts no input method, so it neither composes text nor undoes and replays key events after an update collision. `server::TextInputServer` announces the server version and hands client PDUs to a `TextInputServerHandler`. `ironrdp-client` gains an opt-in `text-input` feature, a `ChannelConfig::text_input` setting (off by default), and an `RdpInputEvent::CommitText` event. The fuzzing oracles decode and round-trip both PDU enums. Tests in `ironrdp-testsuite-core` cite spec sections and cover byte layouts, sizes, trailing fields, property-based round trips, the client acknowledgement rules, multi-PDU messages, `commit_text`, and the server version announcement. Not verified: no run against a live Windows host. Replies queued while another DVC batch occupies a session iteration wait for a later iteration, which no test checks. The viewer has no IME integration yet. Locally, the `ironrdp-server` e2e tests in `integration_tests_extra` failed and hung on CredSSP connection resets, the same way in a sibling worktree without this change. `wasm check` stopped because `wasm2wat` is not installed, and the fuzz and web steps were not run. [MS-RDPETXT]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpetxt/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8301ee04d3 |
feat: add MultiPoint audio level and drive letter persistence channels (#2322)
Implements [MS-RDPADRV] (Audio Level and Drive Letter Persistence Virtual Channel Extension), which Windows MultiPoint Server uses to have the client remember the session's master volume levels and the drive letters assigned to redirected USB storage, and restore them on the next connection. ## New crate `ironrdp-rdpadrv` A core-tier (`no_std` + alloc, no I/O) crate for the two dynamic virtual channels: - `WMSAud` (`AudioLevelPdu`): `SAE_Started`, `SAE_VolumeChange` (data flow, `f32` volume, mute) and `SAE_RemoteConnect`. - `WMSDL` (`DriveLetterPdu`): `SADLE_Started` and `SADLE_SerializedCache`, a list of `NAME_DATA` / `VALUE_DATA` registry-style pairs. The decoder checks both markers and that `cbMessageData` matches `cbNameValueData`, and ignores the spec's trailing "Unused" bytes. - Client processors (`AudioLevelClient`, `DriveLetterClient`): they store what the server reports and answer `Started` / `RemoteConnect` with the stored values, render before capture (§3.1.5). With nothing stored they send no answer, and they never send unprompted. - Server processors (`AudioLevelServer`, `DriveLetterServer`): they open the protocol (`Started`, or `RemoteConnect` for a reconnect), give the values the client restores to a handler, and build change reports. ## Client wiring `ironrdp-client` gains a `multipoint` feature (included in `all`, and forwarded by `ironrdp` as `client-multipoint`): - `ChannelConfig::multipoint` / `Config::with_multipoint_settings` take a shared `MultipointSettings` handle. - `build_connector` seeds both processors from it on every connection, so auto-reconnects restore the latest values. - Each reported change updates the settings and emits `RdpOutputEvent::MultipointSettingsChanged` through `OutputEventSender::defer`, so the embedder can save them. `ironrdp-viewer` matches `RdpOutputEvent` exhaustively and builds with `client-all`, so it gets a log-only arm. ## Tests - `ironrdp-testsuite-core/tests/rdpadrv`: wire layouts with spec section citations, rejection cases (unknown data flow, mismatched cache sizes), the client answering rules, server loopback, and proptest round-trips. - `ironrdp-client` unit tests: a reported value is saved and restored by the next connection. - Fuzzing: decode and round-trip oracles for both PDUs. ## Notes for reviewers - The spec calls `NAME_DATA.cchName` both a byte length and a count of WCHARs. The codec treats it as bytes, matching the field definition. No Windows binary that implements WMSAud or WMSDL was available to check against. - §3.1.5 says a client must not redirect USB mass storage before the drive letter protocol initializes. That gating against `rdpeusb` is not enforced. It is documented on `ChannelConfig::multipoint` and left as a follow-up. - The crate starts at 0.0.0 without `publish = false`, because the published `ironrdp-client` depends on it (`ironrdp-rdpel` precedent). - Volume levels are only persisted. They are not applied to local `rdpsnd` playback. ## Not tested - No live MultiPoint server: the behavior is verified only against the spec through unit, loopback and fuzz tests. - Locally, `cargo xtask ci` passed fmt, typos, tests, lints, the feature matrix, dependencies, captures and fuzz. - `wasm check` stopped because `wasm2wat` is not installed on this machine. - `web check` failed Prettier on 52 web-client files this PR does not touch, which looks like Windows line endings. - One `testsuite-extra` e2e test (`an_auto_reconnect_cookie_the_embedder_issues_invalidates_the_previous_one`) hung once in the full run, then passed alone and in a full rerun of the suite. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
24ecb8ee30 |
feat: add Windows 365 desktop switch, device redirection and Entra sign-in DVCs (#2292)
Windows 365 Cloud PCs open several dynamic virtual channels that no Microsoft Open Specification documents and that IronRDP declined, so the features behind them did nothing. This adds client support for five of them, following the Windows App 2.0.1485.0 client. The new ironrdp-w365 crate implements four of them. Its vdcswitch module implements Microsoft::Windows::RDS::VirtualDesktopControl::Switch, which Boot and Switch mode use to send the user back to the local desktop and to open local Windows Settings pages, such as Bluetooth pairing, on the physical device. The client sends a version request carrying the launch URI that advertises supported local actions, answers switch-to-local and switch-to-cloud requests, and accepts local actions only once version 2 is negotiated. A caller-supplied VdcSwitchHandler decides what each request means on the host. An unsupported server version leaves the channel inert rather than failing the session. The crate also implements three device redirection channels: - Microsoft::Windows::RDS::BatteryStatusRedirection sends the local battery state, percentage and remaining minutes, paced by the server's echo of what it currently shows. - Microsoft::Windows::RDS::PowerRequestRedirection reports whether the Cloud PC holds power requests, so the client can keep the device and display awake. - Microsoft::Windows::RDS::ScreenCaptureRedirection uploads PNG or JPEG screen captures and reports where the server saved them. The crate does no I/O: readings and captures come from the embedder, and server events reach it through handler traits. The battery client asks its handler for a reading whenever a new channel becomes ready, and the power request client reports the requests as released when the channel closes. ironrdp-client wires all four behind the w365 feature, which joins its `all` set and is exposed as client-w365 on the ironrdp crate. The switch channel is registered when ChannelConfig::virtual_desktop_switch holds a launch URI; the other three each have their own ChannelConfig switch, off by default. Requests and server events are forwarded as RdpOutputEvent variants, and RdpInputEvent gains SwitchToCloud, BatteryStatus and UploadScreenCapture. Because the channel handlers run synchronously inside the session loop, they defer their events on the output sender, and the loop delivers them in order with backpressure instead of dropping them when the output queue is full. The battery channel is not registered in RemoteApp sessions, matching Windows App. ironrdp-client also implements Microsoft::Windows::RDS::InteractiveEntraAuth, through which a session host asks for a fresh Entra sign-in during the session; Windows App leaves it off by default. The client runs TLS inside the channel, reads the host's Entra device ID from its certificate, and raises RdpOutputEvent::InteractiveEntraAuthRequested. The embedder answers with an EntraAuthSession for that device and the tenant's Entra P2P root certificates. The client checks that the token is for that device and that the host certificate was issued by one of those roots, then runs the RDS AAD exchange inside TLS, reusing ironrdp-connector's RDS AAD helpers, which become public. It is off by default and enabled with ConfigBuilder::with_interactive_entra_auth behind the entra-auth feature. ironrdp-w365 is publishable at 0.1.0 so that ironrdp-client can depend on it. It is new, which trusted publishing cannot create, so release-plz skips it until it is published by hand once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
376eb8f566 |
feat: support Remote Credential Guard over RDPEAR (#2256)
Remote Credential Guard redirects Kerberos and NTLMv2 operations over the `Microsoft::Windows::RDS::AuthRedirection` dynamic virtual channel (MS-RDPEAR) so TGT keys and password hashes remain client-owned instead of delegating credentials through CredSSP `TSTicketCreds`. Add `ironrdp-rdpear` with `no_std`/`alloc` outer envelope framing, strict ASN.1 DER `TSRemoteGuardInnerPacket` codecs, and portable NDR32 type-serialization codecs for all 23 MS-RDPEAR Kerberos and NTLM request/response calls under both the published IDL profile and the Windows-native wire profile. Bound inbound static and dynamic channel reassembly before fragment retention via `SvcProcessor::max_message_size`, `DvcProcessor::max_message_size`, and `DrdynvcClient::with_max_transport_message_size`. Wire the opt-in `remote-guard` feature through `ironrdp-connector`, the async/blocking/Tokio drivers, `ironrdp-cfg`, `ironrdp-client`, `ironrdp-daemon`, and `ironrdp-agent` (`--remote-guard` and `ironrdp_remote_guard` with `Disabled`, `Negotiate`, `Ntlm`, and `Kerberos` modes) backed by `sspi` 0.23.1. RCG requires `HYBRID` or `HYBRID_EX` with `REDIRECTED_AUTHENTICATION_MODE_SUPPORTED`, strict TLS validation, and a completed CredSSP context handoff, and omits passwords, smart-card PINs, and auto-reconnect cookies from Client Info. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> |
||
|
|
b13befa0db | chore(release): prepare for publishing (#2259) | ||
|
|
e899a82611 |
chore(release): prepare for publishing (#2212)
Co-authored-by: Benoît CORTIER <git.divisible626@passmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
52476f3cee |
feat(egfx): persistent bitmap cache, RemoteFX and Alpha (#2194)
The graphics pipeline client dropped RemoteFX (RDPGFX_CODECID_CAVIDEO)
and Alpha (RDPGFX_CODECID_ALPHA) commands into on_unhandled_pdu, and it
never offered a persistent bitmap cache, so every reconnect waited for
the server to upload tiles mstsc already had.
Persistent cache (MS-RDPEGFX 3.3.1.5): the embedder supplies a
PersistentCacheStore through
GraphicsPipelineClient::with_persistent_cache. Right after
CapabilitiesConfirm the client sends a CacheImportOffer with the stored
keys, capped at 5461 entries and at the slot count and byte size of the
confirmed cache (16 MB and 4096 slots with SMALL_CACHE, THINCLIENT or
version 10.3, otherwise 100 MB and 25600). Entries over 64 KiB are
neither offered nor saved, matching mstsc, which never offers a larger
one. The limits read CodecCapabilities::small_cache, which already
reports that rule, and the compositor's cache cap uses the same
constants as the offer. The CacheImportReply loads the accepted entries
into the assigned one-based slots; invalid slots, unsolicited replies
and malformed entries are skipped. Imported tiles behave like
SurfaceToCache tiles: they survive ResetGraphics, go with
EvictCacheEntry, and count against the compositor budget. When the
channel closes, the cache is saved back most recently used first; an
empty cache does not overwrite the store. A client-initiated protocol
reset saves the cache before discarding it and offers it again once the
reset is confirmed. No file I/O lives in the core crates.
ironrdp-client implements the store as one file in the format of mstsc's
CacheNNNN.bin files, which FreeRDP also uses ("RDP8bmp\0", version 6,
then key, width, height and BGRA pixels per entry), so a cache file
moves between the three clients. It was checked against mstscax.dll's
CacheFileReader, CacheImportOffer and CacheExport, and a real mstsc
Cache0000.bin (6430 entries) lists and loads. Entries mstsc would refuse
(key 0, over 64 KiB) are never written. The file (FilePersistentCache,
written to an owner-only temporary and renamed into place, and read with
FILE_SHARE_DELETE on Windows so another session can replace it),
configured through ChannelConfig::egfx_persistent_cache or
ConfigBuilder::with_egfx_persistent_cache. The cache is off by default,
unlike mstsc, whose BitmapPersistenceEnabled property defaults to 1
(mstscax.dll's property table), so desktop pixels are never written to
disk unless asked for; the .rdp key bitmapcachepersistenable:i:1 selects
a per-user default file and :i:0 turns it off. The ActiveX control
implements AdvancedSettings.BitmapPeristence (previously E_NOTIMPL),
defaulting to 0 (unlike mstscax.dll) and reading any non-zero value as
on; it feeds bitmapcachepersistenable to the client on both connect
paths and through the modern RDP property API. The viewer gains
--egfx-cache <PATH>.
RemoteFX: ironrdp-graphics gains rfx::TileDecoder and
rfx::MessageDecoder. The parser returns every frame of a payload, each
with exactly one region followed by one tileset, keeps tiles encoded,
caps a message at 65,536 tiles (the largest surface the compositor
allocates) and rejects a tileset whose entropy algorithm differs from
the stream's TS_RFX_CONTEXT. Each region is normalized into disjoint
rectangles, so overlapping rectangles paint a pixel once; tiles are
placed relative to destRect and clipped to the region, destRect and the
surface, and only visible tiles are decoded. The session's RemoteFX path
now uses the same TileDecoder, which also rejects a tile naming a
missing quantization table instead of panicking.
Alpha: ironrdp-graphics gains alpha::decode for the raw and RLE variants
of ALPHACODEC_BITMAP_STREAM. It hands runs to a callback instead of
allocating the destination area, and the compositor writes them into the
clipped surface, replacing only the alpha channel (3.3.5.1); the handler
receives the composited pixels.
New fuzz targets egfx_alpha_decode and egfx_rfx_decode cover both
parsers.
The legacy bitmap cache (BitmapCacheRev2/3 with PersistentKeyList) is
not part of this change: the legacy path advertises no drawing orders,
so it has nothing that could use the cache.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
45b67591e9 |
feat!: compressed audio over AUDIO_PLAYBACK_DVC (#2203)
Windows 8 and later servers stream audio over the AUDIO_PLAYBACK_DVC and AUDIO_PLAYBACK_LOSSY_DVC dynamic channels, preferring AAC or ADPCM on constrained links, but IronRDP declined those channels and could only play PCM and Opus. Wave Confirm PDUs echoed the server timestamp, playback dropped audio when its fixed 500 ms ring filled, and devices could not be chosen. - `ironrdp-rdpsnd` gains a pure `codec` module (PCM, G.711 A-law and µ-law, IMA and Microsoft ADPCM decoders and encoders, bit-exact with the Windows ACM codecs), an `RdpsndDvc` processor whose `RdpsndDvcState` lets both dynamic channels share one negotiation (Windows negotiates on the reliable channel and sends AAC on the lossy one), the UDP Wave datagrams, and a `playout` jitter-buffer policy. Wave Confirm PDUs report the hold time plus the handler's playback latency, and handlers pick the formats to advertise from the server's list. - The CPAL backend decodes every offered format it can, including AAC through Media Foundation on Windows, plays through the jitter buffer with a configurable latency target, reports buffered plus device latency, follows the default device or a selected one, and maps the server volume to the Windows audio session. Microphone capture encodes to PCM, G.711 or ADPCM and selects its device. - `ironrdp-client` registers the dynamic channels next to the static one on a shared backend and adds `AudioConfig` (`ironrdp_audiooutputdevice`, `ironrdp_audioinputdevice`, `ironrdp_audiolatency`); the viewer adds `--audio-output-device`, `--audio-input-device`, `--audio-latency` and `--list-audio-devices`. Breaking: `ironrdp_rdpsnd_native::cpal` no longer exposes `DecodeStream`, `PcmProducer` and `apply_volume`; use `RdpsndBackend` and `apply_gain`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c3dd17e607 |
fix(dvc): decompress the compressed data PDUs of DRDYNVC version 3 (#2173)
## Problem `DrdynvcClient` echoes the server's capabilities version. When a server offers version 3, the client therefore claims support for DYNVC_DATA_FIRST_COMPRESSED (0x06) and DYNVC_DATA_COMPRESSED (0x07), MS-RDPEDYC 2.2.3.3 and 2.2.3.4. It could not decode either: `DrdynvcServerPdu::decode` had no arm for them. A server that used them would break the DRDYNVC channel. ## Fix This PR implements version 3 rather than answering with version 2. The first commit downgraded the answer; the second replaces the downgrade with real support. - **`ironrdp-bulk`: new `rdp8` module.** An RDP 8.0 bulk decompressor (MS-RDPEGFX 3.1.9.1) that is `no_std` (alloc only) and has no dependencies. It accepts `PACKET_COMPR_TYPE_RDP8` (0x04) and `PACKET_COMPR_TYPE_RDP8_LITE` (0x06), the type DVC segments carry. It has two profiles. `Rdp8Decompressor::new()` is the graphics profile: a 2.5 MB history, 64 MiB per segment and 256 MiB per multipart message, matching the existing decoder. `Rdp8Decompressor::new_lite()` is the RDP 8.0 Lite profile defined in MS-RDPEDYC 2.2.3.3: an 8,192-byte history and maximum match distance, at most 8,192 uncompressed bytes per segment, and a single segment per message. The existing ZGFX decoder in `ironrdp-graphics` couldn't be reused: it needs `std` and `num-derive` (a proc-macro), which core-tier `ironrdp-dvc` cannot depend on, and it rejects 0x06. - **`ironrdp-dvc`: decode and reassemble.** New `DataFirstCompressedPdu` and `DataCompressedPdu` types, added to the `#[non_exhaustive]` `DrdynvcDataPdu`, decode on both the client and server side. `CompleteData` decompresses each block before reassembly, so one message can mix compressed and uncompressed blocks (MS-RDPEDYC 2.2.3). Each channel gets its own RDP 8.0 Lite decompression context (MS-RDPEDYC 3.1.5.2.5), created on the channel's first compressed block. A block that makes a message longer than its declared `Length` is now an error for both compressed and uncompressed data; before, the uncompressed path logged it and dropped the message. The `DataFirstCompressedPdu` and `DataCompressedPdu` constructors document the Lite payload format, so the graphics pipeline's RDP 8.0 output is not mistaken for a valid payload. - **Client capabilities.** A version 3 offer is answered with version 3 again. `DrdynvcServer` still offers version 2 and now tolerates compressed data from clients. ## Tests - **Spec samples:** the MS-RDPEDYC 4.3.3 and 4.3.4 sample PDUs decode and encode byte for byte (`dvc::data_compressed`). The client reassembles them into one message (`dvc::client`). The spec's samples decompress to 3,192 bytes while declaring 3,195, so the test supplies the last 3 bytes in an uncompressed DYNVC_DATA block. - **Per-channel history:** a test checks that one channel's compressed data cannot refer back to another channel's history. - **Length overruns:** tests check that a compressed first block, or a later uncompressed block, that runs past the declared `Length` is an error. - **Lite limits:** `ironrdp-bulk` unit tests check that the Lite profile rejects a match distance of 8,193 (accepted by RDP 8.0), keeps exactly the last 8,192 bytes of history, caps segments at 8,192 bytes, and rejects multipart messages. - **Against the EGFX decoder:** `bulk::rdp8_decodes_windows_egfx_captures` decodes the Windows ZGFX captures already in `ironrdp-graphics` and gets identical output. `bulk::rdp8_decodes_ironrdp_compressor_output` round-trips IronRDP's ZGFX compressor output, including multipart messages. - **Fuzzing:** a new `bulk_rdp8` fuzz target and `bulk_decompress_rdp8` oracle require that any input the graphics decoder accepts decodes identically with the new decompressor's RDP 8.0 profile. The same input also runs through the Lite profile. Regression seeds are under `test_data/fuzz_regression/bulk_decompress_rdp8`. A local run of 300,000 mutated captures and spec samples found no disagreement. - **Unit tests:** `ironrdp-bulk` unit tests cover literals, matches, raw byte runs, RDP 8.0 Lite, multipart messages, history carried across messages, and malformed input. ## Checks - **Tests:** `cargo test -p ironrdp-testsuite-core -p ironrdp-bulk` passes: 1897 and 154 tests. - **Format:** `cargo xtask check fmt -v` passes. - **Lints:** `cargo clippy -D warnings` is clean on `ironrdp-bulk`, `ironrdp-dvc`, `ironrdp-testsuite-core` and `ironrdp-fuzzing` (all targets), and on the `no_std` builds of `ironrdp-bulk` and `ironrdp-dvc`. `fuzz/` builds with the new target. The workspace-wide `cargo xtask check lints` could not finish locally because the `libopus_sys` build script fails on this machine. ## Not verified / follow-up - **Live server:** not tested against a live Windows server sending compressed DVC data. - **Duplicate decoder:** EGFX still uses its own decoder in `ironrdp-graphics`. Moving it onto `ironrdp_bulk::rdp8` would remove the duplication, but it is a performance-sensitive path and should come with benchmarks in a separate change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3c7f89eb00 |
feat(rdpeudp): log the RDP-UDP connection state machine (#2022)
- `ironrdp-rdpeudp` had no log statements, so an embedder running at trace saw nothing of the UDP transport. It now depends on `tracing` (the same line `ironrdp-dvc` uses) and logs the actions of the connection state machine and its components. - Levels follow STYLE.md: debug for the handshake (SYN, SYN+ACK and final ACK sent and received, version and MTU negotiated, handshake retransmits and their limit), connection establishment and close, and idle timeout; trace for everything per packet (data and ACKs sent and received, loss, retransmits, RTT and RTO updates, congestion and window changes, timers); debug for peer input that is ignored as invalid, like a rejected datagram; warn for encode failures that were previously dropped silently. - The PDU encoders and decoders stay log-free, like `ironrdp-pdu`. No payload contents are logged. - `handle_datagram` logs a rejected datagram in one place. |
||
|
|
21e33b242e |
feat(rdpemt): log the multitransport tunnel (#2024)
- `ironrdp-rdpemt` had no log statements. It now depends on `tracing` (the same line `ironrdp-dvc` uses) and the tunnel state machine logs its actions: create request and response queued, received and validated (debug), tunnel data sent and received (trace), and at warn a create request rejected (with whether the request id and the cookie matched, never the cookie itself), a rejected create response, a PDU that fails to decode and a PDU unexpected in the current state. - The PDU encoders and decoders stay log-free, like `ironrdp-pdu`. The error values returned are unchanged. |
||
|
|
501d1eb455 |
feat(fuzz): add egfx_surface_state state-machine oracle (#1337)
## Summary - Implements target 6 of #1316 (egfx fuzz-coverage umbrella): the `egfx_surface_state` state-machine oracle. Sibling of `egfx_multi_frame` (PR #1336) with two distinct properties. - **Narrowed PDU set**: a `SurfaceLifecyclePdu` enum containing the seven variants relevant to surface lifecycle (`ResetGraphics`, `CreateSurface`, `DeleteSurface`, `MapSurfaceToOutput`, `StartFrame`, `EndFrame`, `FrameAcknowledge`), concentrating fuzz pressure on the surface and frame state machine rather than spreading across all 23 `GfxPdu` variants. Two of the seven do not themselves affect modeled state: `FrameAcknowledge` has no arm in the client's receive path, included as legitimate hostile-server input; `StartFrame` is unmodeled since its state lives in private fields with no public getter. - **Parallel state-machine model**: an `ExpectedState` struct mirrors the client's documented per-surface fields (`id`, `width`, `height`, `pixel_format`, `is_mapped`, `output_origin_x/y`) plus the `total_frames_decoded` counter. For each successfully-encoded PDU the model is updated to mirror the client's `handle_*` transitions; after dispatch the client's observable state via the public `get_surface` and `total_frames_decoded` getters is asserted against the model. ## What this catches A different bug class from `egfx_multi_frame`'s panic / sanitizer oracle: logic bugs in state transitions that produce wrong but non-crashing observable state. Examples: - Client retains a surface after `DeleteSurface` (model removed it, client did not). - Client clobbers `is_mapped` on a surface that did not receive `MapSurfaceToOutput`. - Client fails to clear all surfaces on `ResetGraphics`. - Client increments `total_frames_decoded` on a PDU other than `EndFrame`. The model encodes the implementation's current documented behavior (e.g., `CreateSurface` with `width == 0` or `height == 0` is silently skipped per `handle_create_surface`, `total_frames_decoded` is incremented unconditionally by `handle_end_frame` even when no matching `StartFrame` preceded it). The oracle catches drift from that behavior. Spec-compliance verification is a separate concern. ## What this does NOT catch State transitions that exist only in private fields without a public getter (`current_frame_id`, `frames_queued`). Wiring observable access to those fields is a separate egfx-public-API change, out of scope here. ## Dependencies **This PR is stacked on PR #1336 (`egfx_multi_frame`, target 5) and must merge after it.** The `Arbitrary` cascade both harnesses need landed in #1334, so #1336 is the only remaining ancestor. Both branches are rebased onto current master and green. ## Validation - `cargo xtask check fmt/lints/tests/typos/locks` all pass. - `check_egfx_surface_state` regression-replay test passes against the seed-empty corpus entry. - 15-minute rigorous libFuzzer + ASan fuzz on the final SHA: **2,770,751 iterations in 901 seconds (~3,075 exec/s sustained), peak RSS 102 MB, zero panics, zero sanitizer reports, zero state-model assertion failures.** Corpus grew to ~1,840 entries. ## Notes - The narrowed `SurfaceLifecyclePdu` enum lives oracle-private inside the function (not exported from `ironrdp-egfx`), keeping the egfx public surface clean per the fallback shape from the design discussion on #1316. - The oracle uses `as _` imports for `Arbitrary` and `DvcProcessor` per clippy's `unused_trait_names` lint, matching the `egfx_multi_frame` style. - The `#[expect(clippy::panic, reason = ...)]` and `# Panics` doc section match the precedent from `bulk_round_trip` for assertion-based oracles. With this PR the #1316 umbrella has its initial six target slots filled (1 merged, 2+2b+3+5+6 open). Refs #1316. Depends on #1336. ## Rebase 2026-08-19 Rebased onto current master (was CONFLICTING after the RDPEUDP/RDPEMT series landed). Two conflicts, both purely additive insertions at the same point as unrelated new content master added: - `fuzz/Cargo.toml`: master added 8 new `[[bin]]` entries for the RDPEUDP/RDPEMT fuzz targets at the same list position as this PR's own `egfx_surface_state` entry. Resolved by keeping both sets. - `crates/ironrdp-fuzzing/src/oracles/mod.rs`: same shape, master's 8 new oracle functions plus this PR's own `egfx_surface_state` oracle, both appended at end of file. The automatic merge here needed a manual fix: it dropped the closing braces of master's last function (`rdpeudp_ack_vector`'s oracle), since git's diff3 alignment treated that closing syntax as shared trailing context and attached it only to this PR's block instead of both. Caught by diffing the resolved file against both source commits directly rather than trusting the merge; fixed, then re-verified byte-identical to both sources. No logic in the oracle or the state model changed, so the fuzz run and validation numbers above still describe the actual code; only the commit SHAs changed (rebase, no content edits beyond the two conflict resolutions). All checks re-run on the new head: `cargo xtask check fmt/lints/tests/typos/locks`, a direct `cargo check --all-targets` in the `fuzz/` workspace (not covered by the main gate), and `cargo xtask wasm check`, all green. `fuzz/Cargo.lock` unchanged. |
||
|
|
42320260a2 |
feat(fuzz)!: add egfx_zgfx_decompress oracle and harden the ZGFX decoder against attacker-controlled input (#1333)
## Summary - Implements target 3 of #1316 (egfx fuzz-coverage umbrella): `egfx_zgfx_decompress` oracle and target. - Target shape mirrors PR #1285's `bulk_*` pattern: panic plus sanitizer oracle on `Decompressor::decompress`, fresh decompressor per iteration so history state does not leak between fuzz inputs. - Ships alongside a complete input-validation audit of the ZGFX decoder, following PR #1271's precedent for "target plus the bugs it surfaces in one PR." ## Hardening Eight input-validation gaps closed in `ironrdp-graphics` (all class-(c) per #1314: reachable via attacker-controlled wire inputs). Each one was surfaced by a rigorous smoke-fuzz iteration: 1. `Bits::try_split_to` (new in `utils.rs`) provides the checked counterpart to `split_to` that every fix below builds on. 2. `SegmentedDataPdu::from_buffer` multipart segment-size: `split_at_checked` plus a defensive `Vec::with_capacity` cap mirroring PR #1271. 3. `decompress_segment` trailing-unused-bits subtraction: `checked_mul` + `checked_sub`. 4. `decompress_segment` token loop: checked prefix indexing + checked `split_to(8)` for the NullLiteral value. 5. `handle_match`: checked distance-bits split, `checked_add` for `distance_base + value`, plus `distance > HISTORY_SIZE` bound check. 6. `read_unencoded_bytes`: checked splits for the 15-bit length, pad-to-boundary, and `length * 8` payload. 7. `read_encoded_bytes`: checked splits + `usize::BITS` bound on `load_be::<usize>()` + `checked_shl` replacing `pow` + `checked_add` for `base + value`. 8. `FixedCircularBuffer::read_with_offset`: defense-in-depth `offset > buffer.len()` bound check below the caller-side guard. Plus memory-budget enforcement, which a match-copy chain makes necessary: it can expand a few bytes of input into unbounded output, and an unbounded run reached a 1.5 GB peak. 9. New `MAX_DECOMPRESSED_PER_SEGMENT = 64 MiB` ceiling on a single segment's decompressed output, enforced per-token in `decompress_segment` and threaded through the match-copy paths so it is checked before any allocation. **This is an implementation resource limit, not a wire requirement**, and the code says so, but MS-RDPEGFX 3.1.9.1.2 ("RDP 8.0 compressor limits") does supply a number: a compliant compressor MUST NOT produce any single segment past 65,535 uncompressed bytes. This crate's production compressor path honors that: `wrapper.rs`'s `wrap_compressed` panics above 65,535, and `compress_and_wrap_egfx`, the only production caller, falls back to uncompressed rather than risk exceeding it. The `compress_high_entropy_round_trips_and_bounds_table` test that an earlier revision of this PR body cited as evidence real traffic exceeds 65,535 does not show that: it calls `Compressor::compress` directly and feeds the result straight to `decompress_segment`, bypassing the wrapper every real sender uses. 64 MiB is still used here, not 65,535, because this ceiling exists to catch non-conforming or hostile input, not to police conforming input: a decoder that hard-rejects at exactly the compressor-side limit has no margin for a peer implementation with a minor, benign spec deviation. Same footing as the compositor's total-byte budget in #1460. 10. Multipart running-total check against the declared `uncompressedSize`, surfacing early detection of segments that collectively exceed the wire-declared bound. Unlike item 9 this one *is* spec-grounded: 2.2.5.1 defines `uncompressedSize` as the size of `segmentArray` once reassembled and decompressed, and 3.1.9.1.2.1 states it MUST equal the total number of decompressed bytes across all segments. The sender side is unchanged and already agreed with the spec: `ZGFX_SEGMENTED_MAXSIZE = 65535` in `wrapper.rs` splits into multipart above that, which is exactly the encoder-side behaviour 3.1.9.1.2.1 describes. Seven new `ZgfxError` variants total with matching Display and `Error::source` impl entries. ## Breaking change `ZgfxError` is a public exhaustive enum, so the seven added variants (`InvalidTrailingBitCount`, `SegmentSizeExceedsBuffer`, `IncompleteBitStream`, `MatchDistanceOutOfRange`, `LengthTokenSizeTooLarge`, `SegmentDecompressedSizeExceedsLimit`, `MultipartTotalExceedsDeclared`) break exhaustive matches downstream. Confirmed by `cargo semver-checks --baseline-rev <merge-base>`: seven `enum_variant_added` failures on `ironrdp-graphics`. Title carries `!` accordingly. ## Validation - `cargo xtask check fmt/lints/tests/typos/locks` all pass. - `check_egfx_zgfx_decompress` regression-replay passes against both shipped crash artifacts. - 46 existing ZGFX unit tests continue to pass against the hardened code. - Final 15-minute rigorous fuzz: 2,942,961 iterations in 901 seconds (~3,266 exec/s sustained), peak RSS 84 MB, zero panics, zero sanitizer reports, zero OOMs. Iterative audit progression on a 15-minute libFuzzer + ASan budget per round: - Round 1 (no fixes): crash at iter ~30 (trailing-bit underflow) - Round 2 (after fixes 1-2): crash at iter ~28 (bit-budget) - Round 3 (after F1-F8 audit): OOM at iter ~9877 (1.5 GB peak) - Round 4 (after F1-F10 complete): clean ## Notes - Crash artifacts for the two header-parse bugs added to `crates/ironrdp-testsuite-core/test_data/fuzz_regression/egfx_zgfx_decompress/`. The later-round crashes are not added as separate regression entries because the libFuzzer corpus accumulated 161 representative inputs and the unit-tested error paths cover the cases directly. - The MS-RDPEGFX 3.1.9.1.2 ("RDP 8.0 compressor limits") per-segment bound is a semantic change: inputs that previously decoded to more than 65,535 bytes per segment now return `Err`. Such inputs were never spec-conformant. Codebase precedent (PR #1097 et seq.) is to add `ZgfxError` variants without a `!` marker on the commit; following that convention. - Memory-budget design discussion lives on #1120 (`issuecomment-4558356535`) rather than in this PR body so future readers find the rationale on the canonical fuzz-umbrella thread. Refs #1316. ## Note on the fuzz numbers above The iteration counts and the 84 MB peak RSS were measured while the per-segment cap was 65,535. Raising it to 64 MiB does not change what the oracle exercises, but those figures describe the earlier revision rather than what ships here. ## Rebase 2026-08-19 Rebased onto current master (was CONFLICTING after the RDPEUDP/RDPEMT series landed). Two conflicts, both purely additive insertions colliding with unrelated new master content at the same point: - `fuzz/Cargo.toml`: master's 8 new RDPEUDP/RDPEMT `[[bin]]` entries plus this PR's own `egfx_zgfx_decompress` entry, both kept. - `crates/ironrdp-fuzzing/src/oracles/mod.rs`: master's 8 new oracle functions plus this PR's own, both appended. The automatic merge dropped this PR's own closing brace for `egfx_zgfx_decompress`, attaching the shared trailing syntax to master's last function instead of both (the same failure mode hit #1337's rebase the other way around, master's brace dropped there). Caught before continuing the rebase this time by diffing the resolved file against both source commits directly; fixed and re-verified byte-identical to both. None of the ZGFX hardening code (`utils.rs`, `zgfx/circular_buffer.rs`, `zgfx/control_messages.rs`, `zgfx/mod.rs`) had any conflict; it applied unchanged. All checks re-run on the new head: `cargo xtask check fmt/lints/tests/typos/locks`, a direct `cargo check --all-targets` in `fuzz/`, and `cargo xtask wasm check`, all green. `fuzz/Cargo.lock` unchanged. ## Review round 2026-08-20 Four findings addressed, three of them posted as review-body text rather than inline threads and never actually worked despite the PR reading as fully resolved. (1) `ZgfxError` marked `#[non_exhaustive]`, matching the same convention already on `DecodeErrorKind`/`EncodeErrorKind` in ironrdp-core; this PR adds several new variants and every downstream exhaustive match would have broken without it. (2) Corrected the doc comment on `MAX_DECOMPRESSED_PER_SEGMENT`: MS-RDPEGFX 3.1.9.1.2's compressor-limits list does supply a bound (65,535 uncompressed bytes per segment for a compliant compressor), and this crate's own compressor honors it (`wrapper.rs` panics above it, the only production caller falls back to uncompressed instead of risking it). (3) Closed a real gap: the multipart aggregate memory budget was only checked against the sender's own declared `uncompressedSize`, a fully attacker-controlled 32-bit field, so a message built from small segments could drive real allocation to roughly 4.29 GiB before that check fired. Added `MAX_DECOMPRESSED_TOTAL` (256 MiB, same footing as `MAX_COMPOSITOR_BYTES` in ironrdp-egfx's compositor.rs), checked independently. (4) Masked the trailer byte to its low 3 bits per MS-RDPEGFX 3.1.9.1.2.4 ("the five high-order bits... are reserved"); reading the whole byte let a sender's nonzero reserved bits get misread as part of the unused-bit count. Both (3) and (4) ship with regression tests negative-verified against the code without the fix. All 6 gates green throughout. ## Rebase 2026-08-20 Rebased onto current master, 9 behind to 0. Two conflicts, both pure unions with master's own new fuzz-target entries in `fuzz/Cargo.toml` and `fuzz_regression.rs`, same shape as the earlier rebase round. `oracles/mod.rs` auto-merged without conflict markers this time; explicitly re-checked it did not repeat the closing-brace-drop failure from that earlier round (the function's own closing brace confirmed present, then a full `cargo check -p ironrdp-fuzzing --all-targets` run clean). All 6 gates green, fuzz workspace lock stable. |
||
|
|
71e0ae73e1 |
feat(fuzz): add egfx_avc444_decode oracle and target (#1327)
Sibling of `egfx_avc420_decode` (PR #1326), applied to the AVC444 wire shape. AVC444 wraps two `Avc420BitmapStream`s plus a 2-bit encoding tag per MS-RDPEGFX 2.2.4.4 (LUMA_AND_CHROMA, LUMA, or CHROMA). The wrapper layer for each sub-stream is the same `avc_to_annex_b` function that #1326 lifted to a public free function; this PR adds an oracle that exercises the wrapper on both sub-streams. This PR is stacked on PR #1326 (which introduced `avc_to_annex_b` as a public function in `ironrdp_egfx::pdu`) and must merge after it. The dependency is structural rather than a merge-order note: this branch carries #1326's commit, so CI here is green on its own. After #1326 merges, this PR rebases cleanly because the only commit unique to this branch is the AVC444 oracle scaffolding. The new oracle exercises three paths on every fuzz call: - Direct path: the oracle calls `avc_to_annex_b(data)` on the raw fuzz input. This exercises the wrapper on arbitrary byte distributions, including inputs that do not parse as `Avc444BitmapStream`. - Decode-chain path 1: the oracle tries `Avc444BitmapStream::decode(data)`; on success it calls `avc_to_annex_b(stream.stream1.data)`. Stream 1 is always the luma stream; per MS-RDPEGFX 2.2.4.5, even under `LUMA_AND_CHROMA` it decodes as the first of two disjoint `Avc420BitmapStream` byte ranges, not combined with chroma. - Decode-chain path 2: when `stream.stream2.is_some()`, the oracle also calls `avc_to_annex_b(stream2.data)`. Stream 2 carries the auxiliary chroma data per the tagged-encoding split. The oracle catches panics in the wrapper, OOM allocation from attacker-controlled NAL length encoding inside either sub-stream, contract violations on the produced Annex-B byte stream, and any framing slip in `Avc444BitmapStream::decode` that misallocates `stream1` vs `stream2` byte ranges. The oracle does NOT catch OpenH264 internal bugs (OSS-Fuzz coverage), the post-OpenH264 YUV-to-RGBA conversion path downstream of OpenH264, the AVC444 luma plus chroma packing on the encoder side, or cross-stream state correlation across frames (multi-frame oracle is a future sibling target under the same umbrella). Smoke fuzz ran 10,246,473 iterations in 31 seconds at ~330K exec/s sustained with zero crashes. The new target auto-discovers into CI via the `cargo xtask fuzz list` dynamic fan-out mechanism. The new `check_egfx_avc444_decode` regression-replay test in `crates/ironrdp-testsuite-core/tests/fuzz_regression.rs` runs against the seed corpus and passes. Refs #1316. Stacked on #1326. ## Rebase 2026-08-19 Rebased onto current master (was CONFLICTING after the RDPEUDP/RDPEMT series landed). Two conflicts, both purely additive insertions colliding with unrelated new master content at the same point: `fuzz/Cargo.toml` (master's 8 new RDPEUDP/RDPEMT `[[bin]]` entries plus this PR's own `egfx_avc444_decode` entry, both kept) and `crates/ironrdp-fuzzing/src/oracles/mod.rs` (master's 8 new oracle functions plus this PR's own, both appended). Unlike the three sibling fuzz PRs rebased earlier in the same session, the automatic merge here resolved cleanly with both functions' closing braces intact; verified byte-identical against both source commits regardless. All checks re-run on the new head: `cargo xtask check fmt/lints/tests/typos/locks`, a direct `cargo check --all-targets` in `fuzz/`, and `cargo xtask wasm check`, all green. `fuzz/Cargo.lock` unchanged. ## Review round 2026-08-20 Two findings addressed. (1) The sole regression fixture, `seed-empty.bin`, was literally empty, so replay never reached `Avc444BitmapStream::decode` at all. Replaced with `seed-luma-chroma.bin`: a real encoded `LUMA_AND_CHROMA` stream, both substreams populated with AVC length-prefixed NAL data and their own rectangle/quant-quality values, with a stream length that exercises the `split_at` boundary. Built via `Encode` and round-trip-verified against `Decode` before committing it as a fixture. (2) Corrected the doc comment above (and the earlier PR description text) claiming stream1 becomes "the combined luma-and-chroma stream" under that encoding: the decoder always splits stream1/stream2 into two disjoint byte ranges per MS-RDPEGFX 2.2.4.5, and the two views stay separate until YUV444 reconstruction runs downstream. All 5 gates green, fuzz workspace lock re-verified stable. ## Rebase 2026-08-20 Rebased onto current master (flipped CONFLICTING again off the RDPEUDP/RDPEMT follow-up wave and the RemoteFX quantization/entropy PRs landing since the last rebase). Same two-file conflict shape as before: `fuzz/Cargo.toml` and `crates/ironrdp-fuzzing/src/oracles/mod.rs`, both purely additive insertions against unrelated new master content, both resolved as unions. `git range-diff` confirms both commits are content-identical to the pre-rebase versions, mechanical rebase only. 0 behind master. All 5 gates green, fuzz workspace lock re-verified stable, `check_egfx_avc444_decode` still passes against the fixture. |
||
|
|
2e4d7d04c3 |
feat(xtask): add fuzz coverage subcommand (#1733)
## Summary - Coverage-guided fuzzing typically plateaus around 12 hours in (Liyanage et al., ICSE 2023), and several targets in this workspace have run far longer than that without any coverage-feedback check. A target can keep running for hours after its coverage stopped growing, hiding bug-finding opportunity elsewhere, with nothing surfacing it. - Adds `cargo xtask fuzz coverage [--target NAME]`: runs a target (or all targets, matching `fuzz run`'s existing default) against its existing corpus via `cargo fuzz coverage`, then renders a per-file line coverage report via the toolchain's own `llvm-cov`, filtered to only files with nonzero coverage. Auto-discovers targets via the existing `discover_targets()` used by `run`/`list`/`corpus-min`. - `llvm-cov`/`llvm-profdata` are resolved from the pinned nightly toolchain's own `rustlib` tree rather than a plain `PATH` lookup: a `PATH` resolution can land on an unrelated system-wide LLVM install with an incompatible profile format, which is what happened locally when testing this. `cargo fuzz coverage` resolves `llvm-profdata` the same way internally, for the same reason. - Adds the `llvm-tools-preview` rustup component to `fuzz install`, needed to merge raw coverage profiles. Without it, `coverage` fails partway through with a missing `llvm-profdata` error instead of at install time. - `fuzz/coverage/` is gitignored alongside the existing `corpus` and `artifacts` entries. ## Validation `cargo xtask check fmt/lints/tests/typos/locks` all pass. Also ran the subcommand end to end against a seeded `pdu_decoding` corpus: correctly narrowed the full linked-binary report from ~60 source files down to the 49 the target actually touches. ## Notes Pure additive, no existing subcommand changes. The compiled fuzz binary's path assumes the `x86_64-unknown-linux-gnu` target triple, matching `cargo fuzz coverage`'s own documented default rather than introducing a new limitation. |
||
|
|
08b6c3dcfd |
feat(fuzz): add message_decoding_invariants oracle and target (#1320)
This PR adds an assertion-based oracle that checks the `Encode::size()` soundness contract on every decoder-accepted input. The asserted property is `pdu.size() == encode_vec(&pdu).len()`. The `Encode` trait's `size()` is the contract caller code relies on for buffer sizing (`ensure_size!`, `cast_length!`, downstream allocations). A size that lies about its own length produces under-allocation (truncated encode) or over-allocation (wasted memory and buffer-overflow risk depending on surrounding context). The workspace already asserts this property against known-good byte fixtures in `ironrdp-testsuite-core/tests/pdu/rdp.rs::buffer_length_is_correct_for_*`. This oracle extends the assertion across the fuzz input surface. This oracle differs from `pdu_round_trip` in two ways: - `pdu_round_trip` silently drops `Err` results. It catches panics only. - `message_decoding_invariants` asserts the size contract. A violation aborts the fuzz iteration as a libFuzzer crash. The bug-reporting mechanism follows the oracle module's documentation. This oracle catches the following bug classes that `pdu_round_trip` does not: - `Encode::size()` returns N but `encode` writes M, where M does not equal N. Callers then over-allocate or under-allocate buffers. - The encoder cannot reconstruct decode-acceptable bytes to the same length, which means decode loses framing structure. This oracle does not catch the following bug classes, which other oracles cover: - `pdu_decode` covers decode-time panics and OOM. - `pdu_round_trip` covers re-decode equality after round-trip via its silent-drop pattern. Assertion-based re-decode stays out of scope here to keep this oracle's failure mode unambiguous. Type coverage matches `pdu_round_trip`. The cohort includes `capability_sets::CapabilitySet` and `headers::ShareControlHeader`. The latter transits through `CapabilitySet`'s encoder via the Active variants. The same encoder path exercises both types. The new target auto-discovers into CI via the `cargo xtask fuzz list` dynamic fan-out mechanism. The test plan covers two checks. First, all five `cargo xtask check fmt/lints/tests/typos/locks` gates pass on the post-rebase head. Second, the new `check_message_decoding_invariants` regression-replay test in `crates/ironrdp-testsuite-core/tests/fuzz_regression.rs` passes against the seed corpus. This PR refs the #1120 fuzzing umbrella. The PR also closes #1124. ## Rebase 2026-08-19 Rebased onto current master (was CONFLICTING after the RDPEUDP/RDPEMT series landed). Two conflicts, both purely additive insertions colliding with unrelated new master content at the same point: - `fuzz/Cargo.toml`: master's 8 new RDPEUDP/RDPEMT `[[bin]]` entries plus this PR's own `message_decoding_invariants` entry, both kept. - `crates/ironrdp-fuzzing/src/oracles/mod.rs`: master's 8 new oracle functions plus this PR's own, both appended. The automatic merge dropped master's closing brace for its last function (`rdpeudp_ack_vector`'s oracle), the same failure mode already seen twice this session on sibling fuzz PRs rebasing past the same master content. Caught before continuing the rebase by diffing the resolved file against both source commits directly; fixed and re-verified byte-identical to both. All checks re-run on the new head: `cargo xtask check fmt/lints/tests/typos/locks`, a direct `cargo check --all-targets` in `fuzz/`, and `cargo xtask wasm check`, all green. `fuzz/Cargo.lock` unchanged. |
||
|
|
1cee7a8613 |
feat(activex): add location redirection (#1778)
Implement MS-RDPEL v1 codecs and the location DVC state machine, then route the ActiveX methods through the bounded client input queue. Preserve mstsc-compatible validation and altitude caching while surfacing inactive sessions, channel readiness, queue pressure, and encoding failures. Coordinates are caller-supplied only and are never logged or persisted. |
||
|
|
04320a0ce1 |
test(core): add a rdpeusb (URBDRC) decode fuzz target (#1690)
## Summary `ironrdp-rdpeusb` has no fuzz coverage, even though it decodes attacker-controlled **client→server** PDUs off two DVC channels. The device channel in particular carries URB completions, IO-control completions and interface-info results whose **length-prefixed payloads must be bounds-checked before they're read** — historically a good place for unchecked-read panics. (A downstream server built on `ironrdp-server`, [macrdp](https://github.com/clintcan/macrdp), hit exactly that class of panic in these decoders in the past, which is what motivated adding coverage here.) This adds a fuzz target for the two top-level client PDU families a server decodes off the wire. ## What's added - **Oracle** `oracles::rdpeusb_decode` — decodes the two client→server entry points via `ironrdp_core::decode`: - `UrbdrcClientControlPdu` (main-channel family) - `UrbdrcClientDevicePdu<Raw>` (per-device family — recursively exercises the URB / IO-control / interface-info result payloads) - **Fuzz target** `fuzz/fuzz_targets/rdpeusb_decode.rs` (auto-discovered by `cargo xtask fuzz list`, so it joins the CI matrix with no further wiring). - **Regression check** `check_rdpeusb_decode` in `fuzz_regression.rs`, plus the `rdpeusb_decode/` corpus folder, so any crash found becomes a permanent replay test. ## Verification - `cargo build -p ironrdp-fuzzing` — the oracle compiles against the real API. - `cargo test -p ironrdp-testsuite-core check_rdpeusb_decode` — passes. - `cargo fmt --all -- --check` (stable + nightly) clean; `cargo clippy -p ironrdp-fuzzing` clean. - `cargo xtask fuzz list` lists `rdpeusb_decode`. Purely additive (a new oracle, target, regression check + the `ironrdp-rdpeusb` dev-dependency of `ironrdp-fuzzing`); no existing code changes. Complements the in-flight rdpeusb server work by giving the crate's decode surface ongoing fuzzing. Co-authored-by: Clint Christopher Canada <clint.canada@clubitech.com> |
||
|
|
2191cf47a1 | feat(fuzz): add fuzz targets for the RDP-UDP transport and RDPEMT tunnel (#1707) | ||
|
|
161409e18d |
feat(rdpdr): add filesystem PDU foundation (#1566)
## Summary - Add portable MS-RDPEFS/MS-FSCC filesystem request and completion codecs with malformed-input validation and wire tests. - Keep RDPDR runtime dispatch, Windows-native backend implementation, and client/session integration out of this foundation. ## Follow-up Later stacked PRs provide the backend implementation and runtime integration. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> |
||
|
|
7385255f5e |
build(deps): bump num-derive from 0.4.2 to 0.5.1 in /fuzz (#1540)
Bumps [num-derive](https://github.com/rust-num/num-derive) from 0.4.2 to 0.5.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-num/num-derive/blob/main/RELEASES.md">num-derive's changelog</a>.</em></p> <blockquote> <h1>Release 0.5.1 (2026-07-20)</h1> <ul> <li>Remove mention of the old "full-syntax" feature.</li> </ul> <h1>Release 0.5.0 (2026-07-20)</h1> <ul> <li><a href="https://redirect.github.com/rust-num/num-derive/pull/71">Upgrade to <code>syn v3</code>.</a> <ul> <li>This raises the minimum supported rustc to 1.71.</li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/rust-num/num-derive/commit/2f73ee84281877c71a262d2e6e9f9097ad308306"><code>2f73ee8</code></a> Merge pull request <a href="https://redirect.github.com/rust-num/num-derive/issues/72">#72</a> from cuviper/readme</li> <li><a href="https://github.com/rust-num/num-derive/commit/456e75dff0cc565b55a5d21f7b1fb2ba24719f7b"><code>456e75d</code></a> Release 0.5.1</li> <li><a href="https://github.com/rust-num/num-derive/commit/1e5e78fd88e3980c7b64c3d6030a8f20efbba19c"><code>1e5e78f</code></a> Remove full-syntax from the readme</li> <li><a href="https://github.com/rust-num/num-derive/commit/3230c9c3ecf0785a914b477b890a1cadc3c867c9"><code>3230c9c</code></a> Merge pull request <a href="https://redirect.github.com/rust-num/num-derive/issues/71">#71</a> from cuviper/syn3</li> <li><a href="https://github.com/rust-num/num-derive/commit/cab6df7118b1c396bef33bdd906c98b3b6df2733"><code>cab6df7</code></a> Remove the stale html_root_url</li> <li><a href="https://github.com/rust-num/num-derive/commit/95530299546131ccbd6cca91866b89a67f5a8980"><code>9553029</code></a> Release 0.5.0</li> <li><a href="https://github.com/rust-num/num-derive/commit/250c1325b0b97e9ef1be289d5cf1138bc410036f"><code>250c132</code></a> Stop caching the registry</li> <li><a href="https://github.com/rust-num/num-derive/commit/8087623459ed7d17d91b9a60abaa257fa6c4dd74"><code>8087623</code></a> Raise the MSRV to 1.71 (like syn)</li> <li><a href="https://github.com/rust-num/num-derive/commit/14a12df196f188d44e17e02e49ea53437d84fd4e"><code>14a12df</code></a> Upgrade to <code>syn v3</code></li> <li><a href="https://github.com/rust-num/num-derive/commit/96ca025ce068044d4b8b21808be7d7a467bb71ca"><code>96ca025</code></a> Merge pull request <a href="https://redirect.github.com/rust-num/num-derive/issues/70">#70</a> from cuviper/rename-head</li> <li>Additional commits viewable in <a href="https://github.com/rust-num/num-derive/compare/num-derive-0.4.2...num-derive-0.5.1">compare view</a></li> </ul> </details> <br /> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Benoît CORTIER <git.divisible626@passmail.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> |
||
|
|
5f779f5caf |
build(deps): bump clap from 4.6.4 to 4.6.5 in the patch group across 1 directory (#1537)
Bumps the patch group with 1 update in the / directory: [clap](https://github.com/clap-rs/clap). Updates `clap` from 4.6.4 to 4.6.5 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.6.5</h2> <h2>[4.6.5] - 2026-07-31</h2> <h3>Fixes</h3> <ul> <li><em>(help)</em> Correctly mark which <code>value_names</code> are optional with <code>num_args</code></li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.6.5] - 2026-07-31</h2> <h3>Fixes</h3> <ul> <li><em>(help)</em> Correctly mark which <code>value_names</code> are optional with <code>num_args</code></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/clap-rs/clap/commit/c8c935504a3f1a015470199ae82c3cb124b5b1d5"><code>c8c9355</code></a> chore: Release</li> <li><a href="https://github.com/clap-rs/clap/commit/af74def7141738c51ace956f58eb32dd94e998ab"><code>af74def</code></a> docs: Update changelog</li> <li><a href="https://github.com/clap-rs/clap/commit/c96f222c35c4ef4bd3ab9927809b2724532a8f6e"><code>c96f222</code></a> Merge pull request <a href="https://redirect.github.com/clap-rs/clap/issues/6368">#6368</a> from truffle-dev/fix/fish-env-escaping</li> <li><a href="https://github.com/clap-rs/clap/commit/49a05cdc99c2151cdd48d5ec4c974151d21c026e"><code>49a05cd</code></a> fix(complete): Two-pass quote fish env-completer</li> <li><a href="https://github.com/clap-rs/clap/commit/e791004a5bbbfe5418fe573a4db777df24d72490"><code>e791004</code></a> test(complete): Snapshot fish env quoting cases</li> <li>See full diff in <a href="https://github.com/clap-rs/clap/compare/clap_complete-v4.6.4...clap_complete-v4.6.5">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
e1725e8c8a | build(deps): bump the crypto group across 1 directory with 3 updates (#1449) | ||
|
|
d399a867f6 | feat(fuzz): add egfx_multi_frame oracle and target (#1336) | ||
|
|
cafbef1c9f |
feat(fuzz): add egfx_avc420_decode oracle and target (#1326)
This change adds an assertion-or-panic fuzz oracle for the AVC length-prefix to Annex-B conversion that runs inside `OpenH264Decoder::decode` before any OpenH264 entry point. The same change refactors the conversion from a private method on `OpenH264Decoder` into two public free functions in `ironrdp_egfx::pdu::avc`. The first function, `avc_to_annex_b`, returns a fresh `Vec<u8>` and is symmetric with the existing `annex_b_to_avc`. The second function, `avc_to_annex_b_into`, writes into a caller-provided buffer and preserves the per-frame buffer-reuse optimization that `OpenH264Decoder` relied on. The conversion is now available unconditionally to any consumer of `ironrdp-egfx`. The previous `#[cfg(feature = "openh264")]` gating went with the location, not the bytes-to-bytes logic, so lifting the function out of `decode.rs` removed the gate too. The new oracle exercises two input distributions on every fuzz call: - Direct path: the oracle calls `avc_to_annex_b(data)` on the raw fuzz input. This exercises the wrapper on arbitrary byte distributions, including inputs that do not parse as `Avc420BitmapStream`. - Decode-chain path: the oracle tries `Avc420BitmapStream::decode(data)`; on success it calls `avc_to_annex_b(stream.data)`. This exercises the wrapper on the realistic post-decode payload distribution. The oracle catches panics in the wrapper, OOM allocation from attacker-controlled NAL length encoding, and contract violations on the produced Annex-B byte stream. The oracle does NOT catch OpenH264 internal bugs (OSS-Fuzz coverage), the YUV-to-RGBA conversion path downstream of OpenH264 (separate workstream), or AVC444 luma plus chroma split (sibling target). Smoke fuzz ran 10,922,695 iterations in 31 seconds at ~352K exec/s sustained with zero crashes. Coverage settled at 158 lines, 456 features, 69 corpus entries. The new target auto-discovers into CI via the `cargo xtask fuzz list` dynamic fan-out mechanism. The new `check_egfx_avc420_decode` regression-replay test in `crates/ironrdp-testsuite-core/tests/fuzz_regression.rs` runs against the seed corpus and passes. Refs #1316. |
||
|
|
74b3365c1f |
feat(pdu,session,connector,server)!: support session resume via the auto-reconnect cookie (#1501)
> **Rebased onto post-#1522 master.** #1509 landed the server half of #1508 while this was open, including the `ClientAutoReconnect` structure. This PR no longer declares it; it extends it, and picks up the parts #1509 did not build. ## What The client half of automatic reconnection. The session layer surfaces the Server Auto-Reconnect Cookie, `ironrdp-pdu` derives and verifies the client's response to it, and the connector sends that response when resuming a session. ## Why A client whose connection drops ungracefully can reattach to its session instead of making the user log on again, provided it returns the cookie the server issued during logon ([MS-RDPBCGR] 1.3.1.5). #1509 built the server side of that: it validates a returning `ARC_CS_PRIVATE_PACKET` and rotates the random. Nothing answers it. `ironrdp-session` decodes the cookie and drops it, `ironrdp-connector` has no way to send one back, and `TODO(#271)` still sits in `ironrdp-client`. So `ironrdp-client` cannot resume a session against `ironrdp-server`, and the validation #1509 added has no in-tree counterpart to exercise it. The wire encoding was already there. `ExtendedClientOptionalInfo` carries, encodes and decodes a 28-byte `autoReconnectCookie` and its builder already had a `reconnect_cookie` step; `ServerAutoReconnect` already decoded; #1509 added `ClientAutoReconnect` and its decode. Nothing connected them. ## The three parts **Receive.** `SaveSessionInfo` now also surfaces the cookie, as `ProcessorOutput::AutoReconnectCookie` and `ActiveStageOutput::AutoReconnectCookie`. #1522 added a `SaveSessionInfo { logon_complete }` output on that same handler; the two coexist rather than compete, since both are read off one PDU and neither supersedes the other. The handler emits the logon notification unconditionally and appends the cookie when one is present, and a test pins that surfacing the cookie does not suppress the notification. #1509's server replaces the cookie whenever a client connects and again hourly ([MS-RDPBCGR] 3.3.6.2), so this can arrive more than once in a session and the consumer keeps the most recent. **Derive.** `ClientAutoReconnect::from_server_cookie` implements [MS-RDPBCGR] 5.5: > The auto-reconnect random is used to key the HMAC function ([RFC2104]), which uses MD5 as the iterative hash function. The security verifier is derived by applying the HMAC to the client random received in Step 3. > > `SecurityVerifier = HMAC(AutoReconnectRandom, ClientRandom)` > > When Enhanced RDP Security is in effect the client random value is not generated (section 5.3.2). In this case, for the purpose of generating the security verifier, the client random is assumed to be an array of 32 zero bytes. IronRDP implements no Standard RDP Security path (there is no Security Exchange PDU), so the zero-client-random case is the only one that arises. As 5.5 notes, that makes the verifier constant for a given cookie, so it proves possession of the cookie and nothing more; session security comes from the outer TLS/CredSSP handshake. @clintcan independently confirmed this construction against real **mstsc** while validating #1509 ([comment](https://github.com/Devolutions/IronRDP/pull/1509#issuecomment-5151200681)): a Windows client's `ARC_CS_PRIVATE_PACKET` verifies against `HMAC-MD5(random_bits, [0u8; 32])`. That is the same derivation implemented here, so the two halves interoperate with Microsoft's client and not only with each other. **Send.** `ClientConnector::with_auto_reconnect_cookie` takes the cookie last received and makes the connector put the derived Client Auto-Reconnect Packet ([MS-RDPBCGR] 2.2.4.3) in the Client Info PDU. Absent, that PDU is byte-for-byte what it was. Unlike the server packet, this structure has no enclosing logon-info field header, so it encodes to exactly the 28 bytes the cookie field expects. `to_bytes` writes that layout directly rather than going through `Encode`, so filling a fixed-size field has no error path a caller must handle; a test pins the two to agree. ## One derivation, not two Putting `from_server_cookie` in `ironrdp-pdu` would leave the workspace with two implementations of 5.5, since #1509 added a private HMAC to `ironrdp-server`. So `ClientAutoReconnect` also gains `verify`, and the server routes through it. `verify` keeps the constant-time comparison the server had. The verifier is the whole credential, so a comparison returning early on the first differing byte would let a peer recover it a byte at a time from the timing; the session identifier is not secret and is compared normally. `ironrdp-server` keeps the policy around the check, which cookies are live and whether the security protocol permits auto-reconnect, and drops its `hmac` and `md-5` dependencies. `hmac` moves to `ironrdp-pdu` as `default-features = false`; the crate's full feature powerset still checks clean, including `--no-default-features`. I would rather not have reached into `ironrdp-server` in a `pdu,session,connector` change, but the alternative was shipping the duplicate and filing a follow-up to remove it, which is a worse trade for reviewer time. ## Tests that were not running That move also rehomes the known-answer tests @clintcan contributed on #1509. They went in as an inline `#[cfg(test)]` module in `crates/ironrdp-server/src/server.rs`, and that crate sets `[lib] test = false`, so they have never executed in CI. They now live in `ironrdp-testsuite-core` against the public API, where CI runs them: his HMAC-MD5 reference vector is kept as a second vector alongside a differently-keyed one, plus the cases for a tampered verifier and a mismatched logon ID. Worth flagging separately: `ironrdp-server` is not alone. `ironrdp-agent`, `ironrdp-session` and `ironrdp-web` also set `[lib] test = false` and between them carry 16 files of inline `#[cfg(test)]` modules that CI never runs. That is out of scope here, but I am happy to open an issue if it would be useful. ## Breaking changes `ActiveStageOutput` and `x224::ProcessorOutput` gain a variant, and `ClientConnector` gains a public field, so exhaustive matches and struct literals need updating. Confirmed with `cargo-semver-checks` against the merge-base: those three are the only findings this branch introduces. The others it reports on `master` today (`ShareDataPdu::Compressed` and the `ShareDataCtx` fields from #1518, `ProcessorBuilder.bulk_decompressor` from #1518, `ServerEvent::SetAutoReconnectCookie` from #1509) are present on `master` unchanged. The `ironrdp-pdu` additions are additive. ## Scope This is the library half. `ironrdp-client`, `ironrdp-web` and the FFI bindings gain an arm for the new output but none of them reconnect automatically yet; that is the remaining part of #271, and the existing `TODO(#271)` in `ironrdp-client` marks where it goes. I kept receive, derive and send together deliberately. Split up, none of them is usable on its own: without the receive half there is no way to obtain a cookie, and without the send half there is nothing to do with one. ## Tests Thirteen, all in `ironrdp-testsuite-core`. On the packet and the derivation: the `SecurityVerifier` matches two independently computed HMAC-MD5 vectors of 32 zero bytes under different keys, so the tests pin the derivation rather than restating the code; the logon ID carries over from the server cookie; the encoding matches the 2.2.4.3 field layout byte for byte with `cbLen` fixed at `0x1C`; `to_bytes` agrees with `Encode`; it round-trips; and it rejects both a wrong packet length and an unknown version. On verification: a derived answer is accepted, a single flipped byte in the verifier is rejected, a correct verifier under a different logon ID is rejected, and an answer derived from a different random is rejected. On the surfacing path: a Save Session Info PDU framed the way a server sends it, through the real x224 processor, yields an `AutoReconnectCookie` carrying the right logon ID and random bits, alongside #1522's logon notification rather than in place of it; and one without a cookie surfaces no cookie. ## Verification `cargo xtask check fmt/lints/tests/typos/locks` all pass on 1.94.1, including a `fuzz/` build before the lock check. ## Note #1496 also touches the `ClientAutoReconnect` declaration. Whichever of the two lands second needs a one-line rebase on the derive attribute; happy to take that in either order. [MS-RDPBCGR]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/e729948a-3f4e-4568-9aef-d355e30b5389 [RFC2104]: https://www.rfc-editor.org/rfc/rfc2104 |
||
|
|
629154026d |
perf(graphics): portable SIMD inverse DWT (wide + SWAR) (#1383)
## Summary On the WASM web client, frame **decode** dominates (~93% of frame time on a 1080p RemoteFX replay), and within decode the **RFX inverse DWT was ~48%** (the YCbCr→RGBA convert is already SIMD via `yuv`; the entropy/RLE stages are inherently sequential). This vectorizes the inverse DWT with the portable [`wide`](https://crates.io/crates/wide) crate (`i16x8`), so the same code lowers to **wasm `simd128`, x86 SSE/AVX, and ARM NEON** — desktop and browser both benefit. The encode path is unchanged. ## How it stays bit-exact (no `unsafe`, no `cfg` split) The lifting steps need i32 intermediates only for the averages. Overflow-free SWAR identities let the whole kernel stay in `i16` lanes (no widen/narrow): - `ceil_avg(a,b) = (a|b) - ((a^b)>>1)` ≡ `(a + b + 1) >> 1` - `floor_avg(a,b) = (a&b) + ((a^b)>>1)` ≡ `(a + b) >> 1` and `(2x+1)>>1 == x` / `(x+x)>>1 == x` simplify the first/last rows. Every other op is wrapping `i16` arithmetic, identical to the old `i32`-intermediate-then-`as i16` truncation. ## Performance 1080p RemoteFX replay, headless Chromium, wasm release `+simd128`, 8-pass median: | inverse DWT | decode (ms) | |---|--:| | scalar (baseline) | ~1598 | | **portable `wide` SIMD** | **~985** | → inverse DWT ~2×, **~39% off the decode stage**. (Absolute ms carry ~±15% machine-load noise; the ratio is stable. Per-frame this is a throughput win — decode was already within real-time budget.) ## Correctness Verified bit-exact three ways: - the replay-bench **framebuffer CRC32** is unchanged, - the existing **native DWT tests** pass (so it's exact on x86 too, not just wasm), - an **exhaustive** check of the SWAR identities over all `i16 × i16` pairs (0 mismatches). ## Notes - `wide` is a single-user dep in `ironrdp-graphics`; chosen over `std::simd` (still nightly-only) and over per-arch intrinsics (one portable kernel vs three). - Reproducible bench branches: `bench/draw-*` (renderer) and the DWT measurements were taken on the replay-bench harness branch (the capture corpus is gitignored). |
||
|
|
c0a29813bf | chore(release): clean up (#1440) | ||
|
|
11a0810cfb |
chore(release): prepare for publishing (#1364)
Co-authored-by: Benoît Cortier <3809077+CBenoit@users.noreply.github.com> |
||
|
|
8fe59c19e2 |
chore(release): prepare for publishing (#1340)
Co-authored-by: Benoît CORTIER <git.divisible626@passmail.com> Co-authored-by: Benoît Cortier <3809077+CBenoit@users.noreply.github.com> |
||
|
|
7dd4db0f62 | chore(release): prepare for publishing (#1212) | ||
|
|
ad3a84295a | test(fuzz): add egfx_round_trip oracle and target (#1317) | ||
|
|
196d18dfaa | feat(dvc): close channel API for server and client (#1302) | ||
|
|
9d12adab8e | build(deps): bump log from 0.4.29 to 0.4.30 in the patch group across 1 directory (#1310) | ||
|
|
3dae1fbacc | test(fuzz): add egfx PDU decoders to pdu_decode oracle + fix two surfaced bugs (#1271) | ||
|
|
610cfd0742 | test(fuzz): add pdu_round_trip oracle and target (#1291) | ||
|
|
a8a813a22d | feat(fuzz): add bulk decompression fuzz targets (MPPC, NCRUSH, XCRUSH) (#1285) | ||
|
|
4c5301850b |
fix(connector)!: remove arbitrary feature (#1273)
The connector types are unlikely to benefit from random value generation for fuzzing purposes; a more targeted approach would be preferable if the connector is fuzzed in the future. We’ll reevaluate later. |
||
|
|
af11df1fd0 | feat(pdu): add arbitrary feature for structure-aware fuzzing (#1272) | ||
|
|
14c55027c8 | refactor(pdu): hand-roll Display/Error impls and remove thiserror dependency (#1264) | ||
|
|
ba8b8b30f1 | build(deps): bump the patch group across 1 directory with 2 updates (#1248) | ||
|
|
3fe6d157e0 | build(deps): bump the patch group across 1 directory with 2 updates (#1222) | ||
|
|
b50a934c92 | build(deps): bump the patch group across 1 directory with 2 updates (#1203) | ||
|
|
c98a8fb774 |
feat(cliprdr,web,ffi): implement clipboard file transfer support (#1166)
Add end-to-end clipboard file transfer (upload and download) across the CLIPRDR channel per MS-RDPECLIP. |