Commit Graph

461 Commits

Author SHA1 Message Date
Marc-André Lureau 00ba7ad94d feat(server): advertize support for all surface commands
Those flags are set both by client and server. Even if the server
doesn't send those commands yet, this should be supported by most
clients.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 8776ec97c7 feat(acceptor): add basic static channel handling
Only accept channels we have attached.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 5742852d60 feat(svc): add StaticChannelSet::get_by_channel_name()
Used by the next patch during server negotiation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau fa85584658 fix(server): handle only IO data at this point
Support for other channel messages is currently lacking.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau ad20697051 feat(acceptor): add {io,user}_channel_id in AcceptorResult
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 1c516e0026 misc(session): simplify a bit the code
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau e6b923fabe misc(pdu): log pdu_type on error
To ease debugging scenario.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau fadb0f14d3 feat(pdu): teach ShareDataPdu about RefreshRectangle
Even when the server doesn't advertize its support, msctc sends this.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 084fcaf289 feat(pdu): teach ShareDataPdu about SuppressOutput
Even when the server doesn't advertize its support, msctc sends this.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 3e47129eef fix(server): use nz/u16 for bitmap update region
Use u16 since that's the limit for resolution and bitmap data.

Use non-zero types for width & height, to avoid various issues, such as
division by zero.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 5ca81cca85 fix(acceptor): use good default for FontPdu
Fixes some warnings produced by FreeRDP when receiving the message.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 6bf638e200 feat(pdu): impl Default for FontPdu
Follow the spec to set good default values.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 950e88688c fix(server): fix fragmentation
The fragment index is not correctly updated, staying at 0, making
invalid series of First/First/..Last.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 3467579ffe feat(server): handle ShareDataPdu::ShutdownRequest
That PDU is sent by mstsc on disconnect.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 1a91c455a5 feat(pdu): teach ShareDataPdu about ShutdownRequest
Then the server can handle it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau b0e0dd456e fix(server): advertize smaller FPU
u32::MAX is too large for mstsc, it fails to connect.
See also: https://github.com/Devolutions/IronRDP/issues/318

