diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de0b7a7..d7364e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,9 +68,6 @@ jobs: fail-fast: false matrix: include: - - runner: macos-26-intel - target: x86_64-apple-darwin - key: macos-amd64 - runner: macos-26 target: aarch64-apple-darwin key: macos-arm64 @@ -155,11 +152,6 @@ jobs: with: name: sandhole-linux-arm64 path: out/ - - name: Download macos-amd64 artifact - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: sandhole-macos-amd64 - path: out/ - name: Download macos-arm64 artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 42f0a75..df805fc 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -83,8 +83,6 @@ jobs: include: - runner: ubuntu-24.04-arm target: aarch64-unknown-linux-gnu - - runner: macos-26-intel - target: x86_64-apple-darwin - runner: macos-26 target: aarch64-apple-darwin - runner: windows-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 9161764..6dc366e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - Change license to AGPL-3.0-or-later. - Update dependencies. -- Downgrade russh to 0.61.2. +- Drop Intel macOS support. ## 0.10.2 (2026-07-05) diff --git a/Cargo.lock b/Cargo.lock index 6ca556b..e2a0c2b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1086,15 +1086,16 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "5.0.0-rc.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f359e08ca85e7bd759e1fd933ff2bccd81864c60a8fba0e259c7f822b0924bf" +checksum = "b5eed333089e2e1c1ac8c6c0398e5e2497b4c9926ca6d0365ed1e099afa5bc23" dependencies = [ "cfg-if", "cpufeatures 0.3.0", "curve25519-dalek-derive", "digest 0.11.3", "fiat-crypto", + "rand_core 0.10.1", "rustc_version", "subtle", "zeroize", @@ -1386,9 +1387,9 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.17.0-rc.18" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54fb064faabbee66e1fc8e5c5a9458d4269dc2d8b638fe86a425adb2510d1a96" +checksum = "c0681a4fc24c767085329728d8dfba959af91228aa4610cca4f8ce317ba46ae0" dependencies = [ "der", "digest 0.11.3", @@ -1411,9 +1412,9 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "3.0.0-rc.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b011170fe4f04665565b4110afef66774fe9ffff278f3eb5b81cc73d26e27d60" +checksum = "6ebaa1a2bf1290ab3bfe5a7b771d050ebffab2711c19a81691c683a5144a25de" dependencies = [ "curve25519-dalek", "ed25519", @@ -1433,9 +1434,9 @@ checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "elliptic-curve" -version = "0.14.0-rc.33" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102d3643d30dd8b559613c5cced68317199597fffb278cdc88daa2ef7fafc935" +checksum = "9d65aa39b3a5c1c9c1b745c9a019234bb7a21b77abcb4f4d266d706e2d577d65" dependencies = [ "base16ct", "crypto-bigint", @@ -1445,7 +1446,6 @@ dependencies = [ "group", "hkdf", "hybrid-array", - "once_cell", "pem-rfc7468", "pkcs8", "rand_core 0.10.1", @@ -2963,7 +2963,7 @@ dependencies = [ "module-lattice", "pkcs8", "rand_core 0.10.1", - "sha3", + "sha3 0.11.0", ] [[package]] @@ -3264,9 +3264,9 @@ dependencies = [ [[package]] name = "p256" -version = "0.14.0-rc.10" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41adc63effe99d48837a8cc0e6d7a77e32ae6a07f6000df466178dbc2193093e" +checksum = "d2c9239b2dbc807adbbe147e8cf72ea7450c3a0aabe62cb8e75ff4ec22e1f72a" dependencies = [ "ecdsa", "elliptic-curve", @@ -3277,9 +3277,9 @@ dependencies = [ [[package]] name = "p384" -version = "0.14.0-rc.10" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd5333afa5ae0347f39e6a0f2c9c155da431583fd71fe5555bd0521b4ccaf02" +checksum = "d17b851e6b3e378ab4ecb07fa2ed23f4d15f075735f8fec9fa1e7bdce5f8301f" dependencies = [ "ecdsa", "elliptic-curve", @@ -3291,9 +3291,9 @@ dependencies = [ [[package]] name = "p521" -version = "0.14.0-rc.10" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3a5297f53dc16d35909060ba3032cff7867e8809f01e273ff325579d5f0ceae" +checksum = "4ad64cc32c2dc466317c12ee5853e61f159f9eab1fe7efade0395dc2e7b43449" dependencies = [ "base16ct", "ecdsa", @@ -3645,11 +3645,15 @@ dependencies = [ [[package]] name = "primeorder" -version = "0.14.0-rc.10" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d2793f22b9b6fd11ef3ac1d59bf003c2573593e4968702341605c2748fd90bf" +checksum = "5c9f42978c78a00e3d68f69fc03e57a234debae69da4020a4fb588fcdcd07b06" dependencies = [ "elliptic-curve", + "once_cell", + "primefield", + "serdect", + "wnaf", ] [[package]] @@ -4098,12 +4102,12 @@ checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" [[package]] name = "rfc6979" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5236ce872cac07e0fb3969b0cbf468c7d2f37d432f1b627dcb7b8d34563fb0c3" +checksum = "b4a459cddafb3fe76b31fd8f1108007566c40301feb64dc7b54656eb7388172b" dependencies = [ + "crypto-bigint", "hmac", - "subtle", ] [[package]] @@ -4141,9 +4145,9 @@ dependencies = [ [[package]] name = "russh" -version = "0.61.2" +version = "0.62.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf893f64684e58da8a68d56a5e84d1cf0440226274c515770fe267707a7d0b0" +checksum = "b41043523e0edcbd4e31d00903e26f12994f63b21bae9904f7405c1ed92752a5" dependencies = [ "aes", "aws-lc-rs", @@ -4198,7 +4202,7 @@ dependencies = [ "sec1", "sha1 0.11.0", "sha2", - "sha3", + "sha3 0.12.0", "signature", "spki", "ssh-encoding", @@ -4213,9 +4217,9 @@ dependencies = [ [[package]] name = "russh-cryptovec" -version = "0.61.0" +version = "0.62.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443f6bbcfacb34a1aab2b12b99bf08e0c63abdc5a0db261901365df9d57fff51" +checksum = "3aec6cb630dbe85d72ffd7bcd95f07e1bd69f9f270ee8adfa1afe443a6331438" dependencies = [ "log", "nix", @@ -4726,6 +4730,17 @@ dependencies = [ "keccak", ] +[[package]] +name = "sha3" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9bad02c26382724b2d2692c6f179285e4b54eeecd7968f52a50059c3c11759" +dependencies = [ + "digest 0.11.3", + "keccak", + "sponge-cursor", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -4848,19 +4863,23 @@ dependencies = [ "der", ] +[[package]] +name = "sponge-cursor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a0219bd7d979d58245a4f41f695e1ac9f8befdffadd7f61f1bae9e39abc6620" + [[package]] name = "ssh-cipher" -version = "0.3.0-rc.9" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10db6f219196a8528f9ec904d9d45cdad692d65b0e57e72be4dedd1c5fddce36" +checksum = "d801accda99469cde6d73da741422610fdf6508a72d9a69d1b55cb241c720597" dependencies = [ "aead", "aes", "aes-gcm", - "cbc", "chacha20", "cipher", - "ctr", "ctutils", "des", "poly1305", @@ -4870,9 +4889,9 @@ dependencies = [ [[package]] name = "ssh-encoding" -version = "0.3.0-rc.9" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abf34aa716da5d5b4c496936d042ea282ab392092cd68a72ef6a8863ff8c96a" +checksum = "7b54d0ed0498daf3f78d82e00e28c8eec9d75a067c4cfbcc7a0f7d0f4077749e" dependencies = [ "base64ct", "bytes", @@ -4885,9 +4904,9 @@ dependencies = [ [[package]] name = "ssh-key" -version = "0.7.0-rc.10" +version = "0.7.0-rc.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45735ce3dea95690e4a9e414c4cfde7f79835063c3dcd35881df85a84118e74b" +checksum = "f9a32fae177b74a22aa9c5b01bf7e68b33545be32d9e381e248058d2adc15ce3" dependencies = [ "argon2", "bcrypt-pbkdf", @@ -6329,6 +6348,17 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "wnaf" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab12e7090f27e2ffd9322651492942d50c2926094af30601e1964337db39daf1" +dependencies = [ + "ff", + "group", + "hybrid-array", +] + [[package]] name = "writeable" version = "0.6.3" diff --git a/Cargo.toml b/Cargo.toml index 86c34cc..bb46c21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,7 @@ reqwest = { version = "0.13.4", optional = true, default-features = false, featu "json", "rustls", ] } -russh = "0.61.2" +russh = "0.62.6" rustls = "0.23.43" rustls-acme = { version = "0.15.3", optional = true, default-features = false, features = [ "tokio", diff --git a/flake.nix b/flake.nix index 8fea931..e92dc8a 100644 --- a/flake.nix +++ b/flake.nix @@ -27,7 +27,6 @@ systems = [ "x86_64-linux" "aarch64-linux" - "x86_64-darwin" "aarch64-darwin" ]; diff --git a/src/ssh/mod.rs b/src/ssh/mod.rs index c3b37a2..88e3490 100644 --- a/src/ssh/mod.rs +++ b/src/ssh/mod.rs @@ -56,9 +56,9 @@ use enumflags2::BitFlags; use ipnet::IpNet; use owo_colors::OwoColorize; use russh::{ - Channel, ChannelId, MethodKind, MethodSet, + Channel, ChannelId, ChannelOpenFailure, MethodKind, MethodSet, keys::{HashAlg, PublicKey, ssh_key::Fingerprint}, - server::{Auth, Handler, Msg, Session}, + server::{Auth, ChannelOpenHandle, Handler, Msg, Session}, }; #[cfg_attr(not(feature = "login"), allow(unused_imports))] use tokio::time::timeout; @@ -162,14 +162,16 @@ impl Handler for ServerHandler { async fn channel_open_session( &mut self, channel: Channel, + reply: ChannelOpenHandle, _session: &mut Session, - ) -> Result { + ) -> Result<(), Self::Error> { // Only the first session will receive data. Others are rejected. let Some(mut rx) = self.rx.take() else { if matches!(self.auth_data, AuthenticatedData::None { .. }) { return Err(russh::Error::Disconnect); } - return Ok(false); + reply.reject(ChannelOpenFailure::ResourceShortage).await; + return Ok(()); }; self.channel_id = Some(channel.id()); let graceful_cancellation_token = CancellationToken::new(); @@ -204,7 +206,8 @@ impl Handler for ServerHandler { } }); self.open_session_join_handle = Some(DroppableHandle(join_handle)); - Ok(true) + reply.accept().await; + Ok(()) } // Return the default authentication method. @@ -959,7 +962,7 @@ impl Handler for ServerHandler { // Handle a local forwarding request (i.e. proxy tunnel for aliases). #[cfg_attr( not(coverage_nightly), - tracing::instrument(skip(self, _session), fields(peer = %self.peer), level = "debug") + tracing::instrument(skip(self, _session, reply), fields(peer = %self.peer), level = "debug") )] async fn channel_open_direct_tcpip( &mut self, @@ -968,8 +971,9 @@ impl Handler for ServerHandler { port_to_connect: u32, originator_address: &str, originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, - ) -> Result { + ) -> Result<(), Self::Error> { // Reject invalid ports if port_to_connect > u16::MAX.into() || originator_port > u16::MAX.into() { return Err(russh::Error::Disconnect); @@ -986,7 +990,10 @@ impl Handler for ServerHandler { .into_bytes(), ); - return Ok(false); + reply + .reject(ChannelOpenFailure::AdministrativelyProhibited) + .await; + return Ok(()); } if let AuthenticatedData::Admin { admin_data, .. } = &mut self.auth_data { if admin_data.admin_interface.is_some() { @@ -999,7 +1006,10 @@ impl Handler for ServerHandler { .into_bytes(), ); self.cancellation_token.cancel(); - return Ok(false); + reply + .reject(ChannelOpenFailure::AdministrativelyProhibited) + .await; + return Ok(()); } else { admin_data.is_forwarding = true; } @@ -1021,10 +1031,13 @@ impl Handler for ServerHandler { ) .await? { - Ok(true) + reply.accept().await; } else { - Ok(false) + reply + .reject(ChannelOpenFailure::AdministrativelyProhibited) + .await; } + Ok(()) } } diff --git a/tests/integration/admin_interface.rs b/tests/integration/admin_interface.rs index 31b0a90..74f7b6f 100644 --- a/tests/integration/admin_interface.rs +++ b/tests/integration/admin_interface.rs @@ -18,6 +18,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use regex::Regex; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -647,12 +648,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/admin_missing_pty.rs b/tests/integration/admin_missing_pty.rs index 02fcaf8..bccda66 100644 --- a/tests/integration/admin_missing_pty.rs +++ b/tests/integration/admin_missing_pty.rs @@ -18,6 +18,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use regex::Regex; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -247,12 +248,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/admin_no_interface_if_forwarding.rs b/tests/integration/admin_no_interface_if_forwarding.rs index b54e0eb..a948401 100644 --- a/tests/integration/admin_no_interface_if_forwarding.rs +++ b/tests/integration/admin_no_interface_if_forwarding.rs @@ -18,6 +18,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use regex::Regex; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -253,12 +254,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/admin_no_interface_if_proxying.rs b/tests/integration/admin_no_interface_if_proxying.rs index 6f534bd..fc47e29 100644 --- a/tests/integration/admin_no_interface_if_proxying.rs +++ b/tests/integration/admin_no_interface_if_proxying.rs @@ -18,6 +18,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use russh::ChannelId; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -229,6 +230,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -236,6 +238,7 @@ impl russh::client::Handler for SshClient { sleep(Duration::from_secs(1)).await; channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/admin_remove_user.rs b/tests/integration/admin_remove_user.rs index 624cbdb..8dabeb6 100644 --- a/tests/integration/admin_remove_user.rs +++ b/tests/integration/admin_remove_user.rs @@ -25,11 +25,14 @@ use hyper_util::{ server::conn::auto::Builder, }; use regex::Regex; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{self, Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use serde::Deserialize; use tokio::{ @@ -456,6 +459,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { #[derive(Debug, Deserialize)] @@ -484,6 +488,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/admin_window_change.rs b/tests/integration/admin_window_change.rs index b6d94cb..4219e03 100644 --- a/tests/integration/admin_window_change.rs +++ b/tests/integration/admin_window_change.rs @@ -18,6 +18,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use regex::Regex; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -261,12 +262,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/alias_aliasing_tunnel.rs b/tests/integration/alias_aliasing_tunnel.rs index b860caa..ebc0b1e 100644 --- a/tests/integration/alias_aliasing_tunnel.rs +++ b/tests/integration/alias_aliasing_tunnel.rs @@ -19,6 +19,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; +use russh::client::ChannelOpenHandle; use russh::keys::ssh_key::private::Ed25519Keypair; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ @@ -221,12 +222,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Poor man's VPN..."[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/alias_http2.rs b/tests/integration/alias_http2.rs index 4bdad98..16301b3 100644 --- a/tests/integration/alias_http2.rs +++ b/tests/integration/alias_http2.rs @@ -24,7 +24,7 @@ use hyper::{StatusCode, body::Incoming, server::conn::http2::Builder, service::s use hyper_util::rt::{TokioExecutor, TokioIo}; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ ChannelId, @@ -227,6 +227,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -246,6 +247,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/alias_http_aliases.rs b/tests/integration/alias_http_aliases.rs index df55ea9..c3f1b75 100644 --- a/tests/integration/alias_http_aliases.rs +++ b/tests/integration/alias_http_aliases.rs @@ -24,11 +24,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, ChannelId, client::{self, Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -356,6 +359,7 @@ impl russh::client::Handler for SshClientProxy { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || StatusCode::NO_CONTENT)); @@ -366,6 +370,7 @@ impl russh::client::Handler for SshClientProxy { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/alias_ip_connections_limit.rs b/tests/integration/alias_ip_connections_limit.rs index d4604f6..225005a 100644 --- a/tests/integration/alias_ip_connections_limit.rs +++ b/tests/integration/alias_ip_connections_limit.rs @@ -19,6 +19,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -255,6 +256,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -263,6 +265,7 @@ impl russh::client::Handler for SshClient { channel.eof().await.unwrap(); channel.close().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/alias_local_forward_existing_http.rs b/tests/integration/alias_local_forward_existing_http.rs index 4b873ee..46a1474 100644 --- a/tests/integration/alias_local_forward_existing_http.rs +++ b/tests/integration/alias_local_forward_existing_http.rs @@ -27,11 +27,14 @@ use hyper_util::{ }; use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key, ssh_key::private::Ed25519Keypair}; use russh::{ Channel, client::{self, Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key, ssh_key::private::Ed25519Keypair}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -212,6 +215,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || "Connected via local forwarding!")); @@ -222,6 +226,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/alias_pool_limit.rs b/tests/integration/alias_pool_limit.rs index 21038d2..a91b8ae 100644 --- a/tests/integration/alias_pool_limit.rs +++ b/tests/integration/alias_pool_limit.rs @@ -21,7 +21,7 @@ use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, keys::ssh_key::private::Ed25519Keypair, }; use russh::{ @@ -240,6 +240,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -248,6 +249,7 @@ impl russh::client::Handler for SshClient { channel.eof().await.unwrap(); channel.close().await.unwrap(); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/alias_pool_timeout.rs b/tests/integration/alias_pool_timeout.rs index c0bba9c..a4091d3 100644 --- a/tests/integration/alias_pool_timeout.rs +++ b/tests/integration/alias_pool_timeout.rs @@ -24,7 +24,7 @@ use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, keys::ssh_key::private::Ed25519Keypair, }; use russh::{ @@ -292,6 +292,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -300,6 +301,7 @@ impl russh::client::Handler for SshClient { channel.eof().await.unwrap(); channel.close().await.unwrap(); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/alias_rate_limit_download.rs b/tests/integration/alias_rate_limit_download.rs index 116136e..0e93720 100644 --- a/tests/integration/alias_rate_limit_download.rs +++ b/tests/integration/alias_rate_limit_download.rs @@ -21,6 +21,7 @@ use clap::Parser; use rand::{Rng, RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; use russh::ChannelMsg; +use russh::client::ChannelOpenHandle; use russh::keys::ssh_key::private::Ed25519Keypair; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ @@ -202,6 +203,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -216,6 +218,7 @@ impl russh::client::Handler for SshClient { } } }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/alias_rate_limit_upload.rs b/tests/integration/alias_rate_limit_upload.rs index c358b2e..b16d406 100644 --- a/tests/integration/alias_rate_limit_upload.rs +++ b/tests/integration/alias_rate_limit_upload.rs @@ -20,6 +20,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use rand::{Rng, RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; +use russh::client::ChannelOpenHandle; use russh::keys::ssh_key::private::Ed25519Keypair; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ @@ -195,6 +196,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let mut data = vec![0u8; 55_000]; @@ -203,6 +205,7 @@ impl russh::client::Handler for SshClient { let mut stream = channel.into_stream(); stream.write_all(&data).await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/alias_require_allowed_fingerprints.rs b/tests/integration/alias_require_allowed_fingerprints.rs index 6ce618d..9b81490 100644 --- a/tests/integration/alias_require_allowed_fingerprints.rs +++ b/tests/integration/alias_require_allowed_fingerprints.rs @@ -19,6 +19,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; +use russh::client::ChannelOpenHandle; use russh::keys::ssh_key::private::Ed25519Keypair; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ @@ -231,6 +232,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -240,6 +242,7 @@ impl russh::client::Handler for SshClient { .unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/alias_timeout.rs b/tests/integration/alias_timeout.rs index 3f854ca..8d9072a 100644 --- a/tests/integration/alias_timeout.rs +++ b/tests/integration/alias_timeout.rs @@ -21,7 +21,7 @@ use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; use russh::{ Channel, ChannelMsg, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, keys::{key::PrivateKeyWithHashAlg, load_secret_key, ssh_key::private::Ed25519Keypair}, }; use sandhole::{ApplicationConfig, entrypoint}; @@ -292,6 +292,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -299,6 +300,7 @@ impl russh::client::Handler for SshClient { channel.data(&b"Hello, world!\n"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/auth_prevent_unauthorized_actions.rs b/tests/integration/auth_prevent_unauthorized_actions.rs index fe69f75..4f92d66 100644 --- a/tests/integration/auth_prevent_unauthorized_actions.rs +++ b/tests/integration/auth_prevent_unauthorized_actions.rs @@ -19,6 +19,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; +use russh::client::ChannelOpenHandle; use russh::keys::ssh_key::private::Ed25519Keypair; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ @@ -475,12 +476,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/auth_self_hosted_login_api.rs b/tests/integration/auth_self_hosted_login_api.rs index 9f6c3ac..226474b 100644 --- a/tests/integration/auth_self_hosted_login_api.rs +++ b/tests/integration/auth_self_hosted_login_api.rs @@ -25,7 +25,7 @@ use hyper_util::{ }; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ Disconnect, @@ -187,6 +187,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { #[derive(Debug, Deserialize)] @@ -215,6 +216,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/config_authenticate_any_key_as_user.rs b/tests/integration/config_authenticate_any_key_as_user.rs index 0603d65..137f3f5 100644 --- a/tests/integration/config_authenticate_any_key_as_user.rs +++ b/tests/integration/config_authenticate_any_key_as_user.rs @@ -28,11 +28,14 @@ use hyper_util::{ use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; use regex::Regex; -use russh::keys::{key::PrivateKeyWithHashAlg, ssh_key::private::Ed25519Keypair}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, ssh_key::private::Ed25519Keypair}, +}; use rustls::{ RootCertStore, pki_types::{CertificateDer, pem::PemObject}, @@ -252,6 +255,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || "Hopefully not a malicious service.")); @@ -262,6 +266,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/config_disable_aliasing.rs b/tests/integration/config_disable_aliasing.rs index 169db0d..a726418 100644 --- a/tests/integration/config_disable_aliasing.rs +++ b/tests/integration/config_disable_aliasing.rs @@ -26,11 +26,14 @@ use hyper_util::{ }; use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key, ssh_key::private::Ed25519Keypair}; use russh::{ Channel, ChannelId, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key, ssh_key::private::Ed25519Keypair}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -333,6 +336,7 @@ impl russh::client::Handler for SshClientOne { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || StatusCode::NO_CONTENT)); @@ -343,6 +347,7 @@ impl russh::client::Handler for SshClientOne { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/config_disable_http.rs b/tests/integration/config_disable_http.rs index 06eb860..a948768 100644 --- a/tests/integration/config_disable_http.rs +++ b/tests/integration/config_disable_http.rs @@ -24,11 +24,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -223,6 +226,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || StatusCode::NO_CONTENT)); @@ -233,6 +237,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/config_disable_tcp.rs b/tests/integration/config_disable_tcp.rs index 100ac45..938b31a 100644 --- a/tests/integration/config_disable_tcp.rs +++ b/tests/integration/config_disable_tcp.rs @@ -24,11 +24,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -158,6 +161,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || StatusCode::NO_CONTENT)); @@ -168,6 +172,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/connection_deny_load_balancing.rs b/tests/integration/connection_deny_load_balancing.rs index 41bebeb..3a8039e 100644 --- a/tests/integration/connection_deny_load_balancing.rs +++ b/tests/integration/connection_deny_load_balancing.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -328,12 +329,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Data"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/connection_load_balancing.rs b/tests/integration/connection_load_balancing.rs index 6b11677..6afa2be 100644 --- a/tests/integration/connection_load_balancing.rs +++ b/tests/integration/connection_load_balancing.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -178,12 +179,14 @@ impl russh::client::Handler for SshClientA { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"A"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } @@ -207,12 +210,14 @@ impl russh::client::Handler for SshClientB { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"B"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/http_addressing_profanities_domain.rs b/tests/integration/http_addressing_profanities_domain.rs index 60006a9..9a103c7 100644 --- a/tests/integration/http_addressing_profanities_domain.rs +++ b/tests/integration/http_addressing_profanities_domain.rs @@ -25,11 +25,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -233,6 +236,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || "Hello from a safe space!")); @@ -243,6 +247,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/http_addressing_profanities_subdomain.rs b/tests/integration/http_addressing_profanities_subdomain.rs index 4d7d961..7943f1f 100644 --- a/tests/integration/http_addressing_profanities_subdomain.rs +++ b/tests/integration/http_addressing_profanities_subdomain.rs @@ -25,11 +25,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -238,6 +241,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || "Hello from a profane place!")); @@ -248,6 +252,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/http_force_https_by_user.rs b/tests/integration/http_force_https_by_user.rs index 2bf2fc4..1a33b09 100644 --- a/tests/integration/http_force_https_by_user.rs +++ b/tests/integration/http_force_https_by_user.rs @@ -25,11 +25,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, ChannelId, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -335,6 +338,7 @@ impl russh::client::Handler for SshClientProxy { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -348,6 +352,7 @@ impl russh::client::Handler for SshClientProxy { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } @@ -380,6 +385,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -393,6 +399,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/http_pool_limit.rs b/tests/integration/http_pool_limit.rs index 26940b9..a489fac 100644 --- a/tests/integration/http_pool_limit.rs +++ b/tests/integration/http_pool_limit.rs @@ -25,11 +25,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -234,6 +237,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -250,6 +254,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/http_pool_timeout.rs b/tests/integration/http_pool_timeout.rs index 1bb3025..16434f7 100644 --- a/tests/integration/http_pool_timeout.rs +++ b/tests/integration/http_pool_timeout.rs @@ -28,11 +28,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -287,6 +290,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -303,6 +307,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/http_redirects.rs b/tests/integration/http_redirects.rs index e55127c..fe120f6 100644 --- a/tests/integration/http_redirects.rs +++ b/tests/integration/http_redirects.rs @@ -24,11 +24,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -215,6 +218,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || "This is only accessible via HTTPS!")); @@ -225,6 +229,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/http_rewrite_host.rs b/tests/integration/http_rewrite_host.rs index 27c23b8..2c42f31 100644 --- a/tests/integration/http_rewrite_host.rs +++ b/tests/integration/http_rewrite_host.rs @@ -27,7 +27,7 @@ use hyper_util::{ }; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ ChannelId, @@ -216,6 +216,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -235,6 +236,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/http_simultaneous_requests.rs b/tests/integration/http_simultaneous_requests.rs index e2e2f91..3bebcbd 100644 --- a/tests/integration/http_simultaneous_requests.rs +++ b/tests/integration/http_simultaneous_requests.rs @@ -25,11 +25,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -238,6 +241,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/fast", get(async || "Fast")).route( @@ -254,6 +258,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/http_timeout.rs b/tests/integration/http_timeout.rs index e901fbd..12d2e55 100644 --- a/tests/integration/http_timeout.rs +++ b/tests/integration/http_timeout.rs @@ -23,11 +23,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use rustls::{ RootCertStore, pki_types::{CertificateDer, pem::PemObject}, @@ -227,6 +230,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || "Hello from foobar.tld!")); @@ -237,6 +241,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_bind_all_hostnames.rs b/tests/integration/https_bind_all_hostnames.rs index 6bd0ec8..5b2da0c 100644 --- a/tests/integration/https_bind_all_hostnames.rs +++ b/tests/integration/https_bind_all_hostnames.rs @@ -25,11 +25,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use rustls::{ RootCertStore, pki_types::{CertificateDer, pem::PemObject}, @@ -221,6 +224,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || "Hello from foobar.tld!")); @@ -231,6 +235,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_connect_ssh_on_https_port.rs b/tests/integration/https_connect_ssh_on_https_port.rs index 5edff66..9c703b1 100644 --- a/tests/integration/https_connect_ssh_on_https_port.rs +++ b/tests/integration/https_connect_ssh_on_https_port.rs @@ -25,11 +25,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use rustls::{ RootCertStore, pki_types::{CertificateDer, pem::PemObject}, @@ -212,6 +215,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || "We managed to beat port-blocking!")); @@ -222,6 +226,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_force_random_subdomains.rs b/tests/integration/https_force_random_subdomains.rs index 7e4aecb..445c6d4 100644 --- a/tests/integration/https_force_random_subdomains.rs +++ b/tests/integration/https_force_random_subdomains.rs @@ -26,11 +26,14 @@ use hyper_util::{ server::conn::auto::Builder, }; use regex::Regex; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use rustls::{ RootCertStore, pki_types::{CertificateDer, pem::PemObject}, @@ -251,6 +254,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || "This was a triumph.")); @@ -261,6 +265,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_http11_fallback.rs b/tests/integration/https_http11_fallback.rs index f713d68..86e2db4 100644 --- a/tests/integration/https_http11_fallback.rs +++ b/tests/integration/https_http11_fallback.rs @@ -23,6 +23,7 @@ use http::header::{COOKIE, HOST}; use http_body_util::BodyExt; use hyper::{StatusCode, body::Incoming, server::conn::http1::Builder, service::service_fn}; use hyper_util::rt::{TokioExecutor, TokioIo}; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -210,6 +211,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -232,6 +234,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_http2.rs b/tests/integration/https_http2.rs index f5efe50..7e25a0a 100644 --- a/tests/integration/https_http2.rs +++ b/tests/integration/https_http2.rs @@ -24,7 +24,7 @@ use hyper::{StatusCode, body::Incoming, server::conn::http2::Builder, service::s use hyper_util::rt::{TokioExecutor, TokioIo}; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ ChannelId, @@ -228,6 +228,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -247,6 +248,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/https_multi_stream_download.rs b/tests/integration/https_multi_stream_download.rs index fc2420c..44079ec 100644 --- a/tests/integration/https_multi_stream_download.rs +++ b/tests/integration/https_multi_stream_download.rs @@ -35,7 +35,7 @@ use hyper_util::{ use rand::Rng; use russh::{ Channel, Preferred, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ client::Config, @@ -258,6 +258,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let data = self.0.clone(); @@ -282,6 +283,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_multi_stream_upload.rs b/tests/integration/https_multi_stream_upload.rs index 83e2527..17260e5 100644 --- a/tests/integration/https_multi_stream_upload.rs +++ b/tests/integration/https_multi_stream_upload.rs @@ -33,7 +33,7 @@ use hyper_util::{ use rand::Rng; use russh::{ Channel, Preferred, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ client::Config, @@ -241,6 +241,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -261,6 +262,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_random_subdomains_with_fixed_seed.rs b/tests/integration/https_random_subdomains_with_fixed_seed.rs index afe55f9..fd2c49d 100644 --- a/tests/integration/https_random_subdomains_with_fixed_seed.rs +++ b/tests/integration/https_random_subdomains_with_fixed_seed.rs @@ -24,11 +24,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use rustls::{ RootCertStore, pki_types::{CertificateDer, pem::PemObject}, @@ -240,6 +243,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", head(async || "I'm always at the same subdomain!")); @@ -250,6 +254,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_random_subdomains_with_fixed_seed_file.rs b/tests/integration/https_random_subdomains_with_fixed_seed_file.rs index 386c987..4d95e73 100644 --- a/tests/integration/https_random_subdomains_with_fixed_seed_file.rs +++ b/tests/integration/https_random_subdomains_with_fixed_seed_file.rs @@ -25,11 +25,14 @@ use hyper_util::{ server::conn::auto::Builder, }; use rand::{rng, seq::IndexedRandom}; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use rustls::{ RootCertStore, pki_types::{CertificateDer, pem::PemObject}, @@ -266,6 +269,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", head(async || "I'm always at the same subdomain!")); @@ -276,6 +280,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_rate_limit_download.rs b/tests/integration/https_rate_limit_download.rs index 8c33930..0e57295 100644 --- a/tests/integration/https_rate_limit_download.rs +++ b/tests/integration/https_rate_limit_download.rs @@ -34,11 +34,14 @@ use hyper_util::{ }; use rand::Rng; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use rustls::{ RootCertStore, pki_types::{CertificateDer, pem::PemObject}, @@ -223,6 +226,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", post(async |_body: Bytes| StatusCode::NO_CONTENT)); @@ -233,6 +237,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_rate_limit_upload.rs b/tests/integration/https_rate_limit_upload.rs index 81ec7bc..d769c04 100644 --- a/tests/integration/https_rate_limit_upload.rs +++ b/tests/integration/https_rate_limit_upload.rs @@ -29,11 +29,14 @@ use hyper_util::{ }; use rand::Rng; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use rustls::{ RootCertStore, pki_types::{CertificateDer, pem::PemObject}, @@ -220,6 +223,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let mut data = vec![0u8; 55_000]; @@ -233,6 +237,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_single_stream_download.rs b/tests/integration/https_single_stream_download.rs index 1cf2775..5dca4fd 100644 --- a/tests/integration/https_single_stream_download.rs +++ b/tests/integration/https_single_stream_download.rs @@ -35,7 +35,7 @@ use hyper_util::{ use rand::Rng; use russh::{ Channel, Preferred, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ client::Config, @@ -247,6 +247,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let data = self.0.clone(); @@ -271,6 +272,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/https_single_stream_upload.rs b/tests/integration/https_single_stream_upload.rs index 4fb8ff5..da39008 100644 --- a/tests/integration/https_single_stream_upload.rs +++ b/tests/integration/https_single_stream_upload.rs @@ -33,7 +33,7 @@ use hyper_util::{ use rand::Rng; use russh::{ Channel, Preferred, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ client::Config, @@ -230,6 +230,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -250,6 +251,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/ipv6_blocklist_by_user.rs b/tests/integration/ipv6_blocklist_by_user.rs index 5b95018..5795056 100644 --- a/tests/integration/ipv6_blocklist_by_user.rs +++ b/tests/integration/ipv6_blocklist_by_user.rs @@ -24,11 +24,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, ChannelId, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -311,6 +314,7 @@ impl russh::client::Handler for SshClientProxy { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || StatusCode::NO_CONTENT)); @@ -321,6 +325,7 @@ impl russh::client::Handler for SshClientProxy { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/lib_configure_from_scratch.rs b/tests/integration/lib_configure_from_scratch.rs index 9c1762d..eba2bd0 100644 --- a/tests/integration/lib_configure_from_scratch.rs +++ b/tests/integration/lib_configure_from_scratch.rs @@ -18,7 +18,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use rand::{rng, seq::IndexedRandom}; -use russh::client::AuthResult; +use russh::client::{AuthResult, ChannelOpenHandle}; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -218,12 +218,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/quota_maximum_per_user.rs b/tests/integration/quota_maximum_per_user.rs index ceb5289..fc6d10c 100644 --- a/tests/integration/quota_maximum_per_user.rs +++ b/tests/integration/quota_maximum_per_user.rs @@ -23,11 +23,14 @@ use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, }; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ net::TcpStream, @@ -231,6 +234,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route("/", get(async || "Max quota shenanigans.")); @@ -241,6 +245,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/sni_aliasing.rs b/tests/integration/sni_aliasing.rs index 776984c..349e63a 100644 --- a/tests/integration/sni_aliasing.rs +++ b/tests/integration/sni_aliasing.rs @@ -26,7 +26,7 @@ use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, keys::ssh_key::private::Ed25519Keypair, }; use russh::{ @@ -268,6 +268,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -296,6 +297,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/sni_aliasing_timeout.rs b/tests/integration/sni_aliasing_timeout.rs index 7e4b340..d2f9a5a 100644 --- a/tests/integration/sni_aliasing_timeout.rs +++ b/tests/integration/sni_aliasing_timeout.rs @@ -25,7 +25,7 @@ use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, keys::ssh_key::private::Ed25519Keypair, }; use russh::{ @@ -251,6 +251,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -285,6 +286,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/sni_proxy.rs b/tests/integration/sni_proxy.rs index 0de4632..d17aeec 100644 --- a/tests/integration/sni_proxy.rs +++ b/tests/integration/sni_proxy.rs @@ -24,7 +24,7 @@ use hyper::{StatusCode, body::Incoming, server::conn::http1::Builder, service::s use hyper_util::rt::TokioIo; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ ChannelId, @@ -231,6 +231,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -259,6 +260,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/sni_timeout.rs b/tests/integration/sni_timeout.rs index 02d0426..57644e5 100644 --- a/tests/integration/sni_timeout.rs +++ b/tests/integration/sni_timeout.rs @@ -22,7 +22,7 @@ use hyper::{body::Incoming, server::conn::http2::Builder, service::service_fn}; use hyper_util::rt::{TokioExecutor, TokioIo}; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ ChannelId, @@ -205,6 +205,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -239,6 +240,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } diff --git a/tests/integration/ssh_client_timeout.rs b/tests/integration/ssh_client_timeout.rs index cee06a4..c01bf8e 100644 --- a/tests/integration/ssh_client_timeout.rs +++ b/tests/integration/ssh_client_timeout.rs @@ -23,7 +23,7 @@ use std::{ use clap::Parser; use russh::{ Channel, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, keys::{key::PrivateKeyWithHashAlg, load_secret_key}, }; use sandhole::{ApplicationConfig, entrypoint}; @@ -215,12 +215,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/ssh_ignore_data_on_non_session_channels.rs b/tests/integration/ssh_ignore_data_on_non_session_channels.rs index 0620bc5..6bae5a1 100644 --- a/tests/integration/ssh_ignore_data_on_non_session_channels.rs +++ b/tests/integration/ssh_ignore_data_on_non_session_channels.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -157,6 +158,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -171,6 +173,7 @@ impl russh::client::Handler for SshClient { } channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/ssh_proxy_jump.rs b/tests/integration/ssh_proxy_jump.rs index d34d0a2..7f9b4f3 100644 --- a/tests/integration/ssh_proxy_jump.rs +++ b/tests/integration/ssh_proxy_jump.rs @@ -26,7 +26,7 @@ use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; use russh::{ Channel, MethodSet, - client::{self, Msg}, + client::{self, ChannelOpenHandle, Msg}, keys::ssh_key::private::Ed25519Keypair, server::{self, Auth, Server}, }; @@ -284,6 +284,7 @@ impl client::Handler for SshClient { connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut client::Session, ) -> Result<(), Self::Error> { let handler = self.server.new_client( @@ -319,6 +320,7 @@ impl client::Handler for SshClient { } } }); + reply.accept().await; Ok(()) } } @@ -363,13 +365,15 @@ impl server::Handler for HoneypotHandler { async fn channel_open_session( &mut self, channel: russh::Channel, + reply: russh::server::ChannelOpenHandle, _session: &mut server::Session, - ) -> Result { + ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); - Ok(true) + reply.accept().await; + Ok(()) } } @@ -392,6 +396,7 @@ impl client::Handler for ProxyClient { connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut client::Session, ) -> Result<(), Self::Error> { let handler = Honeypot.new_client( @@ -415,6 +420,7 @@ impl client::Handler for ProxyClient { } } }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/ssh_rate_limit_download.rs b/tests/integration/ssh_rate_limit_download.rs index fffecd2..8c60360 100644 --- a/tests/integration/ssh_rate_limit_download.rs +++ b/tests/integration/ssh_rate_limit_download.rs @@ -26,7 +26,7 @@ use rand::{Rng, RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; use russh::{ Channel, ChannelMsg, MethodSet, - client::{self, Msg}, + client::{self, ChannelOpenHandle, Msg}, keys::ssh_key::private::Ed25519Keypair, server::{self, Auth, Server}, }; @@ -221,6 +221,7 @@ impl client::Handler for SshClient { connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut client::Session, ) -> Result<(), Self::Error> { let handler = self.server.new_client( @@ -256,6 +257,7 @@ impl client::Handler for SshClient { } } }); + reply.accept().await; Ok(()) } } @@ -300,8 +302,9 @@ impl server::Handler for HoneypotHandler { async fn channel_open_session( &mut self, mut channel: russh::Channel, + reply: russh::server::ChannelOpenHandle, _session: &mut server::Session, - ) -> Result { + ) -> Result<(), Self::Error> { tokio::spawn(async move { let mut expected_len = 55_000; while let Some(msg) = channel.wait().await { @@ -314,7 +317,8 @@ impl server::Handler for HoneypotHandler { } } }); - Ok(true) + reply.accept().await; + Ok(()) } } @@ -337,6 +341,7 @@ impl client::Handler for ProxyClient { connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut client::Session, ) -> Result<(), Self::Error> { let handler = Honeypot.new_client( @@ -360,6 +365,7 @@ impl client::Handler for ProxyClient { } } }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/ssh_rate_limit_upload.rs b/tests/integration/ssh_rate_limit_upload.rs index 1c4509b..dcf5896 100644 --- a/tests/integration/ssh_rate_limit_upload.rs +++ b/tests/integration/ssh_rate_limit_upload.rs @@ -26,7 +26,7 @@ use rand::{Rng, RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; use russh::{ Channel, MethodSet, - client::{self, Msg}, + client::{self, ChannelOpenHandle, Msg}, keys::ssh_key::private::Ed25519Keypair, server::{self, Auth, Server}, }; @@ -218,6 +218,7 @@ impl client::Handler for SshClient { connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut client::Session, ) -> Result<(), Self::Error> { let handler = self.server.new_client( @@ -253,6 +254,7 @@ impl client::Handler for SshClient { } } }); + reply.accept().await; Ok(()) } } @@ -297,8 +299,9 @@ impl server::Handler for HoneypotHandler { async fn channel_open_session( &mut self, channel: russh::Channel, + reply: russh::server::ChannelOpenHandle, _session: &mut server::Session, - ) -> Result { + ) -> Result<(), Self::Error> { let mut data = vec![0u8; 55_000]; rand::rng().fill_bytes(&mut data); tokio::spawn(async move { @@ -306,7 +309,8 @@ impl server::Handler for HoneypotHandler { stream.write_all(&data).await.unwrap(); stream.flush().await.unwrap(); }); - Ok(true) + reply.accept().await; + Ok(()) } } @@ -329,6 +333,7 @@ impl client::Handler for ProxyClient { connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut client::Session, ) -> Result<(), Self::Error> { let handler = Honeypot.new_client( @@ -352,6 +357,7 @@ impl client::Handler for ProxyClient { } } }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_allow_requested_ports.rs b/tests/integration/tcp_allow_requested_ports.rs index e8fbb6f..0e76d08 100644 --- a/tests/integration/tcp_allow_requested_ports.rs +++ b/tests/integration/tcp_allow_requested_ports.rs @@ -19,6 +19,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; +use russh::client::ChannelOpenHandle; use russh::keys::ssh_key::private::Ed25519Keypair; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ @@ -250,12 +251,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_assign_random_port_0.rs b/tests/integration/tcp_assign_random_port_0.rs index 0801de5..aed3f6e 100644 --- a/tests/integration/tcp_assign_random_port_0.rs +++ b/tests/integration/tcp_assign_random_port_0.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -155,6 +156,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -164,6 +166,7 @@ impl russh::client::Handler for SshClient { .unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_bind_random_ports.rs b/tests/integration/tcp_bind_random_ports.rs index cbddecf..94b2d34 100644 --- a/tests/integration/tcp_bind_random_ports.rs +++ b/tests/integration/tcp_bind_random_ports.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -183,12 +184,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_ip_connections_limit.rs b/tests/integration/tcp_ip_connections_limit.rs index 2867cde..7614060 100644 --- a/tests/integration/tcp_ip_connections_limit.rs +++ b/tests/integration/tcp_ip_connections_limit.rs @@ -20,11 +20,14 @@ use std::{ }; use clap::Parser; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ io::AsyncReadExt, @@ -176,6 +179,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -184,6 +188,7 @@ impl russh::client::Handler for SshClient { channel.eof().await.unwrap(); channel.close().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_multi_stream_download.rs b/tests/integration/tcp_multi_stream_download.rs index 87290c4..51d01c5 100644 --- a/tests/integration/tcp_multi_stream_download.rs +++ b/tests/integration/tcp_multi_stream_download.rs @@ -22,7 +22,7 @@ use clap::Parser; use rand::Rng; use russh::{ Channel, Preferred, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ client::Config, @@ -196,6 +196,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -218,6 +219,7 @@ impl russh::client::Handler for SshClient { stream.write_all(&len_buf[..]).await.unwrap(); stream.flush().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_multi_stream_upload.rs b/tests/integration/tcp_multi_stream_upload.rs index d4b75af..339f27b 100644 --- a/tests/integration/tcp_multi_stream_upload.rs +++ b/tests/integration/tcp_multi_stream_upload.rs @@ -22,7 +22,7 @@ use clap::Parser; use rand::Rng; use russh::{ Channel, ChannelMsg, Preferred, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ client::Config, @@ -189,6 +189,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let bytes = self.0.clone(); @@ -207,6 +208,7 @@ impl russh::client::Handler for SshClient { .unwrap(); } }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_pool_timeout.rs b/tests/integration/tcp_pool_timeout.rs index efed5e5..8417873 100644 --- a/tests/integration/tcp_pool_timeout.rs +++ b/tests/integration/tcp_pool_timeout.rs @@ -20,11 +20,14 @@ use std::{ }; use clap::Parser; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ io::AsyncReadExt, @@ -187,6 +190,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -195,6 +199,7 @@ impl russh::client::Handler for SshClient { channel.eof().await.unwrap(); channel.close().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_rate_limit_download.rs b/tests/integration/tcp_rate_limit_download.rs index 6f28546..2d3190f 100644 --- a/tests/integration/tcp_rate_limit_download.rs +++ b/tests/integration/tcp_rate_limit_download.rs @@ -21,6 +21,7 @@ use clap::Parser; use rand::Rng; use russh::ChannelMsg; +use russh::client::ChannelOpenHandle; use russh::{ Channel, client::{Msg, Session}, @@ -169,6 +170,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -183,6 +185,7 @@ impl russh::client::Handler for SshClient { } } }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_rate_limit_upload.rs b/tests/integration/tcp_rate_limit_upload.rs index eaae142..804fe85 100644 --- a/tests/integration/tcp_rate_limit_upload.rs +++ b/tests/integration/tcp_rate_limit_upload.rs @@ -20,6 +20,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use rand::Rng; +use russh::client::ChannelOpenHandle; use russh::{ Channel, client::{Msg, Session}, @@ -164,6 +165,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let mut data = vec![0u8; 55_000]; @@ -172,6 +174,7 @@ impl russh::client::Handler for SshClient { let mut stream = channel.into_stream(); stream.write_all(&data).await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_reject_low_ports.rs b/tests/integration/tcp_reject_low_ports.rs index 2bebc9f..a2d074e 100644 --- a/tests/integration/tcp_reject_low_ports.rs +++ b/tests/integration/tcp_reject_low_ports.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -144,12 +145,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_reject_port_above_max.rs b/tests/integration/tcp_reject_port_above_max.rs index fd516b5..e47ca45 100644 --- a/tests/integration/tcp_reject_port_above_max.rs +++ b/tests/integration/tcp_reject_port_above_max.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -248,12 +249,14 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { channel.data(&b"Hello, world!"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/tcp_timeout.rs b/tests/integration/tcp_timeout.rs index 2a5997b..e2f2c0d 100644 --- a/tests/integration/tcp_timeout.rs +++ b/tests/integration/tcp_timeout.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -154,6 +155,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -162,6 +164,7 @@ impl russh::client::Handler for SshClient { channel.data(&b"Two\n"[..]).await.unwrap(); channel.eof().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/udp_allow_requested_ports.rs b/tests/integration/udp_allow_requested_ports.rs index 44b2df3..2438400 100644 --- a/tests/integration/udp_allow_requested_ports.rs +++ b/tests/integration/udp_allow_requested_ports.rs @@ -19,6 +19,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; use rand::{RngExt, SeedableRng}; use rand_chacha::ChaCha20Rng; +use russh::client::ChannelOpenHandle; use russh::keys::ssh_key::private::Ed25519Keypair; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ @@ -261,6 +262,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -272,6 +274,7 @@ impl russh::client::Handler for SshClient { } channel.data(&b"\x00\x04Pong"[..]).await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/udp_assign_random_port_0.rs b/tests/integration/udp_assign_random_port_0.rs index 4fd2ac3..774bdc0 100644 --- a/tests/integration/udp_assign_random_port_0.rs +++ b/tests/integration/udp_assign_random_port_0.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -167,6 +168,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -178,6 +180,7 @@ impl russh::client::Handler for SshClient { } channel.data(&b"\x00\x04Pong"[..]).await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/udp_bind_random_ports.rs b/tests/integration/udp_bind_random_ports.rs index 6e9a7cb..c78c91f 100644 --- a/tests/integration/udp_bind_random_ports.rs +++ b/tests/integration/udp_bind_random_ports.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -199,6 +200,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -210,6 +212,7 @@ impl russh::client::Handler for SshClient { } channel.data(&b"\x00\x04Pong"[..]).await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/udp_ip_connections_limit.rs b/tests/integration/udp_ip_connections_limit.rs index 26a90b2..e18a32f 100644 --- a/tests/integration/udp_ip_connections_limit.rs +++ b/tests/integration/udp_ip_connections_limit.rs @@ -20,11 +20,14 @@ use std::{ }; use clap::Parser; -use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, client::{Msg, Session}, }; +use russh::{ + client::ChannelOpenHandle, + keys::{key::PrivateKeyWithHashAlg, load_secret_key}, +}; use sandhole::{ApplicationConfig, entrypoint}; use tokio::{ io::{AsyncReadExt, AsyncWriteExt}, @@ -211,6 +214,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -223,6 +227,7 @@ impl russh::client::Handler for SshClient { stream.write_all(&b"\x00\x02OK"[..]).await.unwrap(); stream.flush().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/udp_multi_stream.rs b/tests/integration/udp_multi_stream.rs index e93c5a6..6827ff3 100644 --- a/tests/integration/udp_multi_stream.rs +++ b/tests/integration/udp_multi_stream.rs @@ -21,7 +21,7 @@ use clap::Parser; use rand::Rng; use russh::{ Channel, Preferred, - client::{Msg, Session}, + client::{ChannelOpenHandle, Msg, Session}, }; use russh::{ client::Config, @@ -200,6 +200,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -214,6 +215,7 @@ impl russh::client::Handler for SshClient { stream.write_all(&n.to_be_bytes()[..]).await.unwrap(); stream.flush().await.unwrap(); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/udp_rate_limit.rs b/tests/integration/udp_rate_limit.rs index 43242d8..1638d1c 100644 --- a/tests/integration/udp_rate_limit.rs +++ b/tests/integration/udp_rate_limit.rs @@ -21,6 +21,7 @@ use clap::Parser; use rand::Rng; use russh::ChannelMsg; +use russh::client::ChannelOpenHandle; use russh::{ Channel, client::{Msg, Session}, @@ -191,6 +192,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -207,6 +209,7 @@ impl russh::client::Handler for SshClient { } } }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/udp_timeout.rs b/tests/integration/udp_timeout.rs index eae768c..5dd2e3a 100644 --- a/tests/integration/udp_timeout.rs +++ b/tests/integration/udp_timeout.rs @@ -17,6 +17,7 @@ use std::{sync::Arc, time::Duration}; use clap::Parser; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -203,6 +204,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { tokio::spawn(async move { @@ -227,6 +229,7 @@ impl russh::client::Handler for SshClient { } } }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/websocket_connection.rs b/tests/integration/websocket_connection.rs index 3bc8063..2899efc 100644 --- a/tests/integration/websocket_connection.rs +++ b/tests/integration/websocket_connection.rs @@ -28,6 +28,7 @@ use hyper::body::Incoming; use hyper::service::service_fn; use hyper_util::rt::{TokioExecutor, TokioIo}; use hyper_util::server::conn::auto::Builder; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -170,6 +171,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -191,6 +193,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } } diff --git a/tests/integration/websocket_timeout.rs b/tests/integration/websocket_timeout.rs index db1090b..b39df11 100644 --- a/tests/integration/websocket_timeout.rs +++ b/tests/integration/websocket_timeout.rs @@ -28,6 +28,7 @@ use hyper::body::Incoming; use hyper::service::service_fn; use hyper_util::rt::{TokioExecutor, TokioIo}; use hyper_util::server::conn::auto::Builder; +use russh::client::ChannelOpenHandle; use russh::keys::{key::PrivateKeyWithHashAlg, load_secret_key}; use russh::{ Channel, @@ -171,6 +172,7 @@ impl russh::client::Handler for SshClient { _connected_port: u32, _originator_address: &str, _originator_port: u32, + reply: ChannelOpenHandle, _session: &mut Session, ) -> Result<(), Self::Error> { let router = Router::new().route( @@ -191,6 +193,7 @@ impl russh::client::Handler for SshClient { .await .expect("Invalid request"); }); + reply.accept().await; Ok(()) } }