Ignore key roll activation when there is no new key to activate. (interop #3)

This commit is contained in:
Tim Bruijnzeels
2019-10-03 11:05:02 +02:00
parent 09569f8038
commit e76f3438f0
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -481,4 +481,12 @@ impl KeyState {
_ => Err(Error::ResourceClassNoNewKey),
}
}
/// Returns true if there is a new key
pub fn has_new_key(&self) -> bool {
match self {
KeyState::RollNew(_, _) => true,
_ => false,
}
}
}
+1 -1
View File
@@ -693,7 +693,7 @@ impl ResourceClass {
staging: Duration,
signer: &S,
) -> ca::Result<Vec<EvtDet>> {
if self.last_key_change + staging > Time::now() {
if !self.key_state.has_new_key() || self.last_key_change + staging > Time::now() {
return Ok(vec![]);
}