10000 feat(client): introduce ironrdp-vmconnect by irvingoujAtDevolution · Pull Request #806 · Devolutions/IronRDP · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(client): introduce ironrdp-vmconnect #806

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
16 changes: 14 additions & 2 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,4 @@ opt-level = 3
# FIXME: We need to catch up with Diplomat upstream again, but this is a significant amount of work.
# In the meantime, we use this forked version which fixes an undefined behavior in the code expanded by the bridge macro.
diplomat = { git = "https://github.com/CBenoit/diplomat", rev = "6dc806e80162b6b39509a04a2835744236cd2396" }
sspi = { git = "https://github.com/Devolutions/sspi-rs", branch = "for-temporary-vmconnect-demo" }
5 changes: 4 additions & 1 deletion crates/ironrdp-async/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ where
server_public_key,
network_client,
kerberos_config,
false, // use_vmconnect
)
.await?;
}
Expand Down Expand Up @@ -106,14 +107,15 @@ async fn resolve_generator(
}

#[instrument(level = "trace", skip_all)]
async fn perform_credssp_step<S>(
pub async fn perform_credssp_step<S>(
framed: &mut Framed<S>,
connector: &mut ClientConnector,
buf: &mut WriteBuf,
server_name: ServerName,
server_public_key: Vec<u8>,
mut network_client: Option<&mut dyn AsyncNetworkClient>,
kerberos_config: Option<KerberosConfig>,
use_vmconnect: bool,
) -> ConnectorResult<()>
where
S: FramedRead + FramedWrite,
Expand All @@ -132,6 +134,7 @@ where
server_name,
server_public_key,
kerberos_config,
use_vmconnect,
)?;

loop {
Expand Down
2 changes: 2 additions & 0 deletions crates/ironrdp-blocking/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ where
server_name,
server_public_key,
kerberos_config,
// TODO: implement vmconnect support for ironrdp-blocking
false,
)?;

loop {
Expand Down
1 change: 1 addition & 0 deletions crates/ironrdp-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ironrdp-rdpsnd-native = { path = "../ironrdp-rdpsnd-native", version = "0.3" }
ironrdp-tls = { path = "../ironrdp-tls", version = "0.1" }
ironrdp-tokio = { path = "../ironrdp-tokio", version = "0.4", features = ["reqwest"] }
ironrdp-rdcleanpath.path = "../ironrdp-rdcleanpath"
ironrdp-vmconnect.path = "../ironrdp-vmconnect"

# Windowing and rendering
winit = { version = "0.30", features = ["rwh_06"] }
Expand Down
41 changes: 41 additions & 0 deletions crates/ironrdp-client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub struct Config {
pub connector: connector::Config,
pub clipboard_type: ClipboardType,
pub rdcleanpath: Option<RDCleanPathConfig>,
pub pcb: Option<PreconnectionBlobPayload>,
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
Expand Down Expand Up @@ -238,6 +239,36 @@ struct Args {
/// The bitmap codecs to use (remotefx:on, ...)
#[clap(long, value_parser, num_args = 1.., value_delimiter = ',')]
codecs: Vec<String>,

/// The ID for the HyperV VM server to connect to
#[clap(long, value_parser)]
vmconnect: Option<String>,

/// Preconnection Blob payload to use, cannot be used with `--vmconnect`
#[clap(long, value_parser)]
pcb: Option<String>,
}

#[de 6D40 rive(Debug, Clone, PartialEq, Eq)]
pub enum PreconnectionBlobPayload {
General(String),
VmConnect(String),
}

impl PreconnectionBlobPayload {
pub fn general(&self) -> Option<&str> {
match self {
PreconnectionBlobPayload::General(pcb) => Some(pcb),
PreconnectionBlobPayload::VmConnect(_) => None,
}
}

pub fn vmconnect(&self) -> Option<&str> {
match self {
PreconnectionBlobPayload::VmConnect(vm_id) => Some(vm_id),
PreconnectionBlobPayload::General(_) => None,
}
}
}

impl Config {
Expand Down Expand Up @@ -351,12 +382,22 @@ impl Config {
.zip(args.rdcleanpath_token)
.map(|(url, auth_token)| RDCleanPathConfig { url, auth_token });

let pcb = match (args.vmconnect, args.pcb) {
(Some(_), Some(_)) => {
anyhow::bail!("Cannot use both --vmconnect and --pcb options. Choose one of them.");
}
(Some(vm_id), None) => Some(PreconnectionBlobPayload::VmConnect(vm_id)),
(None, Some(pcb)) => Some(PreconnectionBlobPayload::General(pcb)),
(None, None) => None,
};

Ok(Self {
log_file: args.log_file,
destination,
connector,
clipboard_type,
rdcleanpath,
pcb,
})
}
}
Loading
0