Skip to content

Commit

Permalink
re-enable subtests, don't assume default ciphersuites, versions, cred…
Browse files Browse the repository at this point in the history
…entials
  • Loading branch information
keks committed Oct 8, 2024
1 parent 2c02769 commit c649fda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
6 changes: 3 additions & 3 deletions openmls/src/group/tests_and_kats/tests/proposal_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,11 @@ fn test_valsem105() {
for key_package_version in [
KeyPackageTestVersion::WrongCiphersuite,
KeyPackageTestVersion::WrongVersion,
//KeyPackageTestVersion::UnsupportedVersion,
// KeyPackageTestVersion::UnsupportedCiphersuite,
KeyPackageTestVersion::UnsupportedVersion,
KeyPackageTestVersion::UnsupportedCiphersuite,
KeyPackageTestVersion::ValidTestCase,
] {
println!("running test {key_package_version:?}");
println!("# running test {key_package_version:?}");

// Let's set up a group with Alice and Bob as members.
let ProposalValidationTestSetup {
Expand Down
12 changes: 3 additions & 9 deletions openmls/src/treesync/node/leaf_node/capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ impl Capabilities {

/// Check if these [`Capabilities`] contains the credential.
pub(crate) fn contains_credential(&self, credential_type: CredentialType) -> bool {
default_credentials().contains(&credential_type)
|| self.credentials().contains(&credential_type)
self.credentials().contains(&credential_type)
}

/// Check if these [`Capabilities`] contain the extension.
Expand All @@ -191,17 +190,12 @@ impl Capabilities {

/// Check if these [`Capabilities`] contain the version.
pub(crate) fn contains_version(&self, version: ProtocolVersion) -> bool {
default_versions().contains(&version) || self.versions().contains(&version)
self.versions().contains(&version)
}

/// Check if these [`Capabilities`] contain the ciphersuite.
pub(crate) fn contains_ciphersuite(&self, ciphersuite: VerifiableCiphersuite) -> bool {
let is_default = default_ciphersuites()
.into_iter()
.map(|c| c.into())
.any(|c: VerifiableCiphersuite| ciphersuite == c);

is_default || self.ciphersuites().contains(&ciphersuite)
self.ciphersuites().contains(&ciphersuite)
}
}

Expand Down

0 comments on commit c649fda

Please sign in to comment.