[domistream] Host pairing: the host's state machine (pending-PIN slot, proof and signature checks, deadlines from the caller, trusted clients without a PIN)

This commit is contained in:
2026-12-04 12:30:30 +01:00
parent 3106f2cb46
commit 989defcc88
2 changed files with 189 additions and 26 deletions
+4 -1
View File
@@ -308,10 +308,13 @@ fn genuine_phase4(d: &mut Duo) -> (Vec<u8>, Vec<u8>) {
}
}
/// Builds a phase-4 value from the genuine secret and signature.
type Forge = dyn Fn(&[u8], &[u8]) -> Vec<u8>;
#[test]
fn bad_client_signatures() {
let rogue = rogue_id();
let cases: Vec<(&str, Box<dyn Fn(&[u8], &[u8]) -> Vec<u8>>)> = vec![
let cases: Vec<(&str, Box<Forge>)> = vec![
("signed by another key", Box::new(move |s, _| [s.to_vec(), rogue.sign(s).unwrap()].concat())),
(
"one bit flipped",