From 0e4dcd8ae7ebb7dc5c307869dc49ea939bf01c01 Mon Sep 17 00:00:00 2001 From: chanderlud Date: Fri, 19 Apr 2024 16:58:39 -0700 Subject: [PATCH 1/4] updated russh to use my fork --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1dcd966..c6cc4c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ authors = ["Miyoshi-Ryota "] openssl = ["russh/openssl"] [dependencies] -russh = "0.40.2" +russh = { git = "https://github.com/chanderlud/russh" } russh-keys = "0.40.1" thiserror = "1.0" async-trait = "0.1.61" From 8f397472cbb6f8966222e485623b906dda2542dd Mon Sep 17 00:00:00 2001 From: chanderlud Date: Fri, 19 Apr 2024 17:01:27 -0700 Subject: [PATCH 2/4] updated russh-keys --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c6cc4c4..dea3edf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ openssl = ["russh/openssl"] [dependencies] russh = { git = "https://github.com/chanderlud/russh" } -russh-keys = "0.40.1" +russh-keys = "0.43.0" thiserror = "1.0" async-trait = "0.1.61" From 0fbea98207b73563fcefbfcf7b4153d336cf8b3e Mon Sep 17 00:00:00 2001 From: chanderlud Date: Sun, 9 Jun 2024 11:10:25 -0700 Subject: [PATCH 3/4] updated russh dependencies --- Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f4782fd..6be425e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,9 +16,9 @@ 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.0" +russh-keys = "0.43.0" +russh-sftp = "2.0.1" thiserror = "1.0" async-trait = "0.1.61" tokio = { version = "1", features = ["fs"] } From 3171dec9d70e96a3a18a3e3c42f5cce2662a7c50 Mon Sep 17 00:00:00 2001 From: chanderlud Date: Sun, 9 Jun 2024 11:20:38 -0700 Subject: [PATCH 4/4] updated the Handler implementation to match the new trait definition --- Cargo.toml | 6 +++--- src/client.rs | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6be425e..b98ca6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,11 +16,11 @@ authors = ["Miyoshi-Ryota "] openssl = ["russh/openssl"] [dependencies] -russh = "0.43.0" -russh-keys = "0.43.0" +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) } } }