v0.50.0-beta.11
Pre-release
Pre-release
·
233 commits
to main
since this release
Changes
- 72847a7 / d4d3605: support automatic RSA key hash detection using server-sig-algs extension (#452 / #453)
Russh client now supports the server-sig-algs OpenSSH extension and can automatically select the strongest hash for RSA keys.
You can use russh::client::Handle::best_supported_rsa_hash() to choose the hash.
PrivateKeyWithHashAlg::new is now infallible and will ignore hash_alg for non-RSA keys, so you don't have to build separate logic just for RSA keys:
session.authenticate_publickey(
user,
PrivateKeyWithHashAlg::new(
Arc::new(key_pair),
session.best_supported_rsa_hash().await?.unwrap_or(...), // some fallback Option<HashAlg>
),
).await?;If you just want to fall back to SHA1 / ssh-rsa in case the server does not support server-sig-algs:
session.authenticate_publickey(
user,
PrivateKeyWithHashAlg::new(
Arc::new(key_pair),
session.best_supported_rsa_hash().await?.flatten(),
),
).await?;