Commit Graph

473 Commits

Author SHA1 Message Date
Benoît CORTIER bc130ade3b WIP 2023-12-06 23:58:04 -05:00
Benoît Cortier bd8df6dd1c refactor: clarify features exposed by ironrdp-tls (#325) 2023-12-05 22:24:33 -05:00
Benoît Cortier d47f181783 chore(xtask): make clean action delete local cargo root (#323) 2023-12-05 20:15:44 -05:00
Benoît Cortier 4a54d78cf6 chore(xtask): use cargo-binstall if available (#324) 2023-12-05 19:56:53 -05:00
Benoît Cortier 4506e1b185 build: bump rust toolchain to 1.74.0 (#322) 2023-12-05 19:55:51 -05:00
Benoît Cortier 2384a70916 chore: add getting help section in README (#321) 2023-12-05 20:47:22 +00:00
Isaiah Becker-Mayer 6588f7cdc7 refactor: function! macro for error context (#317)
Deletes any now-superfluous `const NAME: &'static str = "name";` definitions.

This gives a path to the function that is being called, which is useful
for debugging errors. It replaces the necessity of implementing
`const NAME: &'static str = "name";` in every function that wants to
use these macros (or coming up with a custom context).
2023-12-05 18:44:17 +00:00
Benoît Cortier 9355ae5b3d refactor: follow-up for PR #198 (#320) 2023-12-05 17:18:09 +00:00
Marc-André Lureau b611cda9b2 feat: add simple server example
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 53967a6bb0 feat(server): use SetSurfaceBits if possible
mstsc does not display bitmap update, for some reason. Using
SetSurfaceBits instead solves it, and is required for more advanced codecs.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 06dbe8008b feat(server): pass the surface flags to the UpdateEncoder
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
Marc-André Lureau 58a5d396a3 feat(server): check the client supports fastpath
It's needed for bitmap & surface commands etc.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-12-05 11:37:18 -05:00
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