Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 01f1bf2

Browse files
authored
zeroize: Allow versions newer than 1.3 for aes-gcm-siv (#33618)
`aes-gcm-siv` v0.10.3 has a constraints on maximum `zeroize` version, set to be 1.3 or below. At the same time, `cargo` does not want to construct a dependency graph with duplicate instances of a crate, when the first non-zero version of those instances are the same. That is, it refuses to build a workspace with both 1.3 and 1.4 versions of `zeroize`. `zeroize` is actually backward compatible, and `aes-gcm-siv` restriction is overly pessimistic. This package lifted this restriction in a newer versions, but we still depend on older versions and can not immediately update. In order to be able to use a version of `zeroize` newer than 1.3 we need to remove a similar restriction from `curve25519-dalek` as well.
1 parent 6fd0dcb commit 01f1bf2

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ wasm-bindgen = "0.2"
418418
winapi = "0.3.8"
419419
winreg = "0.50"
420420
x509-parser = "0.14.0"
421+
# See "zeroize versioning issues" below if you are updating this version.
421422
zeroize = { version = "1.3", default-features = false }
422423
zstd = "0.11.2"
423424

@@ -450,3 +451,43 @@ crossbeam-epoch = { git = "https://github.com/solana-labs/crossbeam", rev = "fd2
450451
# overrides in sync.
451452
solana-program = { path = "sdk/program" }
452453
solana-zk-token-sdk = { path = "zk-token-sdk" }
454+
#
455+
# === zeroize versioning issues ===
456+
#
457+
# A number of packages used explicit upper bound on the `zeroize` package, such
458+
# as `>=1, <1.4`. The problem is that cargo still does not duplicate `zeroize`
459+
# if a newer version is available and requested by another package and just
460+
# fails the whole dependency resolution process.
461+
#
462+
# This is described in
463+
#
464+
# https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#multiple-requirements
465+
#
466+
# So we have to patch `zeroize` dependency specifications in the projects that
467+
# introduce these constraints. They have already removed these constraints in
468+
# newer versions, but we have not updated yet. As we update, we need to remove
469+
# these patch requests.
470+
#
471+
# When our dependencies are upgraded, we can remove this patches. Before that
472+
# we might need to maintain these patches in sync with our full dependency
473+
# tree.
474+
475+
# Our dependency tree has `aes-gcm-siv` v0.10.3 and the `zeroize` restriction
476+
# was removed in the next commit just after the release. So it seems safe to
477+
# patch to this commit.
478+
#
479+
# `aes-gcm-siv` v0.10.3 release:
480+
#
481+
# https://github.com/RustCrypto/AEADs/releases/tag/aes-gcm-siv-v0.10.3
482+
#
483+
# Corresponds to commit
484+
#
485+
# https://github.com/RustCrypto/AEADs/commit/6f16f4577a1fc839a2346cf8c5531c85a44bf5c0
486+
#
487+
# Comparison with `6105d7a5591aefa646a95d12b5e8d3f55a9214ef` pinned here:
488+
#
489+
# https://github.com/RustCrypto/AEADs/compare/aes-gcm-siv-v0.10.3..6105d7a5591aefa646a95d12b5e8d3f55a9214ef
490+
#
491+
[patch.crates-io.aes-gcm-siv]
492+
git = "https://github.com/RustCrypto/AEADs"
493+
rev = "6105d7a5591aefa646a95d12b5e8d3f55a9214ef"

0 commit comments

Comments
 (0)