Skip to content

Update russh monorepo #8393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update russh monorepo #8393

wants to merge 1 commit into from

Conversation

oxide-renovate[bot]
Copy link
Contributor

This PR contains the following updates:

Package Type Update Change
russh dependencies minor 0.45.0 -> 0.52.1
russh-keys dependencies minor 0.45.0 -> 0.49.2

Release Notes

warp-tech/russh (russh)

v0.52.1

Compare Source

Fixes

v0.52.0

Compare Source

Features

Fixes

v0.51.1

Compare Source

Changes

russh has previously disallowed <2048-bit RSA keys - whether as private or as server host keys, both as server and client due to a security check in the ssh-key crate.

This behaviour has now been changed to allow these keys, and the decision to accept or reject them now lies on the library consumer. To recreate the old behaviour within your Handler, add the following check to your check_server_key implementation. You'll need to import the rsa crate.

async fn check_server_key(
    &mut self,
    server_public_key: &PublicKey,
) -> Result<bool, Self::Error> {
    use rsa::traits::PublicKeyParts;

    if let Some(ssh_pk) = server_public_key.key_data().rsa() {
        let rsa_pk: rsa::RsaPublicKey = ssh_pk.try_into()?;
        if rsa_pk.size() < 2048 {
            return Ok(false);
        }
    }
    
    ...
}
  • 0c722b8: partial_success support (#​478) #​478
  • 32a9ee1: Add a crate feature to enable DSA support (#​473) (Francesco Degrassi) #​473
  • db5e5ba: wait for extension info from the server in the best_supported_rsa_hash method. Previously there was a race condition between calling best_supported_rsa_hash and the server sending the EXT_INFO message. Now russh will wait for up to one second to receive EXT_INFO when you call best_supported_rsa_hash.
  • 92362fc: Introduce Channel::split() to allow splitting a channel into a read half and a write half (#​482) (Uli Schlachter) #​482
  • 32667df: Added support for additional DH groups (#​486) (Jacob Van Brunt) #​486
  • replaced libc dependency with nix (#​483) #​483 (iHsin)

Fixes

v0.51.0

Compare Source

v0.50.4

Compare Source

Fixes

  • 83aacd1: re-fixed #​470 - correctly ignore hash_alg argument when signing with non-RSA keys via agent
  • bf235bc: fixed #​470 - incorrect hash passed for an RSA key offer in agent authentication

v0.50.3

Compare Source

Changes

Fixes

v0.50.2

Compare Source

[email protected]

Changes

Reverted a change from 0.50.0 that made cryptovec panic when the OS fails to mlock() the memory.

Instead, russh-cryptovec will log a one-time log warning about this.

A common cause for these errors is running on Linux under a low RLIMIT_MEMLOCK limit

Docs

v0.50.1

Compare Source

v0.50.0

Compare Source

Significant changes

russh_keys merged into russh

  • 23cc724: (#​450) - the russh_keys crate has been fully merged into russh. If you have been importing from russh::keys, no changes are needed, otherwise remove the russh_keys dependency and replace all use russh_keys imports with use russh::keys.

Native async traits

  • 3e04597: (#​455) - client::Handler, server::Handler and other traits are now native Rust async traits. In most cases, you can simply remove the #[async_trait] macro from your trait impl. Alternatively, you can enable the async_trait feature, which will turn the traits into #[async_trait]s again. Note that the old async_trait support will be removed soon.

RSA hash negotiation

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?;

Channel backpressure

  • f89c19c: added backpressure to channel buffers (#​412) (Eric Rodrigues Pires) #​412 - set Config::channel_buffer_size to control how many channel messages can be buffered before backpressure propagates over the network. Previously russh would simply buffer unread channel messages infinitely, eventually causing an out-of-RAM situation, and now it will block the connection until you consume them. Even if the server does not write data to the channel (e.g. it's a write-only channel for you as a client), it is still writing flow control messages, which you must consume.

So, any time you open a channel, make sure you have a loop somewhere that is either polling .wait() or reads from the AsyncRead side of its ChannelStream.

ssh-key traits

  • ab8aca8: russh has migrated to its own fork of the ssh-key crate, removed bundled workarounds - if you were relying on traits directly imported from ssh_key, you might need to import them from russh::keys::ssh_key instead.

New features

  • c9baadf: DH GEX support (#​440) - diffie-hellman-group-exchange-sha256 KEX is now on the default kex list. To take advantage of dynamic DH groups, pre-generate some safe primes and implement dynamic group lookup in the server::Handler::lookup_dh_gex_group method - see this method's docs for more info.
  • 66f9416: Add an option to enable TCP_NODELAY (#​435) (Patryk Wychowaniec)
  • 571dbe3: added support for loading PPK v2 and v3 private keys
  • 030468a: added authentication_banner method to server::Handler (#​415) (Eric Rodrigues Pires) #​415 - you can now send a dynamic SSH banner to clients.
  • 4c7b27a: expose the "remaining methods" field in auth failure responses #​441
  • 77f53ed: support for parsing X9.62 EC private keys
  • 902010f: Allow setting hash algorithm to use for signing requests of SSH agent (#​449) (Wiktor Kwapisiewicz) #​449

MSRV

MSRV for the russh crate is now 1.75

Changes

Fixes

v0.49.2

Compare Source

Fixes

  • cb5d3ba: fixed #​418 - client - incorrect kex signature verification for RSA-SHA2
  • 97ec468: Remove calls to dbg!() (#​414) (Eric Rodrigues Pires)

v0.49.1

Compare Source

v0.49.0

Compare Source

Changes

This release fixes the regression in v0.48 which made it impossible to choose the hash algorithm when using RSA keys for authentication. Unfortunately, the fix is a breaking API change, hence the version bump.

client::Handle::authenticate_publickey now takes a russh_keys::key::PrivateKeyWithHashAlg which you can construct from an Arc<russh_keys::PrivateKey> + Option<russh_keys::HashAlg>.

The latter lets you choose between SHA1, SHA256 and SHA512 for RSA keys, and must be None for all other key types.

Example:

let key_pair = load_secret_key(key_path, None)?;

let auth_res = session
    .authenticate_publickey(
        user, 
        PrivateKeyWithHashAlg::new(Arc::new(key_pair), Some(HashAlg::Sha512))?
    )
    .await?;

v0.48.2

Compare Source

Fixes

  • 044da62: fixed handling of rsa-sha2-* key algorithms

v0.48.1

Compare Source

Breaking changes

russh v0.48 drops its own data parsing and key handling code in favor of the RustCrypto project's ssh-key (#​368) and ssh-encoding (#​371) crates. This means there are some breaking changes, which are listed here:

Important for library users
  • russh_keys::key::PublicKey is replaced with russh_keys::PublicKey (ssh_key::PublicKey)

  • russh_keys::key::KeyPair is replaced with russh_keys::PrivateKey (ssh_key::PrivateKey)

  • russh_keys::key::parse_public_key no longer takes a hash algorithm argument as RSA keys are no longer locked down to a specific algorithm internally. RSA key specific hash algorithms are only used in Preferred::key.

  • Key type constants in russh_keys::key and russh_keys::key::Name are removed - use the russh_keys::Algorithm enum instead. Config::preferred::key now also takes russh_keys::Algorithms instead of russh_key::key::Names.

  • russh::client::Handle::authenticate_future is renamed to russh::client::Handle::authenticate_publickey_with

Less important
  • new russh::Error enum variants:

    • Error:Signature
    • Error:SshKey
    • Error:SshEncoding
  • new russh_keys::Error enum variants:

    • Error::Rsa
    • Error::Utf8
  • russh::auth::Signer is now an async_trait

  • russh_keys::ec is removed

  • russh_keys::encoding is removed (use russh_keys::ssh_encoding)

  • russh_keys::signature is removed

  • russh_keys::protocol is removed

  • russh_keys::key::SignatureHash is replaced with russh_keys::HashAlg (ssh_key::HashAlg)

  • russh_keys::key::SignatureBytes is removed

  • russh_keys::key::RsaPrivate is removed (use russh_keys::ssh_key::private::RsaPrivateKey)

  • russh_keys::key::RsaPublic is removed (use russh_keys::ssh_key::public::RsaPublicKey)

  • russh_keys::key::RsaCrtExtra is removed

  • russh_keys::key::Signature is replaced with russh_keys::signature::Signature (signature::Signature)

Features

  • aa9bdb4: added support for sk-ecdsa-sha2-nistp256-cert-v01@​openssh.com and sk-ssh-ed25519-cert-v01@​openssh.com keys in client
  • 68fff93: Add support for StrictHostKeyChecking and UserKnownHostsFile (#​386) (Mattias Eriksson) #​386
  • 981cf7b: Derive Debug where possible (#​374) (Quentin Santos) #​374
  • c328558: Implement From<&str> and From<&[u8]> for CryptoVec (#​391) (Josh McKinney) #​391

Fixes

Docs

v0.48.0

Compare Source

v0.46.0

Compare Source

Changes

Fixes


Configuration

📅 Schedule: Branch creation - "after 8pm,before 6am" in timezone America/Los_Angeles, Automerge - "after 8pm,before 6am" in timezone America/Los_Angeles.

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@oxide-renovate oxide-renovate bot added the dependencies Pull requests that update a dependency file label Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants