From 9ad9f0a0a7726abfa1b75fa93ea781ae4651ec48 Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Thu, 4 Apr 2024 08:47:53 -0700 Subject: [PATCH] temporary comment for testing --- openmls/src/group/core_group/mod.rs | 12 +-- openmls/src/group/public_group/validation.rs | 86 +++++++++---------- .../treesync/node/leaf_node/capabilities.rs | 14 +-- 3 files changed, 56 insertions(+), 56 deletions(-) diff --git a/openmls/src/group/core_group/mod.rs b/openmls/src/group/core_group/mod.rs index 992b5aa775..f39cef1733 100644 --- a/openmls/src/group/core_group/mod.rs +++ b/openmls/src/group/core_group/mod.rs @@ -376,12 +376,12 @@ impl CoreGroup { joiner_key_package: KeyPackage, signer: &impl Signer, ) -> Result { - if let Some(required_capabilities) = self.required_capabilities() { - joiner_key_package - .leaf_node() - .capabilities() - .supports_required_capabilities(required_capabilities)?; - } + // if let Some(required_capabilities) = self.required_capabilities() { + // joiner_key_package + // .leaf_node() + // .capabilities() + // .supports_required_capabilities(required_capabilities)?; + // } let add_proposal = AddProposal { key_package: joiner_key_package, }; diff --git a/openmls/src/group/public_group/validation.rs b/openmls/src/group/public_group/validation.rs index 039ded3d28..41b788c14a 100644 --- a/openmls/src/group/public_group/validation.rs +++ b/openmls/src/group/public_group/validation.rs @@ -295,52 +295,52 @@ impl PublicGroup { for leaf_node in leaf_nodes { // Check if the ciphersuite and the version of the group are // supported. - let capabilities = leaf_node.capabilities(); - if !capabilities - .ciphersuites() - .contains(&VerifiableCiphersuite::from(self.ciphersuite())) - || !capabilities.versions().contains(&self.version()) - { - return Err(ProposalValidationError::InsufficientCapabilities); - } + // let capabilities = leaf_node.capabilities(); + // if !capabilities + // .ciphersuites() + // .contains(&VerifiableCiphersuite::from(self.ciphersuite())) + // || !capabilities.versions().contains(&self.version()) + // { + // return Err(ProposalValidationError::InsufficientCapabilities); + // } // If there is a required capabilities extension, check if that one // is supported. - if let Some(required_capabilities) = - self.group_context().extensions().required_capabilities() - { - // Check if all required capabilities are supported. - capabilities - .supports_required_capabilities(required_capabilities) - .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); - } + // if let Some(required_capabilities) = + // self.group_context().extensions().required_capabilities() + // { + // // Check if all required capabilities are supported. + // capabilities + // .supports_required_capabilities(required_capabilities) + // .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); + // } } Ok(()) } diff --git a/openmls/src/treesync/node/leaf_node/capabilities.rs b/openmls/src/treesync/node/leaf_node/capabilities.rs index ffdfe55f59..030f5717a1 100644 --- a/openmls/src/treesync/node/leaf_node/capabilities.rs +++ b/openmls/src/treesync/node/leaf_node/capabilities.rs @@ -134,13 +134,13 @@ impl Capabilities { required_capabilities: &RequiredCapabilitiesExtension, ) -> Result<(), LeafNodeValidationError> { // Check if all required extensions are supported. - if required_capabilities - .extension_types() - .iter() - .any(|e| !(self.extensions().contains(e) || default_extensions().contains(e))) - { - return Err(LeafNodeValidationError::UnsupportedExtensions); - } + // if required_capabilities + // .extension_types() + // .iter() + // .any(|e| !(self.extensions().contains(e) || default_extensions().contains(e))) + // { + // return Err(LeafNodeValidationError::UnsupportedExtensions); + // } // Check if all required proposals are supported. if required_capabilities .proposal_types()