Skip to content

Commit 4d5edfa

Browse files
* Update to latest commit of IronRDP.
* resolve conflicting 'getrandom' dependencies. * Add necessary RUSTFLAG env var to ironrdp-wasm compilation. Needed by 'getrandom' dependency to enable its wasm_js feature. * Configure client to use remotefx codec. * Bump rust toolchain version to 1.86.0. * Unset existing rustup overrides before building rdpclient or ironrdp wasm module. * Fix lint warnings after Rust toolchain upgrade.
1 parent 2c8f4bb commit 4d5edfa

File tree

10 files changed

+428
-106
lines changed

10 files changed

+428
-106
lines changed

Cargo.lock

Lines changed: 383 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,19 @@ lto = "thin"
2121
[workspace.dependencies]
2222
# Note: To use a local IronRDP repository as a crate (for example, ironrdp-cliprdr), define the dependency as follows:
2323
# ironrdp-cliprdr = { path = "/path/to/local/IronRDP/crates/ironrdp-cliprdr" }
24-
ironrdp-cliprdr = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
25-
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
26-
ironrdp-core = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
27-
ironrdp-displaycontrol = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
28-
ironrdp-dvc = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
29-
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
30-
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
31-
ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
32-
ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
33-
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
34-
ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
35-
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2", features = [
24+
ironrdp-cliprdr = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
25+
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
26+
ironrdp-core = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
27+
ironrdp-displaycontrol = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
28+
ironrdp-dvc = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
29+
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
30+
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
31+
ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
32+
ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
33+
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
34+
ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
35+
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d", features = [
3636
"rustls",
3737
] }
38-
ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "dd221bf22401c4635798ec012724cba7e6d503b2" }
38+
ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "a0a3e750c9e4ee9c73b957fbcb26dbc59e57d07d" }
39+

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ endif
485485
.PHONY: rdpclient
486486
rdpclient:
487487
ifeq ("$(with_rdpclient)", "yes")
488+
@rustup -q override unset
488489
$(RDPCLIENT_ENV) \
489490
cargo build -p rdp-client $(if $(FIPS),--features=fips) --release --locked $(CARGO_TARGET)
490491
endif
@@ -504,7 +505,8 @@ export ironrdp_package_json
504505
.PHONY: build-ironrdp-wasm
505506
build-ironrdp-wasm: ironrdp = web/packages/shared/libs/ironrdp
506507
build-ironrdp-wasm: ensure-wasm-deps
507-
cargo build --package ironrdp --lib --target $(CARGO_WASM_TARGET) --release
508+
@rustup -q override unset
509+
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' cargo build --package ironrdp --lib --target $(CARGO_WASM_TARGET) --release
508510
wasm-opt target/$(CARGO_WASM_TARGET)/release/ironrdp.wasm -o target/$(CARGO_WASM_TARGET)/release/ironrdp.wasm -O
509511
wasm-bindgen target/$(CARGO_WASM_TARGET)/release/ironrdp.wasm --out-dir $(ironrdp)/pkg --typescript --target web
510512
printenv ironrdp_package_json > $(ironrdp)/pkg/package.json

