From e6766062b1d460f7bdffd11e87712fcab2631f00 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Wed, 25 Mar 2026 11:28:46 -0400 Subject: [PATCH] fix: MCP startup panic + RDP crypto provider panic MCP: RdpService had a manual Clone impl that called unreachable!(). Replaced with a real clone that shares the DashMap. MCP server can now clone all services and start successfully. RDP: rustls needs CryptoProvider::install_default() before any TLS operations. ironrdp-tls uses rustls for the RDP TLS handshake. Added aws_lc_rs provider installation at app startup. Both panics found via wraith.log debug logging from v1.6.3. Co-Authored-By: Claude Opus 4.6 (1M context) --- src-tauri/src/lib.rs | 3 +++ src-tauri/src/rdp/mod.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index ae73a24..15282ae 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -112,6 +112,9 @@ fn write_log(path: &std::path::Path, msg: &str) -> std::io::Result<()> { #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { + // Install rustls crypto provider before any TLS operations (RDP needs this) + let _ = tokio_rustls::rustls::crypto::aws_lc_rs::default_provider().install_default(); + // Initialize file-based logging to data_dir/wraith.log let log_path = data_directory().join("wraith.log"); let _ = write_log(&log_path, "=== Wraith starting ==="); diff --git a/src-tauri/src/rdp/mod.rs b/src-tauri/src/rdp/mod.rs index 48c0b13..e049302 100644 --- a/src-tauri/src/rdp/mod.rs +++ b/src-tauri/src/rdp/mod.rs @@ -269,7 +269,7 @@ impl RdpService { impl Clone for RdpService { fn clone(&self) -> Self { - unreachable!("RdpService should not be cloned — access via State"); + Self { sessions: self.sessions.clone() } } }