16Mb is the value use by freerdp
sample/server (https://github.com/FreeRDP/FreeRDP/pull/1313) and it's
probably fine for now.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau b6b509588c fix(server): keep running after a connection error
Simply report an error!() instead of returning an Error back.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 732e995509 fix(pdu): fix connectPDU length
Wireshark is unhappy about it and throws a "Malformed packet" error.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau d14f96cd61 fix(pdu): display the unexpected value with the error
This provides more useful errors:

Error: [invalid payload] PDU error

Caused by:
    [SendDataRequest] invalid message type (8)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau dca40613f6 feat(connector): warn on unexpected protocol version
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau d81ca56f31 feat(pdu): export PROTOCOL_VER
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 4d0246c9b1 fix(pdu): accept various protocol version
Since FreeRDP commit
7cef0cb8d6cfc2307af967a851f44ad6c376a24d ("Refactored capability
parsing"), protocol version default to 0. This is probably an issue
there, but IronRDP can also be tolerant here...

Add a new "protocol_version" field in the General capability structure,
so that client code can check the version and report an error if they
need to.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 1c220581de feat(pdu): impl Default for General capability sets
This allows to simplify some user code, and let us introduce a
"protocol_version" field in the next patch without having to explicitly
set its value but rely on the default instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau a513701173 fix(pdu): accept unknown capability flags
Be tolerant when parsing unknown flags.

Related to:
https://github.com/Devolutions/IronRDP/issues/217

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 74e40b88cb feat(pdu): add EarlyCapability SKIP_CHANNELJOIN flags
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
dependabot[bot] b87627b10e build(deps): bump the patch group with 1 update (#319)
Bumps the patch group with 1 update: [clap](https://github.com/clap-rs/clap).

- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.10...v4.4.11)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-04 23:35:47 +00:00
Isaiah Becker-Mayer f5f5e9c087 feat(rdpdr): LockControl handling (#313)
- Add a new `UnsupportedPdu` kind to `PduError`, enhancing error handling capabilities in ironrdp-pdu.
  This new error kind allows for more specific error messages when encountering unsupported PDUs.
- Implement a macro `unsupported_pdu_err` for conveniently creating `PduError` instances with the `UnsupportedPdu` kind.
- Implement handling for `ServerDriveLockControlRequest` in ironrdp-rdpdr, including the definition of
  the struct and its decoding method. This adds support for processing lock control requests in the RDPDR protocol.
- Update `Rdpdr`'s `process` method to utilize the new `unsupported_pdu_err` when encountering unknown packet IDs, replacing the previous handling of unimplemented PDUs.
- Remove the `Unimplemented` variant from `RdpdrPdu` and `Component` enums, replacing it with `EmptyResponse` in `RdpdrPdu`.
  This change streamlines the handling of unimplemented or unexpected PDUs.
- Enhance `FileInformationClass` and `FileInformationClassLevel` with `Display` implementations, providing better logging and error message capabilities.
2023-12-01 23:58:52 +00:00
Vladyslav Nikonov d69ff6e6e7 ci: follow-up typos CI fixes (#316) 2023-12-01 14:24:34 -05:00
Vladyslav Nikonov 4258f06292 ci: check for typos using typos-cli (#315) 2023-12-01 17:27:36 +00:00
Isaiah Becker-Mayer 6aa3f3e63b feat(rdpdr): SetInformation* handling (#312)
- Extend ReadCursor with methods to read and try reading i64 values in both little and big endian formats.
- Update RdpdrPdu to handle ClientDriveSetInformationResponse, reflecting the addition of ServerDriveSetInformationRequest handling in the RDPDR (Remote Desktop Protocol: Device Redirection) protocol.
- Implement decoding and encoding of various FileInformationClass types such as FileEndOfFileInformation, FileDispositionInformation, FileRenameInformation, and FileAllocationInformation.
- Refactor the existing code to improve the handling of different FileInformationClassLevels and FileSystemInformationClassLevels.
- Add handling for ServerDriveNotifyChangeDirectoryRequest in ServerDriveIoRequest, supporting the specific case when MinorFunction is set to IRP_MN_NOTIFY_CHANGE_DIRECTORY.
2023-11-29 17:38:01 +00:00
Vladyslav Nikonov b554c6a6d1 fix(rfx): invalid rectangle intersection logic (#311)
This fixes the RFX visual artifacts.
2023-11-28 10:18:38 -05:00
dependabot[bot] ed31ead9d3 build(deps): bump url from 2.4.1 to 2.5.0 (#309)
Bumps [url](https://github.com/servo/rust-url) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.4.1...v2.5.0)

---
updated-dependencies:
- dependency-name: url
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-27 23:49:29 +00:00
dependabot[bot] 045956060e build(deps): bump the patch group with 4 updates (#308)
Bumps the patch group with 4 updates: [clap](https://github.com/clap-rs/clap), [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen), [wasm-bindgen-futures](https://github.com/rustwasm/wasm-bindgen) and [base64](https://github.com/marshallpierce/rust-base64).


Updates `clap` from 4.4.8 to 4.4.9
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.8...v4.4.9)

Updates `wasm-bindgen` from 0.2.88 to 0.2.89
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.88...0.2.89)

Updates `wasm-bindgen-futures` from 0.4.38 to 0.4.39
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Updates `base64` from 0.21.4 to 0.21.5
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.21.4...v0.21.5)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: wasm-bindgen
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: wasm-bindgen-futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: base64
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-27 23:49:12 +00:00
Benoît Cortier 96979ef81d chore(release): also update public package.json (#305) 2023-11-27 17:03:10 +00:00
irvingouj @ Devolutions e6518af4fd chore(release): prepare iron-remote-gui for 0.11.1 (#304) 2023-11-27 16:52:03 +00:00
irvingouj @ Devolutions a5747f3661 fix done,includes rxjs (#303) 2023-11-27 11:31:18 -05:00
Benoît Cortier 2b254c2869 chore(release): prepare web client for 0.11.0 (#302) 2023-11-24 21:10:24 +00:00
irvingouj@Devolutions 716f5c5e05 build(web-client): roll up and export correct TS types (#301) 2023-11-24 14:28:00 -05:00
Isaiah Becker-Mayer 078aa433c2 feat(rdpdr): add DeviceWrite{Request,Response} (#299)
- Added DeviceWriteRequest and DeviceWriteResponse support in RDPDR.
- Included handling for new write requests and responses in ServerDriveIoRequest.
- Updated RdpdrPdu to manage DeviceWriteResponse alongside read and other responses.
- Enhanced processing logic to handle unexpected packets for device write actions.
2023-11-22 23:30:48 -05:00
Isaiah Becker-Mayer 781cfcb18b feat(rdpdr): support for DeviceRead{Request,Response} (#298)
- Implemented `DeviceReadRequest` and `DeviceReadResponse` PDUs in `ironrdp-rdpdr`.
- Updated `RdpdrPdu` enum to include `DeviceReadResponse`.
- Modified decoding logic in `ServerDriveIoRequest` to handle `MajorFunction::Read`.
- Streamlined error handling for unexpected packets in `StaticVirtualChannelProcessor`.
- Refactored `ensure_size` checks to `ensure_fixed_part_size` in `efs.rs` for improved consistency.
2023-11-22 19:55:19 -05:00
Isaiah Becker-Mayer bca685f43b feat(rdpdr): enhance DeviceControlResponse and add AnyIoCtlCode (#297)
- Introduced `AnyIoCtlCode` to handle cases with unknown or non-critical IoCtlCode.
- Updated `DeviceControlResponse` to accept an optional `output_buffer`, aligning with FreeRDP's implementation for empty buffer scenarios.
- Implemented decoding for `DeviceControlRequest<AnyIoCtlCode>` in `ServerDriveIoRequest`.
2023-11-23 00:14:17 +00:00
Isaiah Becker-Mayer 25f49133d3 feat(rdpdr): ServerDriveQueryVolumeInformation{Request,Response} (#296)
- Added support for ServerDriveQueryVolumeInformationRequest in the RDPDR EFS module.
- Implemented decoding logic for ServerDriveQueryVolumeInformationRequest with checks for valid FileSystemInformationClassLevels.
- Extended the RdpdrPdu enum to include ClientDriveQueryVolumeInformationResponse.
- Implemented ClientDriveQueryVolumeInformationResponse with appropriate encoding and sizing methods.
- Updated Rdpdr handling to accommodate the new ClientDriveQueryVolumeInformationResponse type.
2023-11-22 15:56:22 -05:00
Benoît Cortier 32910b3a11 chore(release): prepare web client for 0.10.0 (#294) 2023-11-21 16:35:19 -05:00
dependabot[bot] 6ad640d904 build(deps): bump rustix from 0.38.17 to 0.38.25 (#295)
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.17 to 0.38.25.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.17...v0.38.25)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-21 21:29:40 +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
Isaiah Becker-Mayer 723a91a432 feat(rdpdr): QueryDirectory structures for directory control (#288)
- Added a new method write_i8 to WriteCursor in ironrdp-pdu/src/cursor.rs,
allowing for writing an 8-bit integer value to the cursor.

- Updated Rdpdr in ironrdp-rdpdr/src/lib.rs to handle an additional case
for ClientDriveQueryDirectoryResponse in the error handling logic.

- Introduced several new structures in ironrdp-rdpdr/src/pdu/efs.rs related
 to directory information, including FileBothDirectoryInformation,
 FileFullDirectoryInformation, FileNamesInformation, and
 FileDirectoryInformation.

- Added support for the ClientDriveQueryDirectoryResponse PDU in various
parts of ironrdp-rdpdr, including the RdpdrPdu enum and its implementation.

- Added a ServerDriveQueryDirectoryRequest structure to handle server
requests for querying directory information, along with the necessary
encoding logic.

- Added a ClientDriveQueryDirectoryResponse structure to handle client
responses for directory queries, along with the necessary encoding logic.

- Updated the RDPDR PDU encoding and size calculation methods to support
the new ClientDriveQueryDirectoryResponse structure.
2023-11-20 21:15:32 -05:00
dependabot[bot] 6153f68b8d build(deps): bump the crypto group with 1 update (#291)
Bumps the crypto group with 1 update: [rustls](https://github.com/rustls/rustls).

- [Release notes](https://github.com/rustls/rustls/releases)
- [Commits](https://github.com/rustls/rustls/compare/v/0.21.8...v/0.21.9)

---
updated-dependencies:
- dependency-name: rustls
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: crypto
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-20 18:55:07 -05:00
dependabot[bot] 4feb51909a build(deps): bump proptest from 1.3.1 to 1.4.0 (#292)
Bumps [proptest](https://github.com/proptest-rs/proptest) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/proptest-rs/proptest/releases)
- [Changelog](https://github.com/proptest-rs/proptest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/proptest-rs/proptest/compare/v1.3.1...v1.4.0)

---
updated-dependencies:
- dependency-name: proptest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-20 18:54:33 -05:00
Benoît CORTIER 08d165d71f style(cliprdr): prefer < over > 2023-11-20 09:39:36 -05:00
Benoît CORTIER 82d7977672 style(cliprdr): clarify invariants 2023-11-20 09:39:36 -05:00