Skip to content

Commit

Permalink
fixup tests and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 committed Oct 14, 2022
1 parent c1472f6 commit ccb8364
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions russh-keys/src/agent/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ impl<S: AsyncRead + AsyncWrite + Unpin> AgentClient<S> {
key_blob(public, &mut self.buf)?;
self.buf.extend_ssh_string(data);
debug!("public = {:?}", public);
#[allow(unreachable_patterns)] // may not be unreachable depending on build flags
let hash = match public {
#[cfg(feature = "openssl")]
PublicKey::RSA { hash, .. } => match hash {
Expand Down
1 change: 1 addition & 0 deletions russh-keys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ Cog3JMeTrb3LiPHgN6gU2P30MRp6L1j1J/MtlOAr5rux
let (_, buf) = client.sign_request(&public, buf).await;
let _buf = buf?;
#[cfg(feature = "rs-crypto")]
#[allow(irrefutable_let_patterns)]
{
let (a, b) = _buf.split_at(_len);
if let key::KeyPair::Ed25519 { .. } = key {
Expand Down
9 changes: 8 additions & 1 deletion russh/examples/echoserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ async fn main() {
let mut config = russh::server::Config::default();
config.connection_timeout = Some(std::time::Duration::from_secs(3600));
config.auth_rejection_time = std::time::Duration::from_secs(3);

// Depending on whether you use OpenSSL or not, you can generate different keys:
#[cfg(feature = "openssl")]
let keypair = russh_keys::key::KeyPair::generate_rsa(2048, key::SignatureHash::SHA1).unwrap();
#[cfg(not(feature = "openssl"))]
let keypair = russh_keys::key::KeyPair::generate_ed25519().unwrap();

config
.keys
.push(russh_keys::key::KeyPair::generate_rsa(2048, key::SignatureHash::SHA1).unwrap());
.push(keypair);
let config = Arc::new(config);
let sh = Server {
clients: Arc::new(Mutex::new(HashMap::new())),
Expand Down

0 comments on commit ccb8364

Please sign in to comment.