What changed, and why it matters
This commit simply moves a function from one Rust source file to another. The code itself is unchanged; only its location in the project changed. There is no indication of a security fix or vulnerability.
No action required; treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit relocates rust_keystore_get_u2f_seed, a C-ABI-exposed wrapper around keystore::get_u2f_seed, from bitbox02-rust/src/keystore.rs to bitbox02-rust-c/src/firmware_c_api.rs. The function body, feature gate (#[cfg(feature = "app-u2f")]), signature, and behavior are identical. This is a pure refactor.
Changed components
src/rust/bitbox02-rust-c/src/firmware_c_api.rssrc/rust/bitbox02-rust/src/keystore.rsInspect captured patch +12 / −12
diff --git a/src/rust/bitbox02-rust-c/src/firmware_c_api.rs b/src/rust/bitbox02-rust-c/src/firmware_c_api.rs
index c5da0bf..a9fb4c2 100644
--- a/src/rust/bitbox02-rust-c/src/firmware_c_api.rs
+++ b/src/rust/bitbox02-rust-c/src/firmware_c_api.rs
@@ -30,3 +30,15 @@ pub unsafe extern "C" fn rust_salt_hash_data(
Err(()) => false,
}
}
+
+#[cfg(feature = "app-u2f")]
+#[unsafe(no_mangle)]
+pub extern "C" fn rust_keystore_get_u2f_seed(mut seed_out: util::bytes::BytesMut) -> bool {
+ match bitbox02_rust::keystore::get_u2f_seed(&mut crate::HalImpl::new()) {
+ Ok(seed) => {
+ seed_out.as_mut().copy_from_slice(&seed);
+ true
+ }
+ Err(_) => false,
+ }
+}
diff --git a/src/rust/bitbox02-rust/src/keystore.rs b/src/rust/bitbox02-rust/src/keystore.rs
index 75a00eb..41bc069 100644
--- a/src/rust/bitbox02-rust/src/keystore.rs
+++ b/src/rust/bitbox02-rust/src/keystore.rs
@@ -749,18 +749,6 @@ pub fn get_u2f_seed(hal: &mut impl crate::hal::Hal) -> Result<zeroize::Zeroizing
))
}
-#[cfg(feature = "app-u2f")]
-#[unsafe(no_mangle)]
-pub extern "C" fn rust_keystore_get_u2f_seed(mut seed_out: util::bytes::BytesMut) -> bool {
- match get_u2f_seed(&mut crate::hal::BitBox02Hal::new()) {
- Ok(seed) => {
- seed_out.as_mut().copy_from_slice(&seed);
- true
- }
- Err(_) => false,
- }
-}
-
#[cfg(feature = "testing")]
pub mod testing {
/// This mocks an unlocked keystore with the given bip39 recovery words and bip39 passphrase.
Why this scored 15/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.