From 9c2265e2d3e0ec3443d381fe279b57a3f2bf6fa2 Mon Sep 17 00:00:00 2001 From: Eugene Date: Wed, 17 Jul 2024 20:47:35 +0200 Subject: [PATCH] re-export russh_keys --- russh-keys/src/format/pkcs8.rs | 4 +++- russh/Cargo.toml | 1 + russh/examples/client_exec_interactive.rs | 2 +- russh/examples/client_exec_simple.rs | 2 +- russh/examples/echoserver.rs | 2 +- russh/examples/ratatui_app.rs | 2 +- russh/examples/ratatui_shared_app.rs | 2 +- russh/examples/sftp_client.rs | 2 +- russh/examples/sftp_server.rs | 2 +- russh/examples/test.rs | 2 +- russh/src/auth.rs | 5 +++-- russh/src/cert.rs | 4 ++-- russh/src/channels/io/tx.rs | 3 +-- russh/src/channels/mod.rs | 3 +-- russh/src/client/encrypted.rs | 7 +++---- russh/src/client/mod.rs | 11 +++++------ russh/src/client/session.rs | 5 ++--- russh/src/kex/curve25519.rs | 5 ++--- russh/src/kex/dh/mod.rs | 5 ++--- russh/src/kex/ecdh_nistp.rs | 5 ++--- russh/src/kex/mod.rs | 5 ++--- russh/src/kex/none.rs | 3 +-- russh/src/key.rs | 8 ++++---- russh/src/lib.rs | 3 +++ russh/src/negotiation.rs | 11 +++++------ russh/src/parsing.rs | 6 ++---- russh/src/server/encrypted.rs | 6 +++--- russh/src/server/kex.rs | 2 +- russh/src/server/mod.rs | 2 +- russh/src/server/session.rs | 2 +- russh/src/session.rs | 7 ++++--- russh/src/ssh_read.rs | 3 +-- russh/src/tests.rs | 2 +- russh/tests/test_data_stream.rs | 2 +- 34 files changed, 65 insertions(+), 71 deletions(-) diff --git a/russh-keys/src/format/pkcs8.rs b/russh-keys/src/format/pkcs8.rs index cef480fb..ceb8a313 100644 --- a/russh-keys/src/format/pkcs8.rs +++ b/russh-keys/src/format/pkcs8.rs @@ -1,8 +1,10 @@ use std::convert::{TryFrom, TryInto}; -use crate::{ec, key, key::SignatureHash, protocol, Error}; use pkcs8::{EncodePrivateKey, PrivateKeyInfo, SecretDocument}; +use crate::key::SignatureHash; +use crate::{ec, key, protocol, Error}; + /// Decode a PKCS#8-encoded private key. pub fn decode_pkcs8(ciphertext: &[u8], password: Option<&[u8]>) -> Result { let doc = SecretDocument::try_from(ciphertext)?; diff --git a/russh/Cargo.toml b/russh/Cargo.toml index 95148017..7901387b 100644 --- a/russh/Cargo.toml +++ b/russh/Cargo.toml @@ -16,6 +16,7 @@ rust-version = "1.65" default = ["flate2"] openssl = ["russh-keys/openssl", "dep:openssl"] vendored-openssl = ["openssl/vendored", "russh-keys/vendored-openssl"] +legacy-ed25519-pkcs8-parser = ["russh-keys/legacy-ed25519-pkcs8-parser"] [dependencies] aes = { workspace = true } diff --git a/russh/examples/client_exec_interactive.rs b/russh/examples/client_exec_interactive.rs index 4c67b1b9..7a428301 100644 --- a/russh/examples/client_exec_interactive.rs +++ b/russh/examples/client_exec_interactive.rs @@ -12,8 +12,8 @@ use anyhow::Result; use async_trait::async_trait; use clap::Parser; use log::info; +use russh::keys::*; use russh::*; -use russh_keys::*; use termion::raw::IntoRawMode; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::ToSocketAddrs; diff --git a/russh/examples/client_exec_simple.rs b/russh/examples/client_exec_simple.rs index 68d3aa7b..50787575 100644 --- a/russh/examples/client_exec_simple.rs +++ b/russh/examples/client_exec_simple.rs @@ -10,8 +10,8 @@ use anyhow::Result; use async_trait::async_trait; use clap::Parser; use log::info; +use russh::keys::*; use russh::*; -use russh_keys::*; use tokio::io::AsyncWriteExt; use tokio::net::ToSocketAddrs; diff --git a/russh/examples/echoserver.rs b/russh/examples/echoserver.rs index 5c146b5e..96627af4 100644 --- a/russh/examples/echoserver.rs +++ b/russh/examples/echoserver.rs @@ -2,9 +2,9 @@ use std::collections::HashMap; use std::sync::Arc; use async_trait::async_trait; +use russh::keys::*; use russh::server::{Msg, Server as _, Session}; use russh::*; -use russh_keys::*; use tokio::sync::Mutex; #[tokio::main] diff --git a/russh/examples/ratatui_app.rs b/russh/examples/ratatui_app.rs index 8f563656..f42439cf 100644 --- a/russh/examples/ratatui_app.rs +++ b/russh/examples/ratatui_app.rs @@ -7,9 +7,9 @@ use ratatui::layout::Rect; use ratatui::style::{Color, Style}; use ratatui::widgets::{Block, Borders, Clear, Paragraph}; use ratatui::Terminal; +use russh::keys::key::PublicKey; use russh::server::*; use russh::{Channel, ChannelId}; -use russh_keys::key::PublicKey; use tokio::sync::Mutex; type SshTerminal = Terminal>; diff --git a/russh/examples/ratatui_shared_app.rs b/russh/examples/ratatui_shared_app.rs index 81e96111..174a6d6e 100644 --- a/russh/examples/ratatui_shared_app.rs +++ b/russh/examples/ratatui_shared_app.rs @@ -7,9 +7,9 @@ use ratatui::layout::Rect; use ratatui::style::{Color, Style}; use ratatui::widgets::{Block, Borders, Clear, Paragraph}; use ratatui::Terminal; +use russh::keys::key::PublicKey; use russh::server::*; use russh::{Channel, ChannelId}; -use russh_keys::key::PublicKey; use tokio::sync::Mutex; type SshTerminal = Terminal>; diff --git a/russh/examples/sftp_client.rs b/russh/examples/sftp_client.rs index 04bc58cf..4870d057 100644 --- a/russh/examples/sftp_client.rs +++ b/russh/examples/sftp_client.rs @@ -2,8 +2,8 @@ use std::sync::Arc; use async_trait::async_trait; use log::{error, info, LevelFilter}; +use russh::keys::*; use russh::*; -use russh_keys::*; use russh_sftp::client::SftpSession; use tokio::io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt}; diff --git a/russh/examples/sftp_server.rs b/russh/examples/sftp_server.rs index 3ae24abb..2558fbb9 100644 --- a/russh/examples/sftp_server.rs +++ b/russh/examples/sftp_server.rs @@ -5,9 +5,9 @@ use std::time::Duration; use async_trait::async_trait; use log::{error, info, LevelFilter}; +use russh::keys::key::KeyPair; use russh::server::{Auth, Msg, Server as _, Session}; use russh::{Channel, ChannelId}; -use russh_keys::key::KeyPair; use russh_sftp::protocol::{File, FileAttributes, Handle, Name, Status, StatusCode, Version}; use tokio::sync::Mutex; diff --git a/russh/examples/test.rs b/russh/examples/test.rs index a4d0b8f1..6cf6853b 100644 --- a/russh/examples/test.rs +++ b/russh/examples/test.rs @@ -3,9 +3,9 @@ use std::sync::{Arc, Mutex}; use async_trait::async_trait; use log::debug; +use russh::keys::*; use russh::server::{Auth, Msg, Server as _, Session}; use russh::*; -use russh_keys::*; #[tokio::main] async fn main() -> anyhow::Result<()> { diff --git a/russh/src/auth.rs b/russh/src/auth.rs index 0de09a9e..0f3c3da6 100644 --- a/russh/src/auth.rs +++ b/russh/src/auth.rs @@ -16,12 +16,13 @@ use std::sync::Arc; use bitflags::bitflags; -use russh_cryptovec::CryptoVec; -use russh_keys::{encoding, key}; use ssh_key::Certificate; use thiserror::Error; use tokio::io::{AsyncRead, AsyncWrite}; +use crate::keys::{encoding, key}; +use crate::CryptoVec; + bitflags! { /// Set of authentication methods, represented by bit flags. #[derive(Debug, Clone, Copy, PartialEq, Eq)] diff --git a/russh/src/cert.rs b/russh/src/cert.rs index 7eb8dd36..9991e81b 100644 --- a/russh/src/cert.rs +++ b/russh/src/cert.rs @@ -1,10 +1,10 @@ -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::Encoding; use ssh_encoding::Encode; use ssh_key::{Algorithm, Certificate, EcdsaCurve}; use crate::key::PubKey; +use crate::keys::encoding::Encoding; use crate::negotiation::Named; +use crate::CryptoVec; /// OpenSSH certificate for DSA public key const CERT_DSA: &str = "ssh-dss-cert-v01@openssh.com"; diff --git a/russh/src/channels/io/tx.rs b/russh/src/channels/io/tx.rs index 6b03a6f7..47ce2726 100644 --- a/russh/src/channels/io/tx.rs +++ b/russh/src/channels/io/tx.rs @@ -4,14 +4,13 @@ use std::sync::Arc; use std::task::{ready, Context, Poll}; use futures::FutureExt; -use russh_cryptovec::CryptoVec; use tokio::io::AsyncWrite; use tokio::sync::mpsc::error::SendError; use tokio::sync::mpsc::{self, OwnedPermit}; use tokio::sync::{Mutex, OwnedMutexGuard}; use super::ChannelMsg; -use crate::ChannelId; +use crate::{ChannelId, CryptoVec}; type BoxedThreadsafeFuture = Pin>>; type OwnedPermitFuture = diff --git a/russh/src/channels/mod.rs b/russh/src/channels/mod.rs index aee70c3f..5b095d9b 100644 --- a/russh/src/channels/mod.rs +++ b/russh/src/channels/mod.rs @@ -1,11 +1,10 @@ use std::sync::Arc; -use russh_cryptovec::CryptoVec; use tokio::io::{AsyncRead, AsyncWrite}; use tokio::sync::mpsc::{Sender, UnboundedReceiver}; use tokio::sync::Mutex; -use crate::{ChannelId, ChannelOpenFailure, Error, Pty, Sig}; +use crate::{ChannelId, ChannelOpenFailure, CryptoVec, Error, Pty, Sig}; pub mod io; diff --git a/russh/src/client/encrypted.rs b/russh/src/client/encrypted.rs index 280dda9e..8f66078c 100644 --- a/russh/src/client/encrypted.rs +++ b/russh/src/client/encrypted.rs @@ -17,18 +17,17 @@ use std::convert::TryInto; use std::num::Wrapping; use log::{debug, error, info, trace, warn}; -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::{Encoding, Reader}; -use russh_keys::key::parse_public_key; use crate::client::{Handler, Msg, Prompt, Reply, Session}; use crate::key::PubKey; +use crate::keys::encoding::{Encoding, Reader}; +use crate::keys::key::parse_public_key; use crate::negotiation::{Named, Select}; use crate::parsing::{ChannelOpenConfirmation, ChannelType, OpenChannelMessage}; use crate::session::{Encrypted, EncryptedState, GlobalRequestResponse, Kex, KexInit}; use crate::{ auth, msg, negotiation, strict_kex_violation, Channel, ChannelId, ChannelMsg, - ChannelOpenFailure, ChannelParams, Sig, + ChannelOpenFailure, ChannelParams, CryptoVec, Sig, }; thread_local! { diff --git a/russh/src/client/mod.rs b/russh/src/client/mod.rs index f1a6c7bd..a2f9d8c0 100644 --- a/russh/src/client/mod.rs +++ b/russh/src/client/mod.rs @@ -45,9 +45,6 @@ use async_trait::async_trait; use futures::task::{Context, Poll}; use futures::Future; use log::{debug, error, info, trace}; -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::Reader; -use russh_keys::key::{self, parse_public_key, PublicKey, SignatureHash}; use ssh_key::Certificate; use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt, ReadHalf, WriteHalf}; use tokio::net::{TcpStream, ToSocketAddrs}; @@ -60,6 +57,8 @@ use tokio::sync::{oneshot, Mutex}; use crate::channels::{Channel, ChannelMsg, ChannelRef}; use crate::cipher::{self, clear, CipherPair, OpeningKey}; use crate::key::PubKey; +use crate::keys::encoding::Reader; +use crate::keys::key::{self, parse_public_key, PublicKey, SignatureHash}; use crate::session::{ CommonSession, EncryptedState, Exchange, GlobalRequestResponse, Kex, KexDhDone, KexInit, NewKeys, @@ -67,8 +66,8 @@ use crate::session::{ use crate::ssh_read::SshRead; use crate::sshbuffer::{SSHBuffer, SshId}; use crate::{ - auth, msg, negotiation, strict_kex_violation, ChannelId, ChannelOpenFailure, Disconnect, - Limits, Sig, + auth, msg, negotiation, strict_kex_violation, ChannelId, ChannelOpenFailure, CryptoVec, + Disconnect, Limits, Sig, }; mod encrypted; @@ -1265,7 +1264,7 @@ impl KexDhDone { debug!("sig_type: {:?}", sig_type); sig_reader.read_string().map_err(crate::Error::from)? }; - use russh_keys::key::Verify; + use crate::keys::key::Verify; debug!("signature: {:?}", signature); if !pubkey.verify_server_auth(hash.as_ref(), signature) { debug!("wrong server sig"); diff --git a/russh/src/client/session.rs b/russh/src/client/session.rs index 4c93d1ad..e068d7e2 100644 --- a/russh/src/client/session.rs +++ b/russh/src/client/session.rs @@ -1,11 +1,10 @@ use log::error; -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::Encoding; use tokio::sync::oneshot; use crate::client::Session; +use crate::keys::encoding::Encoding; use crate::session::EncryptedState; -use crate::{msg, ChannelId, Disconnect, Pty, Sig}; +use crate::{msg, ChannelId, CryptoVec, Disconnect, Pty, Sig}; impl Session { fn channel_open_generic( diff --git a/russh/src/kex/curve25519.rs b/russh/src/kex/curve25519.rs index 9ca5be15..c26267b4 100644 --- a/russh/src/kex/curve25519.rs +++ b/russh/src/kex/curve25519.rs @@ -3,13 +3,12 @@ use curve25519_dalek::constants::ED25519_BASEPOINT_TABLE; use curve25519_dalek::montgomery::MontgomeryPoint; use curve25519_dalek::scalar::Scalar; use log::debug; -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::Encoding; use super::{compute_keys, KexAlgorithm, KexType}; +use crate::keys::encoding::Encoding; use crate::mac::{self}; use crate::session::Exchange; -use crate::{cipher, msg}; +use crate::{cipher, msg, CryptoVec}; pub struct Curve25519KexType {} diff --git a/russh/src/kex/dh/mod.rs b/russh/src/kex/dh/mod.rs index 52fc5835..e409348d 100644 --- a/russh/src/kex/dh/mod.rs +++ b/russh/src/kex/dh/mod.rs @@ -6,15 +6,14 @@ use digest::Digest; use groups::DH; use log::debug; use num_bigint::BigUint; -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::Encoding; use sha1::Sha1; use sha2::{Sha256, Sha512}; use self::groups::{DhGroup, DH_GROUP1, DH_GROUP14, DH_GROUP16}; use super::{compute_keys, KexAlgorithm, KexType}; +use crate::keys::encoding::Encoding; use crate::session::Exchange; -use crate::{cipher, mac, msg}; +use crate::{cipher, mac, msg, CryptoVec}; pub struct DhGroup1Sha1KexType {} diff --git a/russh/src/kex/ecdh_nistp.rs b/russh/src/kex/ecdh_nistp.rs index b51961d7..58ad899c 100644 --- a/russh/src/kex/ecdh_nistp.rs +++ b/russh/src/kex/ecdh_nistp.rs @@ -9,14 +9,13 @@ use log::debug; use p256::NistP256; use p384::NistP384; use p521::NistP521; -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::Encoding; use sha2::{Digest, Sha256, Sha384, Sha512}; use crate::kex::{compute_keys, KexAlgorithm, KexType}; +use crate::keys::encoding::Encoding; use crate::mac::{self}; use crate::session::Exchange; -use crate::{cipher, msg}; +use crate::{cipher, msg, CryptoVec}; pub struct EcdhNistP256KexType {} diff --git a/russh/src/kex/mod.rs b/russh/src/kex/mod.rs index 3777a01f..c01ef42d 100644 --- a/russh/src/kex/mod.rs +++ b/russh/src/kex/mod.rs @@ -31,13 +31,12 @@ use dh::{ use digest::Digest; use ecdh_nistp::{EcdhNistP256KexType, EcdhNistP384KexType, EcdhNistP521KexType}; use once_cell::sync::Lazy; -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::Encoding; -use crate::cipher; use crate::cipher::CIPHERS; +use crate::keys::encoding::Encoding; use crate::mac::{self, MACS}; use crate::session::Exchange; +use crate::{cipher, CryptoVec}; pub(crate) trait KexType { fn make(&self) -> Box; diff --git a/russh/src/kex/none.rs b/russh/src/kex/none.rs index 66d903ac..5d421886 100644 --- a/russh/src/kex/none.rs +++ b/russh/src/kex/none.rs @@ -1,6 +1,5 @@ -use russh_cryptovec::CryptoVec; - use super::{KexAlgorithm, KexType}; +use crate::CryptoVec; pub struct NoneKexType {} diff --git a/russh/src/key.rs b/russh/src/key.rs index 0abd090b..b24fb176 100644 --- a/russh/src/key.rs +++ b/russh/src/key.rs @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::*; -use russh_keys::key::*; -use russh_keys::{ec, protocol}; +use crate::keys::encoding::*; +use crate::keys::key::*; +use crate::keys::{ec, protocol}; +use crate::CryptoVec; #[doc(hidden)] pub trait PubKey { diff --git a/russh/src/lib.rs b/russh/src/lib.rs index dbb6a8be..93ff1bd2 100644 --- a/russh/src/lib.rs +++ b/russh/src/lib.rs @@ -111,6 +111,9 @@ pub mod kex; /// MAC algorithm names pub mod mac; +/// Re-export of the `russh-keys` crate. +pub use russh_keys as keys; + mod cert; mod key; mod msg; diff --git a/russh/src/negotiation.rs b/russh/src/negotiation.rs index 09faf9cf..9cd7f2aa 100644 --- a/russh/src/negotiation.rs +++ b/russh/src/negotiation.rs @@ -17,15 +17,14 @@ use std::str::from_utf8; use log::debug; use rand::RngCore; -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::{Encoding, Reader}; -use russh_keys::key; -use russh_keys::key::{KeyPair, PublicKey}; use crate::cipher::CIPHERS; use crate::kex::{EXTENSION_OPENSSH_STRICT_KEX_AS_CLIENT, EXTENSION_OPENSSH_STRICT_KEX_AS_SERVER}; +use crate::keys::encoding::{Encoding, Reader}; +use crate::keys::key; +use crate::keys::key::{KeyPair, PublicKey}; use crate::server::Config; -use crate::{cipher, compression, kex, mac, msg, Error}; +use crate::{cipher, compression, kex, mac, msg, CryptoVec, Error}; #[derive(Debug, Clone)] pub struct Names { @@ -146,7 +145,7 @@ impl Named for () { } } -use russh_keys::key::ED25519; +use crate::keys::key::ED25519; impl Named for PublicKey { fn name(&self) -> &'static str { diff --git a/russh/src/parsing.rs b/russh/src/parsing.rs index 77f84e07..8144b6e0 100644 --- a/russh/src/parsing.rs +++ b/russh/src/parsing.rs @@ -1,7 +1,5 @@ -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::{Encoding, Position}; - -use crate::msg; +use crate::keys::encoding::{Encoding, Position}; +use crate::{msg, CryptoVec}; #[derive(Debug)] pub struct OpenChannelMessage { diff --git a/russh/src/server/encrypted.rs b/russh/src/server/encrypted.rs index c82ad83f..87318e77 100644 --- a/russh/src/server/encrypted.rs +++ b/russh/src/server/encrypted.rs @@ -18,14 +18,14 @@ use auth::*; use byteorder::{BigEndian, ByteOrder}; use log::{debug, error, info, trace, warn}; use negotiation::Select; -use russh_keys::encoding::{Encoding, Position, Reader}; -use russh_keys::key; -use russh_keys::key::Verify; use tokio::time::Instant; use {msg, negotiation}; use super::super::*; use super::*; +use crate::keys::encoding::{Encoding, Position, Reader}; +use crate::keys::key; +use crate::keys::key::Verify; use crate::msg::SSH_OPEN_ADMINISTRATIVELY_PROHIBITED; use crate::parsing::{ChannelOpenConfirmation, ChannelType, OpenChannelMessage}; diff --git a/russh/src/server/kex.rs b/russh/src/server/kex.rs index 5efbbacd..6961e01f 100644 --- a/russh/src/server/kex.rs +++ b/russh/src/server/kex.rs @@ -1,12 +1,12 @@ use std::cell::RefCell; use log::debug; -use russh_keys::encoding::{Encoding, Reader}; use super::*; use crate::cipher::SealingKey; use crate::kex::KEXES; use crate::key::PubKey; +use crate::keys::encoding::{Encoding, Reader}; use crate::negotiation::Select; use crate::{msg, negotiation}; diff --git a/russh/src/server/mod.rs b/russh/src/server/mod.rs index bc10d00c..f3df15b3 100644 --- a/russh/src/server/mod.rs +++ b/russh/src/server/mod.rs @@ -38,13 +38,13 @@ use std::task::{Context, Poll}; use async_trait::async_trait; use futures::future::Future; use log::{debug, error}; -use russh_keys::key; use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt}; use tokio::net::{TcpListener, ToSocketAddrs}; use tokio::pin; use tokio::task::JoinHandle; use crate::cipher::{clear, CipherPair, OpeningKey}; +use crate::keys::key; use crate::session::*; use crate::ssh_read::*; use crate::sshbuffer::*; diff --git a/russh/src/server/session.rs b/russh/src/server/session.rs index 02fd4638..a2b7210b 100644 --- a/russh/src/server/session.rs +++ b/russh/src/server/session.rs @@ -2,7 +2,6 @@ use std::collections::{HashMap, VecDeque}; use std::sync::Arc; use log::debug; -use russh_keys::encoding::{Encoding, Reader}; use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt}; use tokio::sync::mpsc::{unbounded_channel, Receiver, Sender, UnboundedReceiver}; use tokio::sync::{oneshot, Mutex}; @@ -10,6 +9,7 @@ use tokio::sync::{oneshot, Mutex}; use super::*; use crate::channels::{Channel, ChannelMsg, ChannelRef}; use crate::kex::EXTENSION_SUPPORT_AS_CLIENT; +use crate::keys::encoding::{Encoding, Reader}; use crate::msg; /// A connected server session. This type is unique to a client. diff --git a/russh/src/session.rs b/russh/src/session.rs index c1958227..c8379824 100644 --- a/russh/src/session.rs +++ b/russh/src/session.rs @@ -19,14 +19,15 @@ use std::num::Wrapping; use byteorder::{BigEndian, ByteOrder}; use log::{debug, trace}; -use russh_cryptovec::CryptoVec; -use russh_keys::encoding::Encoding; use tokio::sync::oneshot; use crate::cipher::SealingKey; use crate::kex::KexAlgorithm; +use crate::keys::encoding::Encoding; use crate::sshbuffer::SSHBuffer; -use crate::{auth, cipher, mac, msg, negotiation, ChannelId, ChannelParams, Disconnect, Limits}; +use crate::{ + auth, cipher, mac, msg, negotiation, ChannelId, ChannelParams, CryptoVec, Disconnect, Limits, +}; #[derive(Debug)] pub(crate) struct Encrypted { diff --git a/russh/src/ssh_read.rs b/russh/src/ssh_read.rs index dc1b01f5..072642c6 100644 --- a/russh/src/ssh_read.rs +++ b/russh/src/ssh_read.rs @@ -2,10 +2,9 @@ use std::pin::Pin; use futures::task::*; use log::debug; -use russh_cryptovec::CryptoVec; use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, ReadBuf}; -use crate::Error; +use crate::{CryptoVec, Error}; /// The buffer to read the identification string (first line in the /// protocol). diff --git a/russh/src/tests.rs b/russh/src/tests.rs index ed207132..2efcbe40 100644 --- a/russh/src/tests.rs +++ b/russh/src/tests.rs @@ -137,11 +137,11 @@ mod compress { mod channels { use async_trait::async_trait; - use russh_cryptovec::CryptoVec; use server::Session; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use super::*; + use crate::CryptoVec; async fn test_session( client_handler: CH, diff --git a/russh/tests/test_data_stream.rs b/russh/tests/test_data_stream.rs index dcbb14ae..3d909961 100644 --- a/russh/tests/test_data_stream.rs +++ b/russh/tests/test_data_stream.rs @@ -2,9 +2,9 @@ use std::net::{SocketAddr, TcpListener, TcpStream}; use std::sync::Arc; use rand::RngCore; +use russh::keys::key; use russh::server::{self, Auth, Msg, Server as _, Session}; use russh::{client, Channel}; -use russh_keys::key; use tokio::io::{AsyncReadExt, AsyncWriteExt}; pub const WINDOW_SIZE: u32 = 8 * 2048;