fix(cli): resolve second factor via shared helper for recovery-qr + backup (key-file parity); wasm equivalence negative control

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01McMF5pUJbCMricmFEnf2sG
This commit is contained in:
adlee-was-taken
2026-06-26 00:11:50 -04:00
parent 23c8bbea65
commit 2203d817ec
5 changed files with 75 additions and 31 deletions

View File

@@ -670,6 +670,16 @@ mod session_tests {
extract(h_key.value()),
"key-file path must derive the identical master key as the stego-image path"
);
// Negative control: a DIFFERENT secret must derive a DIFFERENT master key
// (guards against a hypothetical constant/secret-insensitive KDF regression).
let h_other = unlock_with_secret("correct horse", &[4u8; 32], &salt, params)
.expect("unlock_with_secret other");
assert_ne!(
extract(h_img.value()),
extract(h_other.value()),
"a different secret must derive a different master key"
);
}
#[test]