Implement and natively verify the human-reviewed Windows recovery tool
Rust development slice / linux (push) Failing after 7s
Rust development slice / linux (push) Failing after 7s
This commit is contained in:
@@ -40,16 +40,27 @@ impl Receipt {
|
||||
/// Compare a receipt to an independently produced historical witness, after signature verification.
|
||||
pub fn matches_reviewed_witness(&self, expected: &Value, now: DateTime<Utc>) -> bool {
|
||||
let principal = self.confirmed_by.strip_prefix("oidc:");
|
||||
self.domain == RECEIPT_DOMAIN && self.schema_version == 1
|
||||
&& !self.receipt_id.is_nil() && !self.request_id.is_nil()
|
||||
self.domain == RECEIPT_DOMAIN
|
||||
&& self.schema_version == 1
|
||||
&& !self.receipt_id.is_nil()
|
||||
&& !self.request_id.is_nil()
|
||||
&& self.request_id != self.receipt_id
|
||||
&& !self.testsimulation && !self.ready && !self.helper_ready && !self.unlock
|
||||
&& !self.testsimulation
|
||||
&& !self.ready
|
||||
&& !self.helper_ready
|
||||
&& !self.unlock
|
||||
&& self.approval_origin == "human_webui"
|
||||
&& principal.is_some_and(|s| s.len() == 64 && s.bytes().all(|c| c.is_ascii_digit() || (b'a'..=b'f').contains(&c)))
|
||||
&& self.issued_at <= now && now < self.valid_until
|
||||
&& principal.is_some_and(|s| {
|
||||
s.len() == 64
|
||||
&& s.bytes()
|
||||
.all(|c| c.is_ascii_digit() || (b'a'..=b'f').contains(&c))
|
||||
})
|
||||
&& self.issued_at <= now
|
||||
&& now < self.valid_until
|
||||
&& self.valid_until - self.issued_at <= Duration::minutes(10)
|
||||
&& self.key_id == expected["verification_key_id"]
|
||||
&& &self.witness == expected
|
||||
&& crate::checkpoint_repair::inventory_sha256(expected).is_ok_and(|h| h == self.witness_sha256)
|
||||
&& crate::checkpoint_repair::inventory_sha256(expected)
|
||||
.is_ok_and(|h| h == self.witness_sha256)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user