From d533eff6e9bbb5ac7e6804155a37bc01841e9ae2 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Fri, 12 Jan 2024 09:39:37 -0800 Subject: [PATCH] Handle change in Verifiable trait --- openmls/src/extensions/protected_metadata.rs | 27 ++++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/openmls/src/extensions/protected_metadata.rs b/openmls/src/extensions/protected_metadata.rs index c87b79bad3..617e9a598e 100644 --- a/openmls/src/extensions/protected_metadata.rs +++ b/openmls/src/extensions/protected_metadata.rs @@ -156,9 +156,15 @@ impl Signable for ProtectedMetadataTbs { /// XXX: This really should not be implemented on [`ProtectedMetadata`] but on /// the verifiable version. mod verifiable { + use openmls_traits::crypto::OpenMlsCrypto; + + use crate::prelude_test::OpenMlsSignaturePublicKey; + use super::*; impl Verifiable for ProtectedMetadata { + type VerifiedStruct = ProtectedMetadata; + fn unsigned_payload(&self) -> Result, tls_codec::Error> { self.payload.tls_serialize_detached() } @@ -170,23 +176,22 @@ mod verifiable { fn label(&self) -> &str { SIGNATURE_LABEL } + + fn verify( + self, + _crypto: &impl OpenMlsCrypto, + _pk: &OpenMlsSignaturePublicKey, + ) -> Result { + Ok(self) + } } + impl VerifiedStruct for ProtectedMetadata {} + mod private_mod { #[derive(Default)] pub struct Seal; } - - impl VerifiedStruct for ProtectedMetadata { - type SealingType = private_mod::Seal; - - fn from_verifiable(v: ProtectedMetadata, _seal: Self::SealingType) -> Self { - Self { - payload: v.payload, - signature: v.signature, - } - } - } } #[cfg(test)]