Skip to content
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

zeroize: Apply zeroize patch to all repository crates. #33853

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ winapi = "0.3.8"
winreg = "0.50"
x509-parser = "0.14.0"
# See "zeroize versioning issues" below if you are updating this version.
#
# TL;DR: We can not increment this until we move to a never version of
# `aes-gcm-siv` and `curve25519-dalek` and remove `[patch]` exceptions below for
# both crates.
zeroize = { version = "1.3", default-features = false }
zstd = "0.11.2"

Expand Down Expand Up @@ -473,6 +477,13 @@ solana-zk-token-sdk = { path = "zk-token-sdk" }
# When our dependencies are upgraded, we can remove this patches. Before that
# we might need to maintain these patches in sync with our full dependency
# tree.
#
# Same patches are applied to the following `Cargo.toml` files, make sure to
# update both in sync:
#
# - programs/sbf/Cargo.toml
# - sdk/cargo-build-sbf/tests/crates/fail/Cargo.toml
# - sdk/cargo-build-sbf/tests/crates/noop/Cargo.toml

# Our dependency tree has `aes-gcm-siv` v0.10.3 and the `zeroize` restriction
# was removed in the next commit just after the release. So it seems safe to
Expand Down
6 changes: 2 additions & 4 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions programs/sbf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,15 @@ targets = ["x86_64-unknown-linux-gnu"]
# overrides in sync.
solana-program = { path = "../../sdk/program" }
solana-zk-token-sdk = { path = "../../zk-token-sdk" }

#
# === zeroize versioning issues ===
#
# See `../../Cargo.toml` for details. The following patches allow us to build
# the whole repository with a newer version of `zeroize` than 1.3.
[patch.crates-io.aes-gcm-siv]
git = "https://github.com/RustCrypto/AEADs"
rev = "6105d7a5591aefa646a95d12b5e8d3f55a9214ef"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is a newer commit that removes the upper bound in the issue raised and discussed here. The updated commit here. I know the compatibility issue was around needing >1.4 and this commit removes the <1.5. But may be worth keeping if versioning requirements change in the future.

[patch.crates-io.curve25519-dalek]
git = "https://github.com/solana-labs/curve25519-dalek.git"
rev = "c14774464c4d38de553c6ef2f48a10982c1b4801"
10 changes: 10 additions & 0 deletions sdk/cargo-build-sbf/tests/crates/fail/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ solana-program = { path = "../../../../program", version = "=1.18.0" }
crate-type = ["cdylib"]

[workspace]

[patch.crates-io]
#
# === zeroize versioning issues ===
#
# See `../../../../../Cargo.toml` for details. The following patches allow us
# to build the whole repository with a newer version of `zeroize` than 1.3.
[patch.crates-io.curve25519-dalek]
git = "https://github.com/solana-labs/curve25519-dalek.git"
rev = "c14774464c4d38de553c6ef2f48a10982c1b4801"
13 changes: 13 additions & 0 deletions sdk/cargo-build-sbf/tests/crates/noop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,16 @@ solana-program = { path = "../../../../program", version = "=1.18.0" }
crate-type = ["cdylib"]

[workspace]

[patch.crates-io]
#
# === zeroize versioning issues ===
#
# See `../../../../../Cargo.toml` for details. The following patches allow us
# to build the whole repository with a newer version of `zeroize` than 1.3.
[patch.crates-io.aes-gcm-siv]
git = "https://github.com/RustCrypto/AEADs"
rev = "6105d7a5591aefa646a95d12b5e8d3f55a9214ef"
[patch.crates-io.curve25519-dalek]
git = "https://github.com/solana-labs/curve25519-dalek.git"
rev = "c14774464c4d38de553c6ef2f48a10982c1b4801"