diff --git a/apps/desktop/desktop_native/ssh_agent/src/protocol/agent_listener.rs b/apps/desktop/desktop_native/ssh_agent/src/protocol/agent_listener.rs index 28e96d458a0..bb93cfc7bf4 100644 --- a/apps/desktop/desktop_native/ssh_agent/src/protocol/agent_listener.rs +++ b/apps/desktop/desktop_native/ssh_agent/src/protocol/agent_listener.rs @@ -119,7 +119,7 @@ async fn handle_connection( } Request::SessionBind(request) => { span.in_scope(|| info!("Received SessionBind {:?}", request)); - connection.set_host_key(request.host_key().clone()); + connection.set_host_key(request.host_key()); info!( "Bound connection {} to host {:?}", connection.id(), diff --git a/apps/desktop/desktop_native/ssh_agent/src/protocol/connection.rs b/apps/desktop/desktop_native/ssh_agent/src/protocol/connection.rs index a67e3e50a63..5b806868b30 100644 --- a/apps/desktop/desktop_native/ssh_agent/src/protocol/connection.rs +++ b/apps/desktop/desktop_native/ssh_agent/src/protocol/connection.rs @@ -57,7 +57,7 @@ impl ConnectionInfo { self.host_name.as_ref() } - pub fn set_host_key(&mut self, host_key: PublicKey) { + pub fn set_host_key(&mut self, host_key: &PublicKey) { self.host_key = Some(host_key.clone()); // Some systems (flatpak, macos sandbox) may prevent access to the known hosts file. if let Ok(hosts) = knownhosts::KnownHostsReader::read_default() {