diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 8e274e6a0..d173167ae 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -52,6 +52,19 @@ dependencies = [ "subtle", ] +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "const-random", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -305,7 +318,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aeac2e1fe888769f34f05ac343bbef98b14d1ffb292ab69d4608b3abc86f2a2" dependencies = [ "blowfish", - "pbkdf2 0.12.2", + "pbkdf2", "sha2", ] @@ -373,6 +386,9 @@ name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +dependencies = [ + "serde", +] [[package]] name = "block-buffer" @@ -683,6 +699,26 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom", + "once_cell", + "tiny-keccak", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -887,6 +923,17 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "delegate" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e018fccbeeb50ff26562ece792ed06659b9c2dae79ece77c4456bb10d9bf79b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "der" version = "0.7.9" @@ -1183,6 +1230,18 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "flurry" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5efcf77a4da27927d3ab0509dec5b0954bb3bc59da5a1de9e52642ebd4cdf9" +dependencies = [ + "ahash", + "num_cpus", + "parking_lot", + "seize", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1671,7 +1730,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -2526,6 +2585,21 @@ dependencies = [ "sha2", ] +[[package]] +name = "pageant" +version = "0.0.1-beta.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c8ca7f786256e4d89f369656546b1f504cfd2d5ec796f0b99600919dd993723" +dependencies = [ + "bytes", + "delegate", + "futures", + "rand", + "thiserror", + "tokio", + "windows 0.58.0", +] + [[package]] name = "parking_lot" version = "0.12.3" @@ -2549,17 +2623,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] - [[package]] name = "password-hash" version = "0.5.0" @@ -2577,18 +2640,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest", - "hmac", - "password-hash 0.4.2", - "sha2", -] - [[package]] name = "pbkdf2" version = "0.12.2" @@ -2597,7 +2648,7 @@ checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest", "hmac", - "password-hash 0.5.0", + "password-hash", ] [[package]] @@ -2691,7 +2742,7 @@ dependencies = [ "aes", "cbc", "der", - "pbkdf2 0.12.2", + "pbkdf2", "scrypt", "sha2", "spki", @@ -3171,9 +3222,9 @@ dependencies = [ [[package]] name = "russh" -version = "0.45.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a229f2a03daea3f62cee897b40329ce548600cca615906d98d58b8db3029b19" +checksum = "c536b90d8e2468d8dedc8de2369383c101325e23fffa3a30de713032862a11d4" dependencies = [ "aes", "aes-gcm", @@ -3203,6 +3254,8 @@ dependencies = [ "rand_core", "russh-cryptovec", "russh-keys", + "russh-sftp", + "russh-util", "sha1", "sha2", "ssh-encoding", @@ -3224,9 +3277,9 @@ dependencies = [ [[package]] name = "russh-keys" -version = "0.45.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89757474f7c9ee30121d8cc7fe293a954ba10b204a82ccf5850a5352a532ebc7" +checksum = "6e3db166c8678c824627c2c46f619ed5ce4ae33f38a35403c62f6ab8f3985867" dependencies = [ "aes", "async-trait", @@ -3242,6 +3295,7 @@ dependencies = [ "ed25519-dalek", "elliptic-curve", "futures", + "getrandom", "hmac", "home", "inout", @@ -3251,7 +3305,8 @@ dependencies = [ "p256", "p384", "p521", - "pbkdf2 0.11.0", + "pageant", + "pbkdf2", "pkcs1", "pkcs5", "pkcs8", @@ -3259,6 +3314,7 @@ dependencies = [ "rand_core", "rsa", "russh-cryptovec", + "russh-util", "sec1", "serde", "sha1", @@ -3273,6 +3329,36 @@ dependencies = [ "zeroize", ] +[[package]] +name = "russh-sftp" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a72c8afe2041c17435eecd85d0b7291841486fd3d1c4082e0b212e5437ca42" +dependencies = [ + "async-trait", + "bitflags 2.6.0", + "bytes", + "chrono", + "flurry", + "log", + "serde", + "thiserror", + "tokio", + "tokio-util", +] + +[[package]] +name = "russh-util" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63aeb9d2b74f8f38befdc0c5172d5ffcf58f3d2ffcb423f3b6cdfe2c2d747b80" +dependencies = [ + "chrono", + "tokio", + "wasm-bindgen", + "wasm-bindgen-futures", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -3483,7 +3569,7 @@ dependencies = [ "num_cpus", "once_cell", "openssl", - "pbkdf2 0.12.2", + "pbkdf2", "pcap", "pkcs8", "pnet", @@ -3547,7 +3633,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" dependencies = [ - "pbkdf2 0.12.2", + "pbkdf2", "salsa20", "sha2", ] @@ -3599,6 +3685,12 @@ dependencies = [ "libc", ] +[[package]] +name = "seize" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "689224d06523904ebcc9b482c6a3f4f7fb396096645c4cd10c0d2ff7371a34d3" + [[package]] name = "semver" version = "1.0.23" @@ -4007,7 +4099,7 @@ dependencies = [ "ntapi", "once_cell", "rayon", - "windows", + "windows 0.52.0", ] [[package]] @@ -4214,6 +4306,7 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", + "tokio-util", ] [[package]] @@ -4613,7 +4706,17 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core", + "windows-core 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", "windows-targets 0.52.6", ] @@ -4626,6 +4729,60 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.36.1" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index f04ba6f8e..2ecbafe62 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -53,8 +53,8 @@ redis = "0.22.3" regex = "1.10.6" ripemd = "0.1.3" rsa = { version = "0.9.6", features = ["hazmat"] } -russh = "0.45.0" -russh-keys = "0.45.0" +russh = "0.46.0" +russh-keys = "0.46.0" rustls = "0.23.5" rustls-pemfile = "2.1.2" rustls-pemfile-old = { version = "1.0.2", package = "rustls-pemfile" } diff --git a/rust/src/nasl/builtin/ssh/tests/mod.rs b/rust/src/nasl/builtin/ssh/tests/mod.rs index 84a9183e0..bfb953ca6 100644 --- a/rust/src/nasl/builtin/ssh/tests/mod.rs +++ b/rust/src/nasl/builtin/ssh/tests/mod.rs @@ -26,7 +26,7 @@ const PORT: u16 = 2223; fn default_config() -> ServerConfig { ServerConfig { - keys: vec![KeyPair::generate_ed25519().unwrap()], + keys: vec![KeyPair::generate_ed25519()], inactivity_timeout: Some(std::time::Duration::from_secs(3600)), auth_rejection_time: std::time::Duration::from_secs(3), auth_rejection_time_initial: Some(std::time::Duration::from_secs(0)), @@ -77,7 +77,10 @@ async fn ssh_connect() { run_test( |t| { t.ok( - format!(r#"id = ssh_connect(port:{});"#, PORT), + format!( + r#"id = ssh_connect(port:{}, keytype: "ssh-ed25519");"#, + PORT + ), MIN_SESSION_ID, ); check_err_matches!( @@ -115,7 +118,10 @@ async fn ssh_userauth() { run_test( |mut t| { t.ok( - format!(r#"session_id = ssh_connect(port: {});"#, PORT), + format!( + r#"session_id = ssh_connect(port: {}, keytype: "ssh-ed25519");"#, + PORT + ), MIN_SESSION_ID, ); check_err_matches!( @@ -145,7 +151,7 @@ async fn ssh_request_exec() { run_test( |mut t| { t.ok( - format!(r#"session_id = ssh_connect(port: {});"#, PORT), + format!(r#"session_id = ssh_connect(port: {}, keytype: "ssh-ed25519");"#, PORT), MIN_SESSION_ID, ); userauth(&mut t);