Skip to content

Update the coordinated RustCrypto dependency stack - #536

Open
lthiery wants to merge 2 commits into
Keats:masterfrom
lthiery:rustcrypto-2026
Open

Update the coordinated RustCrypto dependency stack#536
lthiery wants to merge 2 commits into
Keats:masterfrom
lthiery:rustcrypto-2026

Conversation

@lthiery

@lthiery lthiery commented Aug 24, 2026

Copy link
Copy Markdown

Builds on the direction discussed in #502, particularly the recommendation to update the full RustCrypto family together rather than carry duplicate hybrid-array/crypto-common/digest/signature generations.

This updates:

  • signature 2 -> 3
  • hmac 0.12 -> 0.13
  • sha2 0.10 -> 0.11
  • p256/p384 0.13 -> 0.14
  • ed25519-dalek 2 -> 3
  • rsa 0.9 -> 0.10.0-rc.18
  • rand 0.8 -> 0.10

The implementation changes are API migrations only: HMAC no longer resets a freshly cloned state, RSA uses BoxedUint, ECDSA uses the updated infallible recoverable-signature API, and the Ed25519 example uses the current RNG API.

The RSA prerelease requirement is an ordinary Cargo caret requirement. It permits newer prereleases of 0.10.0 and automatically permits the final 0.10.0 and later compatible 0.10.x versions once published. An existing application lockfile still requires its normal dependency update cycle.

Validated locally:

  • cargo fmt --check
  • cargo check --all-features
  • cargo clippy --all-targets --features rust_crypto -- -D warnings
  • cargo clippy --all-targets --features aws_lc_rs -- -D warnings
  • cargo test --features rust_crypto
  • cargo test --features aws_lc_rs

Related: #495 and #502.

rand 0.10 pulls in getrandom 0.4, which fails to compile on
wasm32-unknown-unknown unless its wasm_js feature is enabled. Point the
wasm target dependency at getrandom 0.4 and update the CI feature flag
from getrandom/js to getrandom/wasm_js.
@arckoor

arckoor commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Let's not depend on a rc version

@lthiery

lthiery commented Aug 24, 2026

Copy link
Copy Markdown
Author

I did take a look at keeping rsa on stable, but the cost is significant.

rsa 0.9 is built against the previous generation of digest/signature/rand traits, so keeping it alongside the updated stack means Cargo.toml carries renamed duplicates (sha2 0.10 + signature 2 + rand_core 0.6 next to their new versions)... so the tree ends up with 14 crates duplicated across two generations (sha2, digest, signature, crypto-common, block-buffer, const-oid, der, spki, pkcs8, pem-rfc7468, rand, rand_core, getrandom, cpufeatures).

The wasm build also gets both getrandom 0.2 and 0.4, each needing its own backend feature in CI. That is the situation #502 recommended avoiding.

rsa has been in its 0.10 pre/rc cycle since early 2024, so IMO, I would go for accepting the rc in favor of getting an unmitigated generational bump.

And then from the security angle, RUSTSEC-2023-0071 (Marvin) is flagged against all rsa versions, but the fix can only ever land on 0.10: it's a breaking change (the bignum backend swap), so 0.9 can't get it. Part of it is already in this rc, and when the advisory is resolved on 0.10, the caret requirement here means downstreams pick it up with a plain cargo update, no release needed on this crate.

Generally, I'd stay way from rc but it seems like a pragmatic step in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants