Commit 5d521e7
committed
feat(pdu): add arbitrary feature for structure-aware fuzzing
Wires the `arbitrary` feature on `ironrdp-pdu` and adjusts the existing
`ironrdp-connector` cascade so it composes correctly. This unblocks
structure-aware fuzz harnesses that generate valid-looking PDU inputs
rather than raw bytes.
`ironrdp-pdu`:
- `arbitrary = ["alloc", "dep:arbitrary", "bitflags/arbitrary"]` in the
feature table, with `bitflags = "2.11"` clean in the dependency table
so the cascade is truly optional.
- `#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]` on
PDU structs and enums across gcc, mcs, nego, capability_sets,
client_info, server_license, autodetect, finalization_messages,
session_info, suppress_output, refresh_rectangle, server_error_info,
multitransport, headers, input, basic_output, codecs/rfx, vc/dvc/gfx.
- Hand-rolled `Arbitrary` for `ChannelName` to preserve the
null-terminated 8-byte wire-format invariant.
- `ServerLicenseError` and similar error enums carrying foreign types
(`io::Error`, `FromUtf8Error`, `x509_cert::der::Error`, `PduError`)
are intentionally not annotated, with inline comments noting the
reason.
`ironrdp-connector`:
- Cascade adjusted to `arbitrary = ["dep:arbitrary", "ironrdp-pdu/arbitrary"]`.
- `static_channels` on `ConnectionResult` and `ClientConnector` skipped
via `#[cfg_attr(feature = "arbitrary", arbitrary(default))]` with
inline rationale (StaticChannelSet is keyed by TypeId).
- `license_cache: Option<Arc<dyn LicenseCache>>` on `Config` skipped
similarly with `arbitrary(default)`.
- `LicenseExchangeSequence` hand-rolled with `NoopLicenseCache`
placeholder so the license-exchange surface stays reachable under
fuzz, with inline note that cache-dependent paths are not exercised.
- `ConnectorErrorKind` intentionally not annotated (carries `sspi::Error`).
Documentation:
- `fuzz/README.md` gains a section on building with the `arbitrary`
feature and the categories of types that opt out.
- `crates/ironrdp-pdu/README.md` gains a `## Feature Flags` section.
Verification matrix:
- `cargo fmt --all -- --check` clean
- `cargo check -p ironrdp-pdu --features arbitrary` succeeds
- `cargo check -p ironrdp-pdu --features arbitrary,std` succeeds
- `cargo check -p ironrdp-pdu --no-default-features --features arbitrary,alloc` succeeds
- `cargo check -p ironrdp-pdu` (default features) succeeds
- `cargo check -p ironrdp-connector --features arbitrary` succeeds
- `cargo xtask check fmt` clean
- `cargo xtask check lints` clean (warnings are pre-existing duplicates)
- `cargo xtask check typos` clean
Closes #1121.1 parent df0bf9c commit 5d521e7
87 files changed
Lines changed: 469 additions & 5 deletions
File tree
- crates
- ironrdp-connector
- src
- ironrdp-pdu
- src
- basic_output
- bitmap
- fast_path
- pointer
- surface_commands
- codecs/rfx
- gcc
- core_data
- input
- rdp
- capability_sets
- bitmap_cache
- bitmap_codecs
- brush
- general
- glyph_cache
- offscreen_bitmap_cache
- order
- sound
- virtual_channel
- server_license
- client_new_license_request
- client_platform_challenge_response
- licensing_error_message
- server_license_request
- server_platform_challenge
- server_upgrade_license
- session_info
- vc
- dvc/gfx
- graphics_messages
- fuzz
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
122 | 120 | | |
123 | 121 | | |
124 | 122 | | |
125 | | - | |
126 | 123 | | |
127 | 124 | | |
128 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
233 | 236 | | |
234 | 237 | | |
235 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
236 | 244 | | |
237 | 245 | | |
238 | 246 | | |
| |||
296 | 304 | | |
297 | 305 | | |
298 | 306 | | |
| 307 | + | |
299 | 308 | | |
300 | 309 | | |
301 | 310 | | |
| |||
342 | 351 | | |
343 | 352 | | |
344 | 353 | | |
| 354 | + | |
| 355 | + | |
345 | 356 | | |
346 | 357 | | |
347 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| |||
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
69 | 91 | | |
70 | 92 | | |
71 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
471 | 480 | | |
472 | 481 | | |
473 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
| 202 | + | |
200 | 203 | | |
201 | 204 | | |
202 | 205 | | |
| |||
267 | 270 | | |
268 | 271 | | |
269 | 272 | | |
| 273 | + | |
270 | 274 | | |
271 | 275 | | |
272 | 276 | | |
| |||
276 | 280 | | |
277 | 281 | | |
278 | 282 | | |
| 283 | + | |
279 | 284 | | |
280 | 285 | | |
281 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| 120 | + | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| |||
217 | 219 | | |
218 | 220 | | |
219 | 221 | | |
| 222 | + | |
220 | 223 | | |
221 | 224 | | |
222 | 225 | | |
| |||
329 | 332 | | |
330 | 333 | | |
331 | 334 | | |
| 335 | + | |
332 | 336 | | |
333 | 337 | | |
334 | 338 | | |
| |||
375 | 379 | | |
376 | 380 | | |
377 | 381 | | |
| 382 | + | |
378 | 383 | | |
379 | 384 | | |
380 | 385 | | |
| |||
394 | 399 | | |
395 | 400 | | |
396 | 401 | | |
| 402 | + | |
397 | 403 | | |
398 | 404 | | |
399 | 405 | | |
| |||
404 | 410 | | |
405 | 411 | | |
406 | 412 | | |
| 413 | + | |
407 | 414 | | |
408 | 415 | | |
409 | 416 | | |
| |||
0 commit comments