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>
## 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>
- `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.
- `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.
## 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.
## 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.
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.
## 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.
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.
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.
## 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>
## 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>
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>
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.
> **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
## 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).
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.
- Clean up permissions and remove unnecessary fetch-depth settings from
release workflow.
- Clean up unused peer dependency entries from package-lock.json files.