keystore: remove unused extern "C" function
What changed, and why it matters
This commit simply deletes an unused test helper function from the Rust keystore code. There is no security issue, no bug fix, and no change to the actual wallet behavior.
No action required. This is a benign cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit removes rust_secp256k1_get_private_key, a #[cfg(feature = "c-unit-testing")] extern "C" wrapper that was only compiled for C unit tests. It is not referenced anywhere in the diff or commit message, and its removal does not affect production firmware builds. No vulnerability is introduced or fixed.
Changed components
src/rust/bitbox02-rust/src/keystore.rsInspect captured patch +0 / −19
diff --git a/src/rust/bitbox02-rust/src/keystore.rs b/src/rust/bitbox02-rust/src/keystore.rs
index 0fd3531..1609cba 100644
--- a/src/rust/bitbox02-rust/src/keystore.rs
+++ b/src/rust/bitbox02-rust/src/keystore.rs
@@ -631,25 +631,6 @@ pub fn get_u2f_seed() -> Result<zeroize::Zeroizing<Vec<u8>>, ()> {
))
}
-/// # Safety
-///
-/// keypath pointer has point to a buffer of length `keypath_len` uint32 elements.
-#[cfg(feature = "c-unit-testing")]
-#[unsafe(no_mangle)]
-pub unsafe extern "C" fn rust_secp256k1_get_private_key(
- keypath: *const u32,
- keypath_len: usize,
- mut out: util::bytes::BytesMut,
-) -> bool {
- match unsafe { secp256k1_get_private_key(core::slice::from_raw_parts(keypath, keypath_len)) } {
- Ok(private_key) => {
- out.as_mut().copy_from_slice(&private_key);
- true
- }
- 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 {
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.