From 0065677e7b3fa1c9fb07cc23edba7b5ddd2b774d Mon Sep 17 00:00:00 2001 From: Amanjeev Sethi Date: Wed, 22 May 2024 09:54:25 -0400 Subject: [PATCH] Hashes revocation review: rename method verify_payload to be more specific. Reviewed-by: Pietro Albini Ticket: https://ferroussystems.clickup.com/t/86947z6fp --- crates/criticaltrust/src/keys/public.rs | 6 +++--- crates/criticaltrust/src/signatures/payload.rs | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/criticaltrust/src/keys/public.rs b/crates/criticaltrust/src/keys/public.rs index efe564b8..b6353212 100644 --- a/crates/criticaltrust/src/keys/public.rs +++ b/crates/criticaltrust/src/keys/public.rs @@ -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, @@ -63,7 +63,7 @@ impl PublicKey { } } - self.verify_payload(role, payload, signature)?; + self.verify_without_checking_revocations(role, payload, signature)?; Ok(()) } @@ -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<'_>, diff --git a/crates/criticaltrust/src/signatures/payload.rs b/crates/criticaltrust/src/signatures/payload.rs index e84b1c7d..178a1bab 100644 --- a/crates/criticaltrust/src/signatures/payload.rs +++ b/crates/criticaltrust/src/signatures/payload.rs @@ -106,7 +106,11 @@ fn verify_signature( 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),