Odin: an invalid projection of Odin's own incarnation is a refused authority; sibling test uses another target
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
24f163cf14
commit
b6cbf53a54
2 changed files with 33 additions and 4 deletions
|
|
@ -303,7 +303,9 @@ fn assemble_projection(
|
|||
activation,
|
||||
current_lease,
|
||||
};
|
||||
projection.validate()?;
|
||||
projection
|
||||
.validate()
|
||||
.context(PresenceAuthorityRefused("Idunn's projection is invalid"))?;
|
||||
Ok(projection)
|
||||
}
|
||||
|
||||
|
|
@ -747,7 +749,9 @@ where
|
|||
projection: IdunnRuntimeProjection,
|
||||
incoming: Option<(&[u8], u64)>,
|
||||
) -> Result<Vec<u8>> {
|
||||
projection.validate()?;
|
||||
projection
|
||||
.validate()
|
||||
.context(PresenceAuthorityRefused("Idunn's projection is invalid"))?;
|
||||
let now = self.clock.now_unix_millis()?;
|
||||
let (authority, projection_disagreements) =
|
||||
classify_runtime_authority(&projection, &self.idunn_anchor, now)
|
||||
|
|
|
|||
|
|
@ -1860,8 +1860,7 @@ mod tests {
|
|||
fn one_undecodable_incarnation_leaves_the_others_and_the_catalog_readable() -> Result<()> {
|
||||
let mut odin = activated_odin()?;
|
||||
let mut candidate = odin.state.borrow().authority_material.expected.clone();
|
||||
candidate.plan_id = digest('9');
|
||||
candidate.incarnation_id = "odin/generation-2".into();
|
||||
candidate.target = "sibling".into();
|
||||
candidate.validate()?;
|
||||
let candidate_key = IncarnationRef::of(&candidate)?.key();
|
||||
// "aaghost" sorts before "odin", so a refresh that stops at its first
|
||||
|
|
@ -1940,6 +1939,32 @@ mod tests {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Idunn's activation of Odin carries a signature Idunn's anchor does not
|
||||
/// verify: the authority cannot be verified.
|
||||
#[test]
|
||||
fn an_activation_that_does_not_verify_ends_odin() -> Result<()> {
|
||||
let mut odin = activated_odin()?;
|
||||
odin.pass()?;
|
||||
odin.tamper_projection(|entries| {
|
||||
entries
|
||||
.into_iter()
|
||||
.map(|mut entry| {
|
||||
if entry.r#type == IdunnRuntimeActivationRecord::TYPE {
|
||||
let mut activation =
|
||||
IdunnRuntimeActivationRecord::decode_canonical(&entry.payload)
|
||||
.unwrap();
|
||||
activation.signature[0] ^= 1;
|
||||
entry.payload = activation.canonical_bytes().unwrap();
|
||||
}
|
||||
entry
|
||||
})
|
||||
.collect()
|
||||
})?;
|
||||
odin.timers = ServingTimers::default();
|
||||
assert_refused(&odin.pass().unwrap_err());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The projected provider anchor names Odin's signer identity but carries
|
||||
/// a key that identity does not derive from: the authority cannot verify.
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue