diff --git a/http-signature-normalization-warp/src/digest/mod.rs b/http-signature-normalization-warp/src/digest/mod.rs index 0eadf6f..bc8977e 100644 --- a/http-signature-normalization-warp/src/digest/mod.rs +++ b/http-signature-normalization-warp/src/digest/mod.rs @@ -87,6 +87,24 @@ fn parse_digest_header() -> impl Filter,), Error = Re header::header::("Digest").map(|d: Digest| d.parts) } +impl DigestVerify for Vec +where + T: DigestVerify, +{ + fn verify(&mut self, parts: &[DigestPart], payload: &[u8]) -> bool { + self.iter_mut().any(|d| d.verify(parts, payload)) + } +} + +impl DigestVerify for &mut [T] +where + T: DigestVerify, +{ + fn verify(&mut self, parts: &[DigestPart], payload: &[u8]) -> bool { + self.iter_mut().any(|d| d.verify(parts, payload)) + } +} + impl FromStr for DigestPart { type Err = ParseDigestError;