diff --git a/apps/desktop/desktop_native/ssh_agent/src/hostinfo/mod.rs b/apps/desktop/desktop_native/ssh_agent/src/knownhosts/mod.rs similarity index 97% rename from apps/desktop/desktop_native/ssh_agent/src/hostinfo/mod.rs rename to apps/desktop/desktop_native/ssh_agent/src/knownhosts/mod.rs index 7e1aee0bbde..bc6cdbc2a16 100644 --- a/apps/desktop/desktop_native/ssh_agent/src/hostinfo/mod.rs +++ b/apps/desktop/desktop_native/ssh_agent/src/knownhosts/mod.rs @@ -16,9 +16,9 @@ pub struct KnownHostEntry { impl KnownHostEntry { /// Creates a new known host entry - pub fn new(hostnames: String, public_key: PublicKey) -> Self { + pub fn new(hostname: String, public_key: PublicKey) -> Self { Self { - hostname: hostnames, + hostname, public_key, } } diff --git a/apps/desktop/desktop_native/ssh_agent/src/lib.rs b/apps/desktop/desktop_native/ssh_agent/src/lib.rs index 1ecb2c5cd1b..5c4fb060e52 100644 --- a/apps/desktop/desktop_native/ssh_agent/src/lib.rs +++ b/apps/desktop/desktop_native/ssh_agent/src/lib.rs @@ -1,5 +1,5 @@ pub mod agent; -pub mod hostinfo; +pub mod knownhosts; pub mod memory; pub mod protocol; pub mod transport; 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 afa7f6705b0..a67e3e50a63 100644 --- a/apps/desktop/desktop_native/ssh_agent/src/protocol/connection.rs +++ b/apps/desktop/desktop_native/ssh_agent/src/protocol/connection.rs @@ -1,7 +1,7 @@ use std::sync::atomic::{AtomicU32, Ordering}; use crate::{ - hostinfo, + knownhosts, protocol::types::{PublicKey, SessionId}, transport::peer_info::PeerInfo, }; @@ -60,7 +60,7 @@ impl ConnectionInfo { 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) = hostinfo::KnownHostsReader::read_default() { + if let Ok(hosts) = knownhosts::KnownHostsReader::read_default() { self.host_name = hosts .find_host(&host_key) .map(|entry| entry.hostname.clone());