Commit Graph

854 Commits

Author SHA1 Message Date
dependabot[bot] 1eaf333057 build(deps): bump opus2 from 0.3.3 to 0.4.0 (#1204) 2026-04-07 22:49:28 +09:00
Mariusz Białończyk e5ab22246f feat(client): add --scale-desktop CLI option for display scaling factor (#1200)
Adds a new CLI flag to control the initial RDP “desktop scale factor” sent during connection setup, enabling display scaling (useful for HiDPI/4K setups) similarly to FreeRDP’s scaling option.
2026-04-02 23:40:10 +00:00
Greg Lamberson 49099f0c31 feat(pdu,graphics): add RemoteFX Progressive codec primitives (#1196)
Add wire-format types for RemoteFX Progressive Codec (MS-RDPRFX
Progressive Extension) and the computational primitives required for progressive refinement.
2026-04-03 08:28:17 +09:00
Greg Lamberson f10625cc80 feat(server): IPv6 dual-stack and SO_REUSEADDR for run() (#1187) 2026-04-01 21:39:07 +09:00
Greg Lamberson 4dcad09980 feat(session): handle Auto-Detect Request PDUs from server (#1178)
Fixes a crash when the server sends Auto-Detect Request PDUs during an
active session. After #1176 added ShareDataPdu::AutoDetectReq routing,
these PDUs decode correctly but hit the catch-all error path in the x224
processor: "unhandled PDU: Auto-Detect Request PDU".
2026-04-01 21:22:50 +09:00
Greg Lamberson ea47bf882d feat(egfx): add send_uncompressed_frame for V8 clients (#1182)
Add `send_uncompressed_frame()` to `GraphicsPipelineServer` for sending
raw pixel data through `WireToSurface1` with `Codec1Type::Uncompressed`.
2026-04-01 20:28:49 +09:00
Greg Lamberson c70d38a9f1 build: upgrade sspi to 0.19, picky to rc.22, fix NTLM fallback (#1188) 2026-04-01 08:15:18 +09:00
Greg Lamberson 2515470fdb feat(server): add auto-detect RTT measurement (#1177)
Adds server-side RTT measurement using the protocol-standard auto-detect
mechanism (MS-RDPBCGR 2.2.14).
2026-03-31 17:42:09 +00:00
Benoît Cortier 9bb909eca2 docs: document iron-remote-desktop API design philosophy (#1192)
The core rule is: a method belongs in the base API (UserInteraction /
Session / SessionBuilder) if the web component itself needs to call it
for transparent behaviour, or if the feature is universal across all
remote protocol backends. Protocol-specific concepts must go through the
extension mechanism instead.
2026-03-31 14:35:13 +00:00
Greg Lamberson a6b41093ce feat: complete pixel format support for bitmap updates (#1134)
Wires missing bitmap pixel formats (8/15/24bpp) into the session rendering
pipeline so bitmap updates at those depths are rendered instead of being
dropped, and adds fast-path palette update parsing to support 8bpp indexed
color sessions.
2026-03-25 16:56:38 +09:00
dependabot[bot] d92dd382b3 build(deps): bump criterion from 0.5.1 to 0.8.1 (#1184) 2026-03-24 02:39:42 +00:00
Greg Lamberson c30d853fa3 feat(server): make run_connection generic over stream type (#1181)
Generalizes `RdpServer::run_connection` to accept arbitrary Tokio `AsyncRead + AsyncWrite` streams instead of a concrete `TcpStream`, enabling non-TCP transports (e.g., Unix sockets, VSOCK, in-process streams) to reuse the same server connection logic.

Co-authored-by: lamco-office <office@lamco.io>
Co-authored-by: Benoît Cortier <3809077+CBenoit@users.noreply.github.com>
2026-03-23 23:07:54 +00:00
Greg Lamberson e5f2f36e96 feat(pdu)!: route auto-detect PDUs through ShareDataPdu dispatch (#1176)
Added Share Data PDU dispatch support for auto-detect PDUs, improving compatibility with Windows servers.
2026-03-18 20:24:53 +09:00
Mota-Link 306da0fee2 test(rdpsnd): add client state machine tests (#1169)
Add comprehensive tests for the Rdpsnd client SvcProcessor, covering
state transitions, error paths, and renegotiation.

- Error-path tests: invalid PDU in Start/WaitingForTraining → Stop
- Happy-path tests: Ready state silent PDUs, training confirm,
renegotiation (V5/V6), repeated renegotiation stability
- Terminal state: Stop ignores all PDU types
2026-03-17 23:05:27 +09:00
Greg Lamberson 84015c9467 fix(acceptor): skip credential check when server credentials are None (#1150) 2026-03-17 22:53:15 +09:00
Greg Lamberson 5e316bba1c feat(egfx): add openh264 feature-gated H.264 decoder (#1104) 2026-03-17 16:47:18 +09:00
Greg Lamberson b6200c7a4b feat(egfx): add client-side EGFX with surface management and AVC420 decode (#1103) 2026-03-17 13:49:19 +09:00
dependabot[bot] ecc0504644 build(deps): bump the patch group across 1 directory with 3 updates (#1170) 2026-03-17 12:14:09 +09:00
Greg Lamberson bf694c8a23 feat(egfx): add QoE statistics accumulation on GraphicsPipelineServer (#1167) 2026-03-16 22:55:35 +09:00
Greg Lamberson 6e5f08a1b9 feat(pdu): add Auto-Detect Request and Response PDU types (#1168) 2026-03-16 22:54:06 +09:00
Mota-Link 2fe6fd0424 fix(rdpsnd): handle AudioFormat renegotiation in Ready state (#1164)
Sometimes Windows Server re-sends `SNDC_FORMATS` during Ready state
(e.g., after mute/unmute in remote browser). Previously this hit the
wildcard branch, entering Stop and permanently killing audio.
  
Add an `AudioFormat` arm in Ready state to close the current stream and
restart negotiation.
2026-03-16 13:34:30 +00:00
uchouT 28e8628f0e feat(dvc): add DvcChannelListener for multi-instance DVC support (#1142)
Signed-off-by: uchouT <i@uchout.moe>
2026-03-13 13:55:39 +00:00
Benoît Cortier a67b1aace7 feat: add ironrdp-str crate with typed wire-aware RDP string primitives (#1159)
Introduces `ironrdp-str`, a new crate providing lazily-validated string
types covering all RDP UTF-16LE field shapes:

- `FixedString<N>`: fixed-size fields (e.g. `clientName`, `fileName`),
zero-padded on encode, trailing-null stripped on decode.
- `PrefixedString<P, N>`: length-prefixed fields with configurable
`LengthPrefix` (`CchU16`, `CchU32`, `CbU16`) and `NullTerminatorPolicy`
(`NullCounted`, `NullUncounted`, `NoNull`) type parameters.
- `UnframedString`: externally-lengthed fields whose length comes from a
sibling field in the containing message.
- `MultiSzString`: `MULTI_SZ` string lists (e.g. `HardwareIds` in
MS-RDPEUSB §2.2.4.2), with a `u32 cch` prefix counting all null
terminators including the final sentinel.

**Key design invariant**: wire bytes are stored as `Vec<u16>` and never
eagerly converted to Rust strings, enabling single-allocation decode and
zero-cost decode→encode passthrough for proxy use cases. Conversion is
deferred to explicit `to_native()` / `to_native_lossy()` calls.

Uses `bytemuck` for zero-copy LE→u16 reinterpretation on little-endian
targets; falls back to per-element byte-swap on big-endian.
2026-03-10 15:27:47 +00:00
Greg Lamberson eda32d8acf feat(acceptor): expose received client credentials in AcceptorResult (#1155) 2026-03-10 02:06:56 +09:00
Benoît Cortier c10e6ff16c docs: establish the MSRV policy (current is 1.89) (#1157)
The MSRV is the oldest stable Rust release that is at least 6 months
old, bounded by the Rust version available in Debian stable-backports
and Fedora stable.
2026-03-09 15:49:34 +00:00
Benoît Cortier 79869f9a76 chore: upgrade toolchain to 1.89.0 and migrate to Rust edition 2024 (#1153)
- Bump pinned toolchain from 1.88.0 to 1.89.0 in rust-toolchain.toml
- Migrate all workspace crates from edition 2021 to edition 2024
- Run `cargo fix --edition` to auto-migrate source code for edition 2024
compatibility (unsafe in unsafe fn, tail expr drop order, etc.)
- Replace all `expr_2021` macro fragment specifiers with `expr` now that
the workspace is fully on edition 2024
- Remove `keyword_idents_2024` lint (now enforced by the edition itself)
- Remove removed `clippy::string_to_string` lint (covered by
implicit_clone)
- Fix new clippy lints from 1.93.0: `manual_is_multiple_of`,
`useless_let_if_seq`, `manual_map`, `derivable_impls`,
`redundant_imports`, `unused_crate_dependencies` (but didn’t bump MSRV)
- Drop `core::future::Future` unnecessary qualifications (Future is now
in the Rust 2024 prelude)
- Remove direct `bytes` deps from ironrdp-futures and ironrdp-tokio
(re-exported by ironrdp-async)
2026-03-09 14:32:53 +00:00
Greg Lamberson 02b9f4efbb fix(acceptor): send RDP_NEG_FAILURE on security protocol mismatch (#1152)
When the client and server have no common security protocol, the
acceptor now sends a proper `RDP_NEG_FAILURE` PDU before returning an
error, instead of dropping the TCP connection.
2026-03-06 15:04:07 +00:00
Plaban Roy ff2b5671b5 chore: bootstrap crate ironrdp-rdpeusb (#1151) 2026-03-05 12:28:32 +00:00
Greg Lamberson 2b24e9664d fix(connector,session): propagate negotiated share_id to all outgoing ShareDataPdu (#1147) 2026-03-05 21:14:08 +09:00
glamberson 353e30ddfd fix(pdu): replace all from_bits_truncate with from_bits_retain (#1144)
from_bits_truncate silently discards unknown bits, which breaks the
encode/decode round-trip property. This matters for fuzzing because a
PDU that decodes and re-encodes should produce identical bytes.
from_bits_retain preserves all bits, including those not yet defined in
our bitflags types, so the round-trip property holds.
2026-03-05 05:31:15 +00:00
glamberson c2688f464d fix(pdu): correct ShareDataHeader uncompressedLength calculation (#1148) 2026-03-05 14:16:26 +09:00
glamberson c4f87aa417 fix(rdpdr): model CreateDisposition as enum instead of bitflags (#1145)
CreateDisposition values (FILE_SUPERSEDE through FILE_OVERWRITE_IF) are
mutually exclusive integers 0 through 5, not combinable bit flags.
Modeling them with the bitflags macro causes subtle correctness issues.
2026-03-05 14:10:54 +09:00
Guillaume Gelin 2b97a95e6d fix(session,server): skip bitmap updates that exceed bounds (#1146)
After a desktop resize, an RDP server can send a burst of bitmap updates
for the old resolution before its rendering pipeline has fully
transitioned to the new one. These updates reference coordinates beyond
the current image buffer in `DecodedImage`, causing index-out-of-bounds
panics in the `apply_*` methods. On the server side, the same stale
bitmaps can reach the encoder with dimensions exceeding the negotiated
desktop size, panicking in `NoneHandler::handle()`.

This commit adds bounds checks at two levels:
- `DecodedImage::rect_fits()` guard at the entry of each `apply_*`
method, returning an empty rectangle when the update doesn't fit
- Encoder-level guard in `EncoderIter::next()` that drops
`BitmapUpdate`s exceeding the current desktop size
2026-03-05 02:37:36 +09:00
Guillaume Gelin db2f40b5b0 fix(server): tile bitmaps that exceed MultifragmentUpdate limit (#1133)
Split oversized dirty rects into horizontal strips that fit within `max_request_size`
before handing them to the bitmap encoder.
2026-03-01 23:53:19 +09:00
Greg Lamberson 485d6c2f8d fix(pdu): accept short Server Deactivate All PDU
Some servers (XRDP, older Windows) send a Deactivate All PDU without
the sourceDescriptor field. The decode previously required at least 3
bytes, which caused a hard failure during deactivation-reactivation
sequences with these servers.

Treat the sourceDescriptor as optional: if the remaining data is
shorter than the fixed part size, return successfully without
reading the field. FreeRDP handles this the same way.

Ref: #314
2026-02-26 15:09:15 -05:00
Greg Lamberson d094cbeb75 fix(dvc): negotiate DVC version from server capabilities
The client was hardcoded to respond with CapsVersion::V1 regardless
of what the server requested. Servers that require V2 or V3 (such
as XRDP) would reject the channel with "Dynamic Virtual Channel
version 1 is not supported."

Echo the server's requested version in the capabilities response
instead. This correctly handles V1, V2, and V3 depending on what
the server advertises. When a Create arrives before Capabilities
(fallback path), default to V2 as the most broadly compatible
version.

Also bump the server-side capabilities request from V1 to V2 to
advertise priority charge support.

Add CapabilitiesRequestPdu::version() accessor to expose the
server's requested version from the parsed PDU.

Ref: #314
2026-02-26 15:08:33 -05:00
Greg Lamberson 4262ae75ff fix(session): handle row padding in uncompressed bitmap updates
Uncompressed bitmap data has rows padded to 4-byte boundaries per
[MS-RDPBCGR] 2.2.9.1.1.3.1.2.2, but the bitmap apply functions
expect tightly packed pixel data. Strip the per-row padding before
passing raw bitmap data to the apply functions.

This fixes garbled bitmap rendering when connecting to servers that
send uncompressed bitmaps with non-aligned row widths, such as XRDP
at 16 bpp.

Ref: #314
2026-02-26 15:07:49 -05:00
glamberson 33410e0569 feat(egfx): add ZGFX compression option to GraphicsPipelineServer (#1125) 2026-02-27 01:49:09 +09:00
glamberson 58ffb360ab fix(glutin-renderer): upgrade openh264 0.4 to 0.6, switch to libloading (#1126) 2026-02-27 01:47:46 +09:00
dependabot[bot] e406559e0d build(deps): bump uuid from 1.20.0 to 1.21.0 (#1119) 2026-02-24 14:27:47 +09:00
Gabriel Bauman 2911124e8f feat(web): expose granular RDCleanPath error details (#1117)
Add RDCleanPathDetails struct to provide detailed error information for
RDCleanPath errors, including HTTP status codes, WSA error codes, and
TLS alert codes.

Allows the web client to distinguish between different types of network
errors (say, WSAEACCES/10013) instead of showing a generic RDCleanpath
error message.
2026-02-22 17:03:59 +09:00
Benoît Cortier 4b6183df82 refactor(dvc): use TypeId-keyed map for DVC channel ID lookup in DrdynvcServer (#1113)
Replace linear scan with a BTreeMap<TypeId, u32> for consistency with
StaticChannelSet and the client-side DynamicChannelSet. Also removes the
ChannelState::Opened guard that was inconsistent with similar lookup
functions, and renames the method from get_dvc_channel_id_by_type to
get_channel_id_by_type to match the SVC naming convention (the type is
named DrdynvcServer, so this is redundant)
2026-02-18 14:20:13 +00:00
Benoît Cortier 39364dbf3b test(echo): move echo tests to ironrdp-testsuite-core (#1114) 2026-02-18 08:52:29 -05:00
Benoît Cortier 7ff2b132c6 refactor: remove echo feature flag and enable ECHO channel by default (#1112)
The ECHO virtual channel is now always compiled and enabled in both
ironrdp-client and ironrdp-server, removing the need for the `echo`
feature flag.
2026-02-18 08:49:39 -05:00
Benoît Cortier e87fe301af chore(egfx): disable publishing for ironrdp-egfx crate (#1111) 2026-02-18 12:24:46 +00:00
Marc-André Moreau 6f6496ad29 feat: implement ECHO virtual channel (#1109) 2026-02-18 21:01:24 +09:00
glamberson d437b7e0b9 fix(server): make MultifragmentUpdate max_request_size configurable (#1100)
The hardcoded `max_request_size` of 16,777,215 in the server's
MultifragmentUpdate capability causes mstsc to reject the connection (it
likely tries to allocate that buffer upfront). FreeRDP hit the same
problem and adjusted their value in FreeRDP/FreeRDP#1313.

This adds a configurable `max_request_size` field to `RdpServerOptions`
with a default of 8 MB (matching what `ironrdp-connector` already uses
on the client side) and exposes it through the builder via
`with_max_request_size()`.

Reference: [MS-RDPBCGR
2.2.7.2.7](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/01717954-716a-424d-af35-28fb2b86df89)
(TS_MULTIFRAGMENTUPDATE_CAPABILITYSET)

Closes #318

---------

Co-authored-by: lamco-office <office@lamco.io>
2026-02-18 16:18:44 +09:00
Guillaume Gelin b1b0289e00 perf(connector): reduce connection latency when Kerberos is disabled (#1107)
`CredsspSequence::init` now skips `ClientMode::Negotiate` when `kerberos_config` is `None` and uses `ClientMode::Ntlm` directly, avoiding macOS DNS SRV KDC auto-discovery timeouts (`_kerberos._tcp.*`) that could add ~6s per connection. Behavior is unchanged when `kerberos_config` is `Some` (still uses Negotiate).
2026-02-18 04:42:30 +09:00
Guillaume Gelin 75863245ab fix(session): fix pixel format handling in bitmap decoders (#1101) 2026-02-18 04:41:25 +09:00
glamberson 4ba696c266 feat(server): add EGFX server integration with DVC bridge (#1099) 2026-02-18 03:24:24 +09:00