What changed, and why it matters
This commit only strengthens a unit test for the wallet restore feature. It replaces a weak check (seed length is 32 bytes) with exact expected seed values derived from a hardcoded test recovery phrase. There is no change to production firmware code, no bug fix, and no security vulnerability.
No security action needed. Treat as routine test improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In src/rust/bitbox02-rust/src/hww/api/restore.rs, the test for restore_from_mnemonic now asserts the exact BIP-39 seed and internal keystore seed produced from the hardcoded test mnemonic. The previous assertion only verified the seed length. This is a test-hardening change with no functional code modifications.
Changed components
src/rust/bitbox02-rust/src/hww/api/restore.rs (unit tests only)Inspect captured patch +10 / −1
diff --git a/src/rust/bitbox02-rust/src/hww/api/restore.rs b/src/rust/bitbox02-rust/src/hww/api/restore.rs
index d58c593..b5a55ee 100644
--- a/src/rust/bitbox02-rust/src/hww/api/restore.rs
+++ b/src/rust/bitbox02-rust/src/hww/api/restore.rs
@@ -212,6 +212,15 @@ mod tests {
assert_eq!(counter, 2);
assert!(!keystore::is_locked());
assert!(memory::is_initialized());
- assert!(keystore::copy_seed().unwrap().len() == 32);
+ // Seed of hardcoded phrase used in unit tests:
+ // boring mistake dish oyster truth pigeon viable emerge sort crash wire portion cannon couple enact box walk height pull today solid off enable tide
+ assert_eq!(
+ hex::encode(keystore::copy_seed().unwrap()),
+ "19f1bcfccf3e9d497cd245cf864ff0d42216625258d4f68d56b571aceb329257"
+ );
+ assert_eq!(
+ hex::encode(keystore::copy_bip39_seed().unwrap()),
+ "257724bccc8858cfe565b456b01263a4a6a45184fab4531f5c199649207a74e74c399a01d4f957258c05cee818369b31404c884a4b7a29ff6886bae6700fb56a"
+ );
}
}
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.