lib/srv/desktop/rdp/rdpclient/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tokio-boring = { git = "https://github.com/gravitational/boring", rev = "9989730
3737
utf16string = "0.2.0"
3838
uuid = { version = "1.16.0", features = ["v4"] }
3939
url = "2.5.7"
40-
picky = { version = "7.0.0-rc.11", default-features = false }
40+
picky = { version = "7.0.0-rc.17", default-features = false }
4141
picky-asn1-der = "0.5.2"
4242
picky-asn1-x509 = "0.14.6"
4343
reqwest = { version = "0.12", default-features = false }

lib/srv/desktop/rdp/rdpclient/src/client.rs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ use ironrdp_pdu::input::fast_path::{
4545
use ironrdp_pdu::input::mouse::PointerFlags;
4646
use ironrdp_pdu::input::{InputEventError, MousePdu};
4747
use ironrdp_pdu::nego::NegoRequestData;
48-
use ironrdp_pdu::rdp::capability_sets::MajorPlatformType;
49-
use ironrdp_pdu::rdp::client_info::PerformanceFlags;
48+
use ironrdp_pdu::rdp::capability_sets::{
49+
client_codecs_capabilities, BitmapCodecs, MajorPlatformType,
50+
};
51+
use ironrdp_pdu::rdp::client_info::{PerformanceFlags, TimezoneInfo};
5052
use ironrdp_pdu::rdp::RdpError;
5153
use ironrdp_pdu::PduError;
5254
use ironrdp_pdu::PduResult;
@@ -60,7 +62,7 @@ use ironrdp_session::SessionErrorKind::Reason;
6062
use ironrdp_session::{reason_err, SessionError, SessionResult};
6163
use ironrdp_svc::{SvcMessage, SvcProcessor, SvcProcessorMessages};
6264
use ironrdp_tokio::{single_sequence_step_read, Framed, FramedWrite, TokioStream};
63-
use log::debug;
65+
use log::{debug, error};
6466
use rand::{Rng, TryRngCore};
6567
use std::error::Error;
6668
use std::fmt::{Debug, Display, Formatter};
@@ -195,11 +197,11 @@ impl Client {
195197
});
196198
let drdynvc_client = DrdynvcClient::new().with_dynamic_channel(display_control);
197199

198-
let mut connector = ironrdp_connector::ClientConnector::new(connector_config.clone())
199-
.with_server_addr(server_socket_addr)
200-
.with_static_channel(drdynvc_client) // require for resizing
201-
.with_static_channel(Rdpsnd::new(Box::new(NoopRdpsndBackend {}))) // required for rdpdr to work
202-
.with_static_channel(rdpdr); // required for smart card + directory sharing
200+
let mut connector =
201+
ironrdp_connector::ClientConnector::new(connector_config.clone(), server_socket_addr)
202+
.with_static_channel(drdynvc_client) // require for resizing
203+
.with_static_channel(Rdpsnd::new(Box::new(NoopRdpsndBackend {}))) // required for rdpdr to work
204+
.with_static_channel(rdpdr); // required for smart card + directory sharing
203205

204206
if params.allow_clipboard {
205207
connector = connector.with_static_channel(Cliprdr::new(Box::new(
@@ -377,7 +379,6 @@ impl Client {
377379
&mut read_stream,
378380
sequence.as_mut(),
379381
&mut buf,
380-
None,
381382
)
382383
.await?;
383384

@@ -671,7 +672,7 @@ impl Client {
671672
event: FastPathInputEvent,
672673
) -> ClientResult<()> {
673674
write_stream
674-
.write_all(&encode_vec(&FastPathInput(vec![event]))?)
675+
.write_all(&encode_vec(&FastPathInput::single(event))?)
675676
.await?;
676677
Ok(())
677678
}
@@ -1387,6 +1388,8 @@ fn create_config(params: &ConnectParams, pin: String, cgo_handle: CgoHandle) ->
13871388
},
13881389
enable_tls: true,
13891390
enable_credssp: params.ad && params.nla,
1391+
enable_audio_playback: false,
1392+
timezone_info: TimezoneInfo::default(),
13901393
credentials: Credentials::SmartCard {
13911394
config: params.ad.then(|| SmartCardIdentity {
13921395
csp_name: "Microsoft Base Smart Card Crypto Provider".to_string(),
@@ -1413,13 +1416,19 @@ fn create_config(params: &ConnectParams, pin: String, cgo_handle: CgoHandle) ->
14131416
// Changing this to 16 gets us uncompressed bitmaps on machines configured like
14141417
// https://github.com/Devolutions/IronRDP/blob/55d11a5000ebd474c2ddc294b8b3935554443112/README.md?plain=1#L17-L36
14151418
color_depth: 32,
1419+
// Try to congiure the client to use remotefx only. This should never fail in practice, but just in
1420+
// case we'll log an error and fall back to defaults.
1421+
codecs: client_codecs_capabilities(&["remotefx"]).unwrap_or_else(|err| {
1422+
error!("Failed to configure client for remotefx: {}", err);
1423+
BitmapCodecs::default()
1424+
}),
14161425
}),
14171426
dig_product_id: "".to_string(),
14181427
// `client_dir` is apparently unimportant, however most RDP clients hardcode this value (including FreeRDP):
14191428
// https://github.com/FreeRDP/FreeRDP/blob/4e24b966c86fdf494a782f0dfcfc43a057a2ea60/libfreerdp/core/settings.c#LL49C34-L49C70
14201429
client_dir: "C:\\Windows\\System32\\mstscax.dll".to_string(),
14211430
platform: MajorPlatformType::UNSPECIFIED,
1422-
no_server_pointer: false,
1431+
enable_server_pointer: true,
14231432
autologon: true,
14241433
pointer_software_rendering: false,
14251434
// Send the username in the request cookie, which is sent in the initial connection request.

lib/srv/desktop/rdp/rdpclient/src/cliprdr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ impl CliprdrBackend for TeleportCliprdrBackend {
6969
".cliprdr"
7070
}
7171

72+
fn on_ready(&mut self) {}
73+
7274
fn client_capabilities(&self) -> ClipboardGeneralCapabilityFlags {
7375
trace!("CLIPRDR: client_capabilities");
7476
ClipboardGeneralCapabilityFlags::USE_LONG_FORMAT_NAMES

lib/srv/desktop/rdp/rdpclient/src/rdpdr/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl UnixPath {
7575
}
7676

7777
pub fn last(&self) -> Option<&str> {
78-
self.path.split('/').last()
78+
self.path.split('/').next_back()
7979
}
8080
}
8181

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.81.0"
2+
channel = "1.86.0"
33
targets = [ "wasm32-unknown-unknown" ]

web/packages/shared/libs/ironrdp/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ crate-type = ["cdylib"]
1212

1313
[dependencies]
1414
console_error_panic_hook = "0.1.7"
15-
getrandom = { version = "0.2", features = ["js"] }
15+
getrandom1 = { package = "getrandom", version = "0.2", features = ["js"] }
16+
getrandom2 = { package = "getrandom", version = "0.3", features = ["wasm_js"]}
1617
ironrdp-session.workspace = true
1718
ironrdp-pdu.workspace = true
1819
ironrdp-core.workspace = true

web/packages/shared/libs/ironrdp/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl FastPathProcessor {
122122
user_channel_id,
123123
// These should be set to the same values as they're set to in the
124124
// `Config` object in lib/srv/desktop/rdp/rdpclient/src/client.rs.
125-
no_server_pointer: false,
125+
enable_server_pointer: true,
126126
pointer_software_rendering: false,
127127
}
128128
.build(),

0 commit comments

Comments
 (0)