Skip to content

Commit

Permalink
Hashes revocation review: rename method verify_payload to be more spe…
Browse files Browse the repository at this point in the history
…cific.

Reviewed-by: Pietro Albini <[email protected]>

Ticket: https://ferroussystems.clickup.com/t/86947z6fp
  • Loading branch information
amanjeev committed May 22, 2024
1 parent 96478de commit 0065677
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/criticaltrust/src/keys/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl PublicKey {
/// Signature verification could fail if:
/// * The signature is present in the `RevocationInfo`.
/// * The `RevocationInfo` cannot be verified.
/// * [`verify_payload`](PublicKey::verify_payload) fails.
/// * [`verify_payload`](PublicKey::verify_without_checking_revocations) fails.
pub fn verify(
&self,
role: KeyRole,
Expand Down Expand Up @@ -63,7 +63,7 @@ impl PublicKey {
}
}

self.verify_payload(role, payload, signature)?;
self.verify_without_checking_revocations(role, payload, signature)?;

Ok(())
}
Expand All @@ -75,7 +75,7 @@ impl PublicKey {
/// * The current key expired.
/// * The signature doesn't match the payload.
/// * The signature wasn't performed by the current key.
pub fn verify_payload(
pub fn verify_without_checking_revocations(
&self,
role: KeyRole,
payload: &PayloadBytes<'_>,
Expand Down
6 changes: 5 additions & 1 deletion crates/criticaltrust/src/signatures/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ fn verify_signature<T: Signable>(
None => continue,
};

match key.verify_payload(T::SIGNED_BY_ROLE, &signed, &signature.signature) {
match key.verify_without_checking_revocations(
T::SIGNED_BY_ROLE,
&signed,
&signature.signature,
) {
Ok(()) => {}
Err(Error::VerificationFailed) => continue,
Err(other) => return Err(other),
Expand Down

0 comments on commit 0065677

Please sign in to comment.