What changed, and why it matters
This commit updates a vendored Rust library used for deriving cryptocurrency keys (bip32-ed25519) from version 0.2.0 to 0.2.1. The visible code changes are mostly housekeeping: updating Rust edition, formatting, and explicitly zeroing out sensitive key data when dropped. There is no direct evidence in the commit message or diff of a security vulnerability being fixed, but updating a cryptographic dependency can sometimes include undisclosed fixes.
Review the upstream rust-bip32-ed25519 v0.2.1 release notes and compare full source between v0.2.0 and v0.2.1 to confirm whether this is a routine maintenance update or contains undisclosed security fixes. If using this firmware, ensure the updated dependency is included in the next build.
Security signals we found
Cryptographic key material handling changed: Xprv now explicitly derives ZeroizeOnDrop
Dependency version bump of a BIP32 Ed25519 key derivation library
No explicit security fix described in commit message or diff
Evidence from the diff
The commit bumps the vendored bip32-ed25519 crate from v0.2.0 to v0.2.1. The diff shows: Cargo.toml edition bump to 2024, rustfmt.toml addition, import reordering, replacement of #[zeroize(drop)] with ZeroizeOnDrop derive, and addition of Zeroize/ZeroizeOnDrop to the public Xprv wrapper. The actual logic changes in src/lib.rs are minimal and relate to memory clearing of expanded Ed25519 secret keys. No algorithmic or derivation logic changes are visible in the supplied diff.
Changed components
external/vendor/bip32-ed25519/src/lib.rssrc/rust/bitbox02-rust/Cargo.tomlsrc/rust/Cargo.lock.cargo/config.tomlInspect captured patch +34 / −28
diff --git a/.cargo/config.toml b/.cargo/config.toml
index 14501fe..6913f1b 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -6,9 +6,9 @@ git = "https://github.com/probe-rs/rtt-target.git"
rev = "117d9519a5d3b1f4bc024bc05f9e3c5dec0a57f5"
replace-with = "vendored-sources"
-[source."git+https://github.com/digitalbitbox/rust-bip32-ed25519?tag=v0.1.2"]
+[source."git+https://github.com/BitBoxSwiss/rust-bip32-ed25519?tag=v0.2.1"]
git = "https://github.com/BitBoxSwiss/rust-bip32-ed25519"
-tag = "v0.2.0"
+tag = "v0.2.1"
replace-with = "vendored-sources"
[source."git+https://github.com/benma/rust-bip39.git?branch=bb02"]
diff --git a/external/vendor/bip32-ed25519/.cargo-checksum.json b/external/vendor/bip32-ed25519/.cargo-checksum.json
index 912dfb6..76234a2 100644
--- a/external/vendor/bip32-ed25519/.cargo-checksum.json
+++ b/external/vendor/bip32-ed25519/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{".github/workflows/ci.yml":"f465a052857e00c4a513784ae8527fca34a9a0b1075c7511bbf302b96d6e9e36","Cargo.toml":"5723b22b427c57970086646e75e93276fe8d61215dc394419613c81257210950","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"5530596cde343de2238ec3276d94599ff6e78b7b7a20f6143162b3eceb727f29","README.md":"99a18dfc2a588d8b8cb3c287dad52d2e76c2b2b3be0e7a95cce19f509e9d59d7","src/arbitrary.rs":"ecb52788eec1142459ab252c320a5f0e421eb63cf959260b16e689ccfc8f2590","src/bigint.rs":"756b33c8d971b282b43268671c08fb4d8af095a6ebb6e9dc0c750631650e4d14","src/lib.rs":"93a19d865e85bde9646e42ef6c6b5106d6876c71fcffedad4b2c523deeb6f951","tests/table_test.rs":"7cba52f2578cfaf44f7d01a14ae1ce3b2b21857079722b7f04a507ca2884d878","tests/testdata/gen_table.py":"2fd91055920d9ac4cfb6c004b96aca42aaf2e3cf074d0d49d48ada993abdaedf","tests/testdata/table.json":"9e37a43d759f793b091f87488ea4b6d733154a10d29554c5103e12d617ae70cd"},"package":null}
\ No newline at end of file
+{"files":{".github/workflows/ci.yml":"d0ff5825b83ec08980dbb04e73e937b936197b228b1bb011bcaafd3e77c28688","Cargo.toml":"adfbd61e5383bc0797d07f7ca8066f036d608eb0a8a8b94b0324de8253d3b23d","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"5530596cde343de2238ec3276d94599ff6e78b7b7a20f6143162b3eceb727f29","README.md":"99a18dfc2a588d8b8cb3c287dad52d2e76c2b2b3be0e7a95cce19f509e9d59d7","rustfmt.toml":"f32d2f03b3f4b1e295c79ed49d543f1205c7dac7c3dc74f05a5a27af4fea0584","src/arbitrary.rs":"ecb52788eec1142459ab252c320a5f0e421eb63cf959260b16e689ccfc8f2590","src/bigint.rs":"756b33c8d971b282b43268671c08fb4d8af095a6ebb6e9dc0c750631650e4d14","src/lib.rs":"5744fd99f11d4a98bf88a5f4e9f73e13eb56cf7b29bacd8ebd98736bd06d88af","tests/table_test.rs":"2507b6b762fa27044a0a3922073ee50e4bcfc2f66b10f8e3ac9d36a12818c51f","tests/testdata/gen_table.py":"2fd91055920d9ac4cfb6c004b96aca42aaf2e3cf074d0d49d48ada993abdaedf","tests/testdata/table.json":"9e37a43d759f793b091f87488ea4b6d733154a10d29554c5103e12d617ae70cd"},"package":null}
\ No newline at end of file
diff --git a/external/vendor/bip32-ed25519/.github/workflows/ci.yml b/external/vendor/bip32-ed25519/.github/workflows/ci.yml
index af0b6d4..8a40f50 100644
--- a/external/vendor/bip32-ed25519/.github/workflows/ci.yml
+++ b/external/vendor/bip32-ed25519/.github/workflows/ci.yml
@@ -8,7 +8,7 @@ on: [push, pull_request]
jobs:
lint:
name: Lint
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -35,7 +35,7 @@ jobs:
test:
name: Test Suite
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
diff --git a/external/vendor/bip32-ed25519/Cargo.toml b/external/vendor/bip32-ed25519/Cargo.toml
index 742d076..1b1af8a 100644
--- a/external/vendor/bip32-ed25519/Cargo.toml
+++ b/external/vendor/bip32-ed25519/Cargo.toml
@@ -10,9 +10,9 @@
# See Cargo.toml.orig for the original contents.
[package]
-edition = "2021"
+edition = "2024"
name = "bip32-ed25519"
-version = "0.2.0"
+version = "0.2.1"
authors = ["Shift Crypto AG <support@shiftcrypto.ch>"]
build = false
autolib = false
diff --git a/external/vendor/bip32-ed25519/rustfmt.toml b/external/vendor/bip32-ed25519/rustfmt.toml
new file mode 100644
index 0000000..f216078
--- /dev/null
+++ b/external/vendor/bip32-ed25519/rustfmt.toml
@@ -0,0 +1 @@
+edition = "2024"
diff --git a/external/vendor/bip32-ed25519/src/lib.rs b/external/vendor/bip32-ed25519/src/lib.rs
index 7ca4186..ccced44 100644
--- a/external/vendor/bip32-ed25519/src/lib.rs
+++ b/external/vendor/bip32-ed25519/src/lib.rs
@@ -15,9 +15,9 @@ use alloc::boxed::Box;
use core::convert::TryInto;
use core::ops::{Deref, DerefMut};
-use digest::{core_api::BlockSizeUser, typenum::U64, Digest};
+use digest::{Digest, core_api::BlockSizeUser, typenum::U64};
use hmac::{Mac, SimpleHmac};
-use zeroize::{Zeroize, Zeroizing};
+use zeroize::{Zeroize, ZeroizeOnDrop, Zeroizing};
use curve25519_dalek::{
edwards::{CompressedEdwardsY, EdwardsPoint},
@@ -115,8 +115,7 @@ impl<D: Digest<OutputSize = U64> + BlockSizeUser> Xpub<D> {
}
}
-#[derive(Zeroize, Clone, Debug, PartialEq)]
-#[zeroize(drop)]
+#[derive(Zeroize, ZeroizeOnDrop, Clone, Debug, PartialEq)]
struct XprvData {
// An xprv consists of an expanded Ed25519 secret key and a chain
// code.
@@ -134,7 +133,7 @@ struct XprvData {
}
/// The `D` digest type param must implement SHA512. Use `sha2::Sha512` if in doubt.
-#[derive(Clone, Debug)]
+#[derive(Zeroize, ZeroizeOnDrop, Clone, Debug)]
pub struct Xprv<D: Digest<OutputSize = U64> + BlockSizeUser + Clone>(
// The data is boxed so that moving an `Xprv` does not accidentally
// leave copies of the data on the stack.
@@ -371,18 +370,24 @@ mod tests {
#[test]
fn xpub_hard_derivation_fails() {
- assert!(Xprv::<Sha512>::from_normalize(KEY, CHAIN_CODE)
- .public()
- .derive(HARDENED_OFFSET - 1)
- .is_ok());
- assert!(Xprv::<Sha512>::from_normalize(KEY, CHAIN_CODE)
- .public()
- .derive(HARDENED_OFFSET)
- .is_err());
- assert!(Xprv::<Sha512>::from_normalize(KEY, CHAIN_CODE)
- .public()
- .derive(u32::MAX)
- .is_err());
+ assert!(
+ Xprv::<Sha512>::from_normalize(KEY, CHAIN_CODE)
+ .public()
+ .derive(HARDENED_OFFSET - 1)
+ .is_ok()
+ );
+ assert!(
+ Xprv::<Sha512>::from_normalize(KEY, CHAIN_CODE)
+ .public()
+ .derive(HARDENED_OFFSET)
+ .is_err()
+ );
+ assert!(
+ Xprv::<Sha512>::from_normalize(KEY, CHAIN_CODE)
+ .public()
+ .derive(u32::MAX)
+ .is_err()
+ );
}
#[test]
diff --git a/external/vendor/bip32-ed25519/tests/table_test.rs b/external/vendor/bip32-ed25519/tests/table_test.rs
index 0a5503e..fead0ae 100644
--- a/external/vendor/bip32-ed25519/tests/table_test.rs
+++ b/external/vendor/bip32-ed25519/tests/table_test.rs
@@ -3,7 +3,7 @@ use std::fs::File;
use std::io::BufReader;
// Our crate:
-use bip32_ed25519::{Xprv, ED25519_EXPANDED_SECRET_KEY_SIZE};
+use bip32_ed25519::{ED25519_EXPANDED_SECRET_KEY_SIZE, Xprv};
// Another crate for comparison:
use ed25519_bip32;
diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock
index bf3d0a3..8afb8c9 100644
--- a/src/rust/Cargo.lock
+++ b/src/rust/Cargo.lock
@@ -69,8 +69,8 @@ checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72"
[[package]]
name = "bip32-ed25519"
-version = "0.2.0"
-source = "git+https://github.com/BitBoxSwiss/rust-bip32-ed25519?tag=v0.2.0#805cc066f9aba9022f8d4f74d82d59b7741336d8"
+version = "0.2.1"
+source = "git+https://github.com/BitBoxSwiss/rust-bip32-ed25519?tag=v0.2.1#385d8a907f694aab7ca3f61ad603804c72ac520a"
dependencies = [
"curve25519-dalek",
"digest",
diff --git a/src/rust/bitbox02-rust/Cargo.toml b/src/rust/bitbox02-rust/Cargo.toml
index 1cca60d..e4d2cc9 100644
--- a/src/rust/bitbox02-rust/Cargo.toml
+++ b/src/rust/bitbox02-rust/Cargo.toml
@@ -42,7 +42,7 @@ zeroize = { workspace = true }
num-bigint = { workspace = true, optional = true }
num-traits = { version = "0.2", default-features = false }
# If you change this, also change src/rust/.cargo/config.toml.
-bip32-ed25519 = { git = "https://github.com/BitBoxSwiss/rust-bip32-ed25519", tag = "v0.2.0", optional = true }
+bip32-ed25519 = { git = "https://github.com/BitBoxSwiss/rust-bip32-ed25519", tag = "v0.2.1", optional = true }
bech32 = { workspace = true, optional = true }
blake2 = { version = "0.10.6", default-features = false, optional = true }
minicbor = { version = "0.24.0", default-features = false, features = ["alloc"], optional = true }
Why this scored 21/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.