[domistream] Host: HTTP requests, XML answers and pairing #12

Merged
mnovak merged 6 commits from feature/host-pairing-http into main 2026-12-04 12:50:03 +01:00
2 changed files with 12 additions and 3 deletions
Showing only changes of commit 80047c65df - Show all commits
+3 -1
View File
@@ -30,7 +30,9 @@ fn check(req: &HostRequest) {
assert_eq!(req.unique_id.as_deref(), Some(p.unique_id.as_str()), "/pair needs uniqueid");
match &p.phase {
PairPhase::GetServerCert { client_cert_pem, .. } => assert!(!client_cert_pem.is_empty()),
PairPhase::ClientChallenge(v) | PairPhase::ServerChallengeResp(v) | PairPhase::ClientPairingSecret(v) => {
PairPhase::ClientChallenge(v)
| PairPhase::ServerChallengeResp(v)
| PairPhase::ClientPairingSecret(v) => {
assert!(!v.is_empty())
}
PairPhase::PairChallenge => {}
+9 -2
View File
@@ -102,7 +102,10 @@ fuzz_target!(|data: &[u8]| {
6 => {
let late = now.saturating_add(Duration::from_secs(u64::from(flags)));
let fired = s.handle_timeout(late);
assert_eq!(fired, matches!(s.state(), HostPairingState::Failed(_)) && !matches!(before, HostPairingState::Failed(_)));
assert_eq!(
fired,
matches!(s.state(), HostPairingState::Failed(_)) && !matches!(before, HostPairingState::Failed(_))
);
None
}
_ => {
@@ -136,6 +139,10 @@ fuzz_target!(|data: &[u8]| {
if let HostPairingState::Failed(_) = before {
assert_eq!(s.state(), before, "Failed is terminal");
}
assert_eq!(s.poll_timeout().is_none(), matches!(s.state(), HostPairingState::Failed(_)), "a deadline while in progress");
assert_eq!(
s.poll_timeout().is_none(),
matches!(s.state(), HostPairingState::Failed(_)),
"a deadline while in progress"
);
}
});