-
Notifications
You must be signed in to change notification settings - Fork 126
feat(client): support HyperV VM Connect #796
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
Changes from all commits
f79954c
41ad74d
64f4f3c
9ebe578
84745e5
4989e42
43f09e6
ba4537c
36a6217
4376c6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,7 +148,7 @@ async fn connect( | |
|
||
let should_upgrade = ironrdp_tokio::connect_begin(&mut framed, &mut connector).await?; | ||
|
||
debug!("TLS upgrade"); | ||
debug!(destination = ?config.destination,"TLS upgrade"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: Add a |
||
|
||
// Ensure there is no leftover | ||
let (initial_stream, leftover_bytes) = framed.into_inner(); | ||
|
@@ -292,25 +292,30 @@ where | |
{ | ||
// RDCleanPath request | ||
|
||
let connector::ClientConnectorState::ConnectionInitiationSendRequest = connector.state else { | ||
return Err(connector::general_err!("invalid connector state (send request)")); | ||
}; | ||
match connector.state { | ||
connector::ClientConnectorState::ConnectionInitiationSendRequest { .. } => { | ||
let written = connector.step_no_input(&mut buf)?; | ||
let x224_pdu_len = written.size().expect("written size"); | ||
debug_assert_eq!(x224_pdu_len, buf.filled_len()); | ||
let x224_pdu = buf.filled().to_vec(); | ||
|
||
let rdcleanpath_req = | ||
ironrdp_rdcleanpath::RDCleanPathPdu::new_x224_request(x224_pdu, destination, proxy_auth_token) | ||
.map_err(|e| connector::custom_err!("new RDCleanPath request", e))?; | ||
debug!(message = ?rdcleanpath_req, "Send RDCleanPath request"); | ||
let rdcleanpath_req = rdcleanpath_req | ||
.to_der() | ||
.map_err(|e| connector::custom_err!("RDCleanPath request encode", e))?; | ||
rdcleanpath_req | ||
} | ||
connector::ClientConnectorState::PreconnectionBlob { .. } => {} | ||
_ => { | ||
return Err(connector::general_err!("invalid connector state (send request)")); | ||
} | ||
} | ||
|
||
debug_assert!(connector.next_pdu_hint().is_none()); | ||
|
||
let written = connector.step_no_input(&mut buf)?; | ||
let x224_pdu_len = written.size().expect("written size"); | ||
debug_assert_eq!(x224_pdu_len, buf.filled_len()); | ||
let x224_pdu = buf.filled().to_vec(); | ||
|
||
let rdcleanpath_req = | ||
ironrdp_rdcleanpath::RDCleanPathPdu::new_request(x224_pdu, destination, proxy_auth_token, pcb) | ||
.map_err(|e| connector::custom_err!("new RDCleanPath request", e))?; | ||
debug!(message = ?rdcleanpath_req, "Send RDCleanPath request"); | ||
let rdcleanpath_req = rdcleanpath_req | ||
.to_der() | ||
.map_err(|e| connector::custom_err!("RDCleanPath request encode", e))?; | ||
|
||
framed | ||
.write_all(&rdcleanpath_req) | ||
.await | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,6 +187,8 @@ pub struct Config { | |
pub no_server_pointer: bool, | ||
pub pointer_software_rendering: bool, | ||
pub performance_flags: PerformanceFlags, | ||
|
||
pub vmconnect: Option<String>, | ||
Comment on lines
+190
to
+191
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: I don’t think we should expose a |
||
} | ||
|
||
ironrdp_core::assert_impl!(Config: Send, Sync); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -578,6 +578,12 @@ impl<'a> WriteCursor<'a> { | |
self.pos | ||
} | ||
|
||
/// Returns the number of bytes written. | ||
#[inline] | ||
pub const fn bytes_written(&self) -> usize { | ||
self.pos | ||
} | ||
Comment on lines
+581
to
+585
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: Remove this method. You can use |
||
|
||
/// Write an array of bytes to the buffer. | ||
#[inline] | ||
#[track_caller] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,6 +313,9 @@ impl Encode for ExtendedClientOptionalInfo { | |
dst.write_array(reconnect_cookie); | ||
} | ||
|
||
dst.write_u16(0); // reserved1 | ||
dst.write_u16(0); // reserved2 | ||
irvingoujAtDevolution marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+316
to
+317
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: Did you fix a bug? Could you elaborate on that? Please, open a separate PR dedicated to this with a |
||
|
||
Ok(()) | ||
} | ||
|
||
|
@@ -336,6 +339,8 @@ impl Encode for ExtendedClientOptionalInfo { | |
size += RECONNECT_COOKIE_LENGTH_SIZE + RECONNECT_COOKIE_LEN; | ||
} | ||
|
||
size += 2 * 2; // reserved1 and reserved2 | ||
|
||
size | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: I think you could use a
Uuid
type here