diff --git a/Cargo.toml b/Cargo.toml index f4782fd..b98ca6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,11 +16,11 @@ authors = ["Miyoshi-Ryota "] openssl = ["russh/openssl"] [dependencies] -russh = "0.40.2" -russh-keys = "0.40.1" -russh-sftp = "2.0.0-beta.4" +russh = "0.43" +russh-keys = "0.43" +russh-sftp = "2.0.1" thiserror = "1.0" -async-trait = "0.1.61" +async-trait = "0.1" tokio = { version = "1", features = ["fs"] } [dev-dependencies] diff --git a/src/client.rs b/src/client.rs index ff6fb48..3a1a728 100644 --- a/src/client.rs +++ b/src/client.rs @@ -414,22 +414,22 @@ impl Handler for ClientHandler { type Error = crate::Error; async fn check_server_key( - self, + &mut self, server_public_key: &russh_keys::key::PublicKey, - ) -> Result<(Self, bool), Self::Error> { + ) -> Result { match &self.server_check { - ServerCheckMethod::NoCheck => Ok((self, true)), + ServerCheckMethod::NoCheck => Ok(true), ServerCheckMethod::PublicKey(key) => { let pk = russh_keys::parse_public_key_base64(key) .map_err(|_| crate::Error::ServerCheckFailed)?; - Ok((self, pk == *server_public_key)) + Ok(pk == *server_public_key) } ServerCheckMethod::PublicKeyFile(key_file_name) => { let pk = russh_keys::load_public_key(key_file_name) .map_err(|_| crate::Error::ServerCheckFailed)?; - Ok((self, pk == *server_public_key)) + Ok(pk == *server_public_key) } ServerCheckMethod::KnownHostsFile(known_hosts_path) => { let result = russh_keys::check_known_hosts_path( @@ -440,7 +440,7 @@ impl Handler for ClientHandler { ) .map_err(|_| crate::Error::ServerCheckFailed)?; - Ok((self, result)) + Ok(result) } ServerCheckMethod::DefaultKnownHostsFile => { let result = russh_keys::check_known_hosts( @@ -450,7 +450,7 @@ impl Handler for ClientHandler { ) .map_err(|_| crate::Error::ServerCheckFailed)?; - Ok((self, result)) + Ok(result) } } }