diff --git a/russh-keys/src/agent/client.rs b/russh-keys/src/agent/client.rs index a1f4cba3..146906e8 100644 --- a/russh-keys/src/agent/client.rs +++ b/russh-keys/src/agent/client.rs @@ -320,6 +320,7 @@ impl AgentClient { 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 { diff --git a/russh-keys/src/lib.rs b/russh-keys/src/lib.rs index e3c09ae6..fcbe5475 100644 --- a/russh-keys/src/lib.rs +++ b/russh-keys/src/lib.rs @@ -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 { diff --git a/russh/examples/echoserver.rs b/russh/examples/echoserver.rs index ec419155..dd4311c5 100644 --- a/russh/examples/echoserver.rs +++ b/russh/examples/echoserver.rs @@ -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())),