Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update IronRDP to latest, fix key log leak #35707

Merged
merged 3 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ codegen-units = 1
[workspace.dependencies]
# Note: To use a local IronRDP repository as a crate (for example, ironrdp-cliprdr), define the dependency as follows:
# ironrdp-cliprdr = { path = "/path/to/local/IronRDP/crates/ironrdp-cliprdr" }
ironrdp-cliprdr = { git = "https://github.com/Devolutions/IronRDP", rev = "6588f7cdc71cbaa24ae6d18b7f8d0d3ed48c1377" }
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "6588f7cdc71cbaa24ae6d18b7f8d0d3ed48c1377" }
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "6588f7cdc71cbaa24ae6d18b7f8d0d3ed48c1377" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "6588f7cdc71cbaa24ae6d18b7f8d0d3ed48c1377" }
ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "6588f7cdc71cbaa24ae6d18b7f8d0d3ed48c1377" }
ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "6588f7cdc71cbaa24ae6d18b7f8d0d3ed48c1377" }
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "6588f7cdc71cbaa24ae6d18b7f8d0d3ed48c1377" }
ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "6588f7cdc71cbaa24ae6d18b7f8d0d3ed48c1377" }
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "6588f7cdc71cbaa24ae6d18b7f8d0d3ed48c1377" }
ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "6588f7cdc71cbaa24ae6d18b7f8d0d3ed48c1377" }
ironrdp-cliprdr = { git = "https://github.com/Devolutions/IronRDP", rev = "d24000a2aeab74f2610a0b01c629f7a4ef3c77ef" }
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "d24000a2aeab74f2610a0b01c629f7a4ef3c77ef" }
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "d24000a2aeab74f2610a0b01c629f7a4ef3c77ef" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "d24000a2aeab74f2610a0b01c629f7a4ef3c77ef" }
ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "d24000a2aeab74f2610a0b01c629f7a4ef3c77ef" }
ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "d24000a2aeab74f2610a0b01c629f7a4ef3c77ef" }
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "d24000a2aeab74f2610a0b01c629f7a4ef3c77ef" }
ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "d24000a2aeab74f2610a0b01c629f7a4ef3c77ef" }
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "d24000a2aeab74f2610a0b01c629f7a4ef3c77ef", features = ["rustls"]}
ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "d24000a2aeab74f2610a0b01c629f7a4ef3c77ef" }
2 changes: 1 addition & 1 deletion e
Submodule e updated from e818f2 to aa84b4
4 changes: 2 additions & 2 deletions lib/srv/desktop/rdp/rdpclient/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use ironrdp_connector::{Config, ConnectorError, Credentials};
use ironrdp_pdu::input::fast_path::{FastPathInput, FastPathInputEvent, KeyboardFlags};
use ironrdp_pdu::input::mouse::PointerFlags;
use ironrdp_pdu::input::{InputEventError, MousePdu};
use ironrdp_pdu::nego::SecurityProtocol;
use ironrdp_pdu::rdp::capability_sets::MajorPlatformType;
use ironrdp_pdu::rdp::RdpError;
use ironrdp_pdu::{custom_err, function, PduError, PduParsing};
Expand Down Expand Up @@ -1030,7 +1029,8 @@ type RdpWriteStream = Framed<TokioStream<WriteHalf<TlsStream<TokioTcpStream>>>>;
fn create_config(width: u16, height: u16, pin: String) -> Config {
Config {
desktop_size: ironrdp_connector::DesktopSize { width, height },
security_protocol: SecurityProtocol::SSL,
enable_tls: true,
enable_credssp: false,
credentials: Credentials::SmartCard { pin },
domain: None,
// Windows 10, Version 1909, same as FreeRDP as of October 5th, 2021.
Expand Down
17 changes: 15 additions & 2 deletions lib/srv/desktop/rdp/rdpclient/src/rdpdr/scard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use crate::client::ClientHandle;
use crate::piv;
use crate::{piv, util};
use ironrdp_pdu::utils::CharacterSet;
use ironrdp_pdu::{custom_err, other_err, PduResult};
use ironrdp_rdpdr::pdu::efs::{DeviceControlRequest, DeviceControlResponse, NtStatus};
Expand All @@ -35,7 +35,6 @@ use uuid::Uuid;
/// `ScardBackend` implements the smartcard device redirection backend as described in [\[MS-RDPESC\]: Remote Desktop Protocol: Smart Card Virtual Channel Extension]
///
/// [\[MS-RDPESC\]: Remote Desktop Protocol: Smart Card Virtual Channel Extension]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpesc/0428ca28-b4dc-46a3-97c3-01887fa44a90
#[derive(Debug)]
pub struct ScardBackend {
client_handle: ClientHandle,
/// contexts holds all the active contexts for the server, established using
Expand All @@ -49,6 +48,20 @@ pub struct ScardBackend {
pin: String,
}

impl std::fmt::Debug for ScardBackend {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("ScardBackend")
.field("client_handle", &self.client_handle)
.field("contexts", &self.contexts)
.field("uuid", &self.uuid)
.field("cert_der", &util::vec_u8_debug(&self.cert_der))
// Important we don't leak key_der to the logs.
.field("key_der", &util::vec_u8_debug(&self.key_der))
.field("pin", &self.pin)
.finish()
}
}

impl ScardBackend {
pub fn new(
client_handle: ClientHandle,
Expand Down
4 changes: 4 additions & 0 deletions lib/srv/desktop/rdp/rdpclient/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ pub fn vec_u8_debug(v: &[u8]) -> String {
format!("&[u8] of length {}", v.len())
}

pub fn str_debug(s: &str) -> String {
format!("&str of length {}", s.len())
}

/// # Safety
///
/// s must be a C-style null terminated string.
Expand Down
Loading