15 lines
831 B
Diff
15 lines
831 B
Diff
# must fail: key_log_cached_rolled_back
|
|
# an older copy of a key log through a cache taken without report (keys::hold_cached_revisions)
|
|
diff --git a/wai/wai-rs/src/http_binding/keys.rs b/wai/wai-rs/src/http_binding/keys.rs
|
|
index ad1572bc..5a1555c2 100644
|
|
--- a/wai/wai-rs/src/http_binding/keys.rs
|
|
+++ b/wai/wai-rs/src/http_binding/keys.rs
|
|
@@ -179,7 +179,7 @@ pub fn hold_cached_revisions(origin: &str, body: &[u8], anchor: &Anchor, held: &
|
|
trusted.push(p);
|
|
}
|
|
let latest = revs.last().expect("a log is non-empty").revision_hash();
|
|
- if latest != anchor.revision && trusted.contains(&latest) {
|
|
+ if latest != anchor.revision && trusted.is_empty() {
|
|
return Err(KeysRefusal::Log(Reason::KeyLogRolledBack));
|
|
}
|
|
let mut have: Vec<[u8; 32]> = held.iter().map(Revision::revision_hash).collect();
|