From 93dc30f2dd325f645bd44392a0db6ead5b0f4c2b Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Thu, 4 Apr 2024 07:52:58 -0700 Subject: [PATCH] temporary comment for testing --- openmls/src/group/errors.rs | 3 ++ openmls/src/group/public_group/validation.rs | 52 +++++++++---------- .../treesync/node/leaf_node/capabilities.rs | 32 ++++++------ 3 files changed, 45 insertions(+), 42 deletions(-) diff --git a/openmls/src/group/errors.rs b/openmls/src/group/errors.rs index 81623b13be..8b95c791ae 100644 --- a/openmls/src/group/errors.rs +++ b/openmls/src/group/errors.rs @@ -374,6 +374,9 @@ pub enum ProposalValidationError { /// See [`PskError`] for more details. #[error(transparent)] Psk(#[from] PskError), + /// Leaf node + #[error("something with leaf node")] + LeafNodeValidationError, } /// External Commit validaton error diff --git a/openmls/src/group/public_group/validation.rs b/openmls/src/group/public_group/validation.rs index 039ded3d28..ad33212f95 100644 --- a/openmls/src/group/public_group/validation.rs +++ b/openmls/src/group/public_group/validation.rs @@ -315,32 +315,32 @@ impl PublicGroup { .map_err(|_| ProposalValidationError::InsufficientCapabilities)?; } - // Check that all extensions are contained in the capabilities. - if !capabilities.contain_extensions(leaf_node.extensions()) { - return Err(ProposalValidationError::InsufficientCapabilities); - } - - // Check that the capabilities contain the leaf node's credential type. - if !capabilities.contains_credential(&leaf_node.credential().credential_type()) { - return Err(ProposalValidationError::InsufficientCapabilities); - } - - // Check that the credential type is supported by all members of the group. - if !group_leaf_nodes.all(|node| { - node.capabilities() - .contains_credential(&leaf_node.credential().credential_type()) - }) { - return Err(ProposalValidationError::InsufficientCapabilities); - } - - // Check that the capabilities field of this LeafNode indicates - // support for all the credential types currently in use by other - // members. - if !group_leaf_nodes - .all(|node| capabilities.contains_credential(&node.credential().credential_type())) - { - return Err(ProposalValidationError::InsufficientCapabilities); - } + // // Check that all extensions are contained in the capabilities. + // if !capabilities.contain_extensions(leaf_node.extensions()) { + // return Err(ProposalValidationError::InsufficientCapabilities); + // } + + // // Check that the capabilities contain the leaf node's credential type. + // if !capabilities.contains_credential(&leaf_node.credential().credential_type()) { + // return Err(ProposalValidationError::InsufficientCapabilities); + // } + + // // Check that the credential type is supported by all members of the group. + // if !group_leaf_nodes.all(|node| { + // node.capabilities() + // .contains_credential(&leaf_node.credential().credential_type()) + // }) { + // return Err(ProposalValidationError::InsufficientCapabilities); + // } + + // // Check that the capabilities field of this LeafNode indicates + // // support for all the credential types currently in use by other + // // members. + // if !group_leaf_nodes + // .all(|node| capabilities.contains_credential(&node.credential().credential_type())) + // { + // return Err(ProposalValidationError::InsufficientCapabilities); + // } } Ok(()) } diff --git a/openmls/src/treesync/node/leaf_node/capabilities.rs b/openmls/src/treesync/node/leaf_node/capabilities.rs index ffdfe55f59..c3d121f30e 100644 --- a/openmls/src/treesync/node/leaf_node/capabilities.rs +++ b/openmls/src/treesync/node/leaf_node/capabilities.rs @@ -141,22 +141,22 @@ impl Capabilities { { return Err(LeafNodeValidationError::UnsupportedExtensions); } - // Check if all required proposals are supported. - if required_capabilities - .proposal_types() - .iter() - .any(|p| !(self.proposals().contains(p) || default_proposals().contains(p))) - { - return Err(LeafNodeValidationError::UnsupportedProposals); - } - // Check if all required credential types are supported. - if required_capabilities - .credential_types() - .iter() - .any(|c| !(self.credentials().contains(c) || default_credentials().contains(c))) - { - return Err(LeafNodeValidationError::UnsupportedCredentials); - } + // // Check if all required proposals are supported. + // if required_capabilities + // .proposal_types() + // .iter() + // .any(|p| !(self.proposals().contains(p) || default_proposals().contains(p))) + // { + // return Err(LeafNodeValidationError::UnsupportedProposals); + // } + // // Check if all required credential types are supported. + // if required_capabilities + // .credential_types() + // .iter() + // .any(|c| !(self.credentials().contains(c) || default_credentials().contains(c))) + // { + // return Err(LeafNodeValidationError::UnsupportedCredentials); + // } Ok(()) }