Repository navigation
feat(pdu): add RDP-UDP protocol codecs - #1583
Marc-André Moreau (mamoreau-devolutions) wants to merge 3 commits into
Conversation
8f655fe to
90a22f2
Compare
There was a problem hiding this comment.
Pull request overview
Adds foundational RDP-UDP and RDPEMT wire codecs to ironrdp-pdu.
Changes:
- Adds reliable RDP-UDP headers, handshake data, ACK vectors, and payload codecs.
- Adds RDPEMT tunnel creation/data codecs with validation.
- Exposes the new UDP module and adds unit tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
crates/ironrdp-pdu/src/rdp/udp.rs |
Implements RDP-UDP wire structures. |
crates/ironrdp-pdu/src/rdp/multitransport.rs |
Implements RDPEMT tunnel PDUs. |
crates/ironrdp-pdu/src/rdp/mod.rs |
Exports the UDP module. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
4b9f512 to
1685acf
Compare
90a22f2 to
98489c3
Compare
1685acf to
1991ca5
Compare
404f93b to
3883b8b
Compare
There was a problem hiding this comment.
Wire layouts are largely correct: the tunnel-header nibble split, header/payload length rules, MTU bounds, big-endian RDPEUDP fields, and ACK-vector alignment all match the cited spec text. Four issues warrant changes. The four new tunnel Encode impls omit the ensure_size guard every neighbouring PDU uses, so encoding into an undersized caller buffer panics instead of returning NotEnoughBytes. RdpUdpFlags omits the documented 0x0080 SACK_OPTION bit, and since decode uses from_bits, a peer setting it makes the common header undecodable. TunnelHeader::decode reports truncation as an invalid field and rejects trailing bytes while exposing no framing helper. The ACK-vector decoder rejects non-zero padding the spec does not constrain. Non-blocking: two deep clones per encoded data PDU on the tunnel hot path, an orphan RdpUdpProtocolVersion, self-round-trip-only tests with no spec fixtures, RDP-UDP layered under the rdp module, and a dead length check.
Protocol analysis: partially_accepted — Three of four discrepancies survive verification: the missing RDPUDP_FLAG_SACK_OPTION 0x0080 (confirmed independently by walking the declared bit sequence, which jumps 0x0040 to 0x0100), the zero-padding rejection in RdpUdpAckVector::decode, and truncated tunnel PDUs collapsing into invalid-field. For the last I checked the supporting facts in-tree: ironrdp-core models NotEnoughBytes separately, and this crate already exposes PduHint/find_size framing helpers. read_padding ignoring content likewise supports the ACK-vector point. I downgrade the fourth: is_success comparing to zero deviates from HRESULT severity semantics but matches the existing convention in the same file and Windows behaviour, so it is low. The conforming assessments check out against the diff bytes.
|
I have a complete RDPEUDP and RDPEUDP2 implementation with RDPEMT tunnelling and an async driver, sans-I/O throughout, around 13,000 lines with 364 passing tests. I raised it on #140 in February along with the five upstream seams it needs and a design question about To the review. I am reading it against MS-RDPEUDP and against an implementation that has run against real clients, which is where the findings come from. The common header rejects a spec-defined flag. 2.2.2.1 defines V3 is advertisable and unspeakable. Four flags announce structures that are not defined.
Placement. Every per-protocol crate here owns its PDUs: What is right, since a review that only lists problems is not much use: network byte order is correct, the 2048 byte ACK vector cap matches 2.2.2.7, the DWORD padding is computed against the structure rather than the datagram which is what 2.2.2.7 asks for, and the 1132 to 1232 MTU range is a MUST on both fields so rejecting out-of-range values on decode is defensible. The pieces missing above are the pieces I already have, including the RDPEUDP2 framing, |
|
This pull request is Please split it into focused pull requests that can each be reviewed on their own. When the parts build on each other, stacked pull requests let you open each one on top of the last without waiting for the one below to merge. Stacks require every branch to live in this repository, so from a fork, please open separate pull requests instead. Automated review resumes once the change is below the |
ec2cfa9 to
653ed70
Compare
0dc2e09 to
e2564ae
Compare
653ed70 to
4089cf2
Compare
4089cf2 to
3e85b80
Compare
Add RDP-UDP and RDPEMT wire codecs for the transport foundation. Reject subheaders in RDPEMT create PDUs per the protocol. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Validate complete tunnel capacity before encoding and preserve trailing frames during decoding. Tolerate documented RDP-UDP flags and unspecified ACK padding bytes.
Add the FEC, payload-prefix, ACK-of-ACK, correlation, and extended SYN codecs. Keep source-payload parsing header-only so callers retain the following payload bytes.
2e0cf34 to
720d881
Compare
Add RDP-UDP and RDPEMT wire codecs for the transport foundation.
Support FEC, ACK-of-ACK, correlation ID, and extended SYN headers while preserving source-payload framing boundaries and rejecting invalid RDPEMT create-PDU subheaders.