Skip to content

Commit

Permalink
temporary comment for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Apr 4, 2024
1 parent fa33f5e commit 477c5fb
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions openmls/src/group/public_group/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

// 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);
}
// 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);
// }
}
Ok(())
}
Expand Down

0 comments on commit 477c5fb

Please sign in to comment.