SFT-4441: Update Rust dependencies.
What changed, and why it matters
This commit updates several Rust library dependencies used in the Passport hardware wallet firmware and makes small code adjustments to match the new library versions. The most notable change is in the cryptographic signing code, where the code no longer wraps the data in a 'Message' object before creating a Schnorr signature. On its own, this looks like a routine compatibility update, but because it touches security-critical code (digital signatures), it warrants careful review to ensure the new calling pattern is safe and does not bypass any intended message-validation step.
Review the secp256k1 0.30 changelog and migration notes to confirm the API change is intentional and safe. Verify that every call site of `secp256k1_sign_schnorr` supplies a 32-byte digest and that the firmware's higher-level code still hashes/validates messages before reaching this function. Run the project's cryptographic test suite and, if available, fuzz or property-test the signing path. Treat this as a routine but security-relevant dependency update rather than an active vulnerability unless additional evidence emerges.
Security signals we found
Cryptographic signing API change: removal of Message wrapper in Schnorr signing path
Dependency version bumps for security-sensitive crates (secp256k1, bitcoin_hashes)
No explicit security advisory, CVE, or vendor security note present in commit or supplied references
No input-length or digest-validation checks visible in the changed signing function
Evidence from the diff
The diff bumps Cargo.toml/Cargo.lock versions for bitcoin_hashes (0.14→0.15), foundation-firmware (0.1.2→0.2.0), foundation-ur (0.3→0.4), hex-conservative (0.2.1→0.3.0), and secp256k1 (0.29→0.30). Code changes: (1) firmware.rs removes the unused use bitcoin_hashes::Hash import; (2) secp256k1.rs removes Message::from_digest_slice(data).unwrap() and passes data directly to sign_schnorr_with_rng. In secp256k1 0.30 the signing API was changed so the data argument is expected to be a 32-byte digest and the Message wrapper is no longer required. The change is consistent with upstream API evolution, but the diff does not show whether callers always supply a 32-byte digest or whether any length/validity checks were added elsewhere.
Changed components
extmod/foundation-rust/src/secp256k1.rsextmod/foundation-rust/src/firmware.rsRust dependency graph (bitcoin_hashes, foundation-firmware, foundation-ur, hex-conservative, secp256k1)Inspect captured patch +16 / −17
diff --git a/extmod/foundation-rust/Cargo.lock b/extmod/foundation-rust/Cargo.lock
index a775fd9..c657e7e 100644
--- a/extmod/foundation-rust/Cargo.lock
+++ b/extmod/foundation-rust/Cargo.lock
@@ -19,9 +19,9 @@ dependencies = [
[[package]]
name = "bitcoin_hashes"
-version = "0.14.0"
+version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16"
+checksum = "e0982261c82a50d89d1a411602afee0498b3e0debe3d36693f0c661352809639"
dependencies = [
"hex-conservative",
]
@@ -127,9 +127,9 @@ checksum = "7e6bdea1eeaa5edb5355234d02f81c6dbdd4bc5146887990dd29a213029bbeae"
[[package]]
name = "foundation-firmware"
-version = "0.1.2"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accae5ad04dd608e86b41e605ae7fc8e976cf182a6ce2d35c48463b1d5a5b783"
+checksum = "f3275fe6157eee489494fb148a173e0918181aacbd319c86e7d3fc3c221a241f"
dependencies = [
"bitcoin_hashes",
"heapless",
@@ -139,9 +139,9 @@ dependencies = [
[[package]]
name = "foundation-ur"
-version = "0.3.0"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71ead93a082dfa0a11c2bb43242a1cdc93b1e7976d768465b54a0703dbd3b003"
+checksum = "de4d0b63162220b26a3a955478ebc02e51fe77aa38181d058c55f3d1d6664428"
dependencies = [
"bitcoin_hashes",
"crc",
@@ -203,9 +203,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hex-conservative"
-version = "0.2.1"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd"
+checksum = "4afe881d0527571892c4034822e59bb10c6c991cce6abe8199b6f5cf10766f55"
dependencies = [
"arrayvec",
]
@@ -414,9 +414,9 @@ dependencies = [
[[package]]
name = "secp256k1"
-version = "0.29.0"
+version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3"
+checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252"
dependencies = [
"rand",
"secp256k1-sys",
diff --git a/extmod/foundation-rust/Cargo.toml b/extmod/foundation-rust/Cargo.toml
index aaad751..321f294 100644
--- a/extmod/foundation-rust/Cargo.toml
+++ b/extmod/foundation-rust/Cargo.toml
@@ -12,7 +12,7 @@ name = "sizes"
required-features = ["std"]
[dependencies.bitcoin_hashes]
-version = "0.14"
+version = "0.15"
features = ["small-hash"]
default-features = false
@@ -29,11 +29,11 @@ version = "1"
default-features = false
[dependencies.foundation-firmware]
-version = "0.1.2"
+version = "0.2"
default-features = false
[dependencies.foundation-ur]
-version = "0.3"
+version = "0.4"
default-features = false
[dependencies.foundation-urtypes]
@@ -53,7 +53,7 @@ default-features = false
features = ["critical-section"]
[dependencies.secp256k1]
-version = "0.29"
+version = "0.30"
default-features = false
features = ["lowmemory", "rand"]
diff --git a/extmod/foundation-rust/src/firmware.rs b/extmod/foundation-rust/src/firmware.rs
index bbd3a33..8cc44a3 100644
--- a/extmod/foundation-rust/src/firmware.rs
+++ b/extmod/foundation-rust/src/firmware.rs
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
use crate::secp256k1::PRE_ALLOCATED_CTX;
-use bitcoin_hashes::{sha256d, Hash};
+use bitcoin_hashes::sha256d;
use core::{ffi::c_char, slice};
use foundation_firmware::{VerifyHeaderError, VerifySignatureError};
use secp256k1::PublicKey;
diff --git a/extmod/foundation-rust/src/secp256k1.rs b/extmod/foundation-rust/src/secp256k1.rs
index 450d5b7..50be77b 100644
--- a/extmod/foundation-rust/src/secp256k1.rs
+++ b/extmod/foundation-rust/src/secp256k1.rs
@@ -74,9 +74,8 @@ pub extern "C" fn secp256k1_sign_schnorr(
let keypair = Keypair::from_seckey_slice(&PRE_ALLOCATED_CTX, secret_key)
.expect("invalid secret key");
- let msg = Message::from_digest_slice(data).unwrap();
let sig =
- PRE_ALLOCATED_CTX.sign_schnorr_with_rng(&msg, &keypair, &mut rng());
+ PRE_ALLOCATED_CTX.sign_schnorr_with_rng(data, &keypair, &mut rng());
signature.copy_from_slice(sig.as_ref());
}
Why this scored 29/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.