Commit graph

33 commits

Author SHA1 Message Date
Benoît CORTIER
97f4f25813 style: run cargo +nightly fmt 2025-03-13 11:03:10 +01:00
Marc-André Lureau
7cb1ac99d1 refactor(pdu)!: remove RfxChannelWidth and RfxChannelHeight structs
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-03-12 21:34:47 +01:00
Marc-André Lureau
81984f9377 refactor(pdu): move rfx to Encode/Decode traits
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-03-04 16:08:55 +01:00
Benoît CORTIER
294af1cc5c style: cargo +nightly fmt 2024-11-20 01:28:31 +09:00
Marc-André Lureau
402ffd56c9 refactor(core): move Encode/Decode to core
ironrdp-pdu contains lots of code that we don’t actually need in other crates such as the virtual channels.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
ab5760d47b refactor(pdu): add X224 newtype
This allows to implement external Encode/Decode traits in following change.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
23bc008d65 refactor(core): move {Decode/Encode}Error
& document the public API.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
1ef9dd3f37 refactor(pdu): rename PduEncode->Encode PduDecode->Decode
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
b4c4b7ef58 chore(pdu): introduce DecodeResult
Introduce a new error type to split encoding/decoding errors as well as
helper traits and functions to ease porting and conventions.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
00d4750e4b refactor(pdu): rename InvalidMessage->InvalidField
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
7419467ad3 refactor(core): move cursor.rs
Add documentation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-30 00:05:16 -04:00
Marc-André Lureau
da2870506f fix: clippy cast warnings
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-07-24 04:35:32 -04:00
Marc-André Lureau
5945d24df2 fix: elided lifetimes warnings
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-07-24 04:35:32 -04:00
Isaiah Becker-Mayer
fd105e4b56
feat(displaycontrol): hook up resize for ironrdp-client crate (#430) 2024-04-29 22:20:02 +03:00
Marc-André Lureau
31feec5b79 refactor(pdu): convert ShareDataHeader and ShareControl to PduEncode/Decode 2024-03-21 02:43:50 +09:00
Marc-André Lureau
5d0f6ce045 refactor(pdu): convert BER-related PDU to PduEncode/Decode
This patch could be split if we introduce a legacy module for the
transition of the few PDUs.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-03-21 02:43:50 +09:00
Marc-André Lureau
a2a4c89e4f refactor(pdu): convert license exchange PDUs to PduEncode/Decode 2024-03-21 02:43:50 +09:00
Marc-André Lureau
9faf1ff08d refactor(pdu): convert input module to PduEncode/Decode
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-03-21 02:43:50 +09:00
Marc-André Lureau
e88c9af70d refactor(pdu): convert GCC module to PduEncode/Decode
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-03-21 02:43:50 +09:00
Marc-André Lureau
b0dd0677a4 refactor(dvc): switch to PduEncode/Decode
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-03-21 02:43:50 +09:00
Marc-André Lureau
a45deebc98 refactor(pdu): convert RDP module to PduEncode/Decode
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-03-21 02:43:50 +09:00
Benoît Cortier
e92d8c3e17
test: regression test case for cliprdr_format target (#405) 2024-03-08 15:44:12 +00:00
Benoît Cortier
0954f42519
fix(connector): better security protocol selection (#328)
Replace the bitflag-based config API with a boolean-based one:

- `enable_tls`: set the PROTOCOL_SSL flag
- `enable_credssp`: set the PROTOCOL_HYBRID and PROTOCOL_HYBRID_EX flags

The `--security_protocol` argument was removed from the native client
CLI, and instead it’s possible to disable specific protocols with
`--no-tls` and `--no-credssp`. By default, both protocols are
enabled for maximum compatibility with most RDP servers. We may change
the defaults in the future.
2023-12-08 15:59:48 +00:00
Vladyslav Nikonov
5b210f2fc7
feat(web): support for hardware cursor (#290)
Adds support for native cursors for `IronRDP-web`.

- Uses CSS `cursor` property to set the custom cursor (which we encode as Base64 data URL
- Software rendering is still in place and could be enabled via the config flag
- "Inverted colors" are implemented for native cursors as a "checkerboard pattern" (As in FreeRDP)
- Native cursors have size **limitation** - _Any remote cursor bigger than 32x32 will be scaled down._ This is due to browser limitations described [here](https://chromestatus.com/feature/5825971391299584) and [here](https://bugs.chromium.org/p/chromium/issues/detail?id=880863)

Closes #250
2023-11-21 17:20:03 +00:00
Benoît Cortier
6283e37937
refactor: check for additional lints (#200) 2023-10-02 13:46:05 +03:00
Isaiah Becker-Mayer
fe1567c887
feat(rdpdr): DR_CORE_SERVER_CLIENTID_CONFIRM and DR_CORE_DEVICELIST_ANNOUNCE (#193)
Adds handling for `DR_CORE_SERVER_CLIENTID_CONFIRM` and `DR_CORE_DEVICELIST_ANNOUNCE`/`DR_CORE_DEVICELIST_ANNOUNCE_REQ`.
The next steps in the rdpdr initialization sequence.
2023-09-20 18:29:01 -04:00
Benoît CORTIER
2938db416b feat: API for custom static virtual channels
Issue: ARC-147
Co-authored-by: Isaiah Becker-Mayer <isaiah@goteleport.com>
2023-08-26 04:37:13 -04:00
Vladyslav Nikonov
1f401a1350
feat: pointer processing logic (#168)
FastPath pointer messages handling:

- Add pointer messages handling in `ironrdp-session`, `ironrdp-client` and `ironrdp-web`
  - Supported bpp's: 1, 16, 24, 32 (8bpp is not supported yet, palette messages handling
    should be added first)
  - Alpha blending is supported, and done via software-based compositing
  - Inverted cursor pixels are supported (FreeRDP do not support them correctly)
  - Large pointers are supported (FreeRDP crashes on them)
  - Cursor caching is supported
- Add new CLI argument to enable/disable pointer rendering (--no-server-pointer)
- `session`/`client` refactoring to facilitate multiple types of session output updates besides
  framebuffer update (e.g. request to hide/show system pointer on client)
- Minor changes in web client typescript code to hide/show cursor on canvas

Closes #108
2023-08-04 13:55:11 -04:00
Marc-Andre Lureau
e7be7a54e1
fix(pdu): NegoRequestData is optional (#151)
The fields routingToken and cookie are optional.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-06-16 14:08:43 +00:00
Marc-André Moreau
9c3ec78588 fix: GCC client, 16/32bpp, RemoteFX rectangles
Co-authored-by: Benoît CORTIER <bcortier@proton.me>
2023-05-15 23:45:22 -04:00
Benoît CORTIER
cf2287739d refactor: error handling
Base all library errors on `ironrdp_error::Error`, a lightweight and
`no_std`-compatible generic `Error` type.
A custom consumer-defined type (such as `PduErrorKind`) for
domain-specific details is wrapped by this type.
2023-05-15 23:45:22 -04:00
Benoît CORTIER
845e394841 fix(ironrdp-pdu): out of bounds read in mcs module 2023-05-11 19:41:11 -04:00
Benoît CORTIER
60bc72f873 test: organize integration tests into single crate
Put all integration tests in a single crate, and organized in modules.

This is similar to what was done in `cargo` repository:
https://github.com/rust-lang/cargo/pull/5022#issuecomment-364691154

```
$ rustup show
stable-x86_64-unknown-linux-gnu (default)
rustc 1.69.0 (84c898d65 2023-04-16)
```

Run on a recent high-end laptop:
12th Gen Intel(R) Core(TM) i9-12900HK

Original (multiple integration binaries):

- `cargo clean && cargo test --no-run`: 62.893s
- `cargo clean && cargo build --lib`: 54.959s
- `cargo clean && cargo build --bins`: 55.933s
- `cargo test --no-run` (after `cargo build`): 14.472s
- `cargo test` (after `cargo test --no-run`): 1.786s
- `du -hs target/`: 4.2G

After (ironrdp-testsuite):

- `cargo clean && cargo test --no-run`: 41.157s (crates with no tests are ignored)
- `cargo clean && cargo build --lib`: 53.983s
- `cargo clean && cargo build --bins`: 54.482s
- `cargo test --no-run` (after `cargo build`): 12.915s
- `cargo test` (after `cargo test --no-run`): 0.240s
- `du -hs target/`: 3.4G

Absolute diff:
- `cargo clean && cargo test --no-run`: -21.736s
- `cargo clean && cargo build --lib`: -0.976s
- `cargo clean && cargo build --bins`: -1.451s
- `cargo test --no-run` (after `cargo build`): -1.557s
- `cargo test` (after `cargo test --no-run`): -1.546s
- `du -hs target/`: -0.8G

Relative diff (%):
- `cargo clean && cargo test --no-run`: -34.5%
- `cargo clean && cargo build --lib`: -1.77%
- `cargo clean && cargo build --bins`: -2.59%
- `cargo test --no-run` (after `cargo build`): -10.7%
- `cargo test` (after `cargo test --no-run`): -86.5%
- `du -hs target/`: -19.0%
2023-05-11 19:41:11 -04:00