From c8791487807cf6298043a39501ec33d1ea1924eb Mon Sep 17 00:00:00 2001 From: beltram Date: Thu, 14 Sep 2023 17:08:01 +0200 Subject: [PATCH] wip --- openmls/src/group/mls_group/config.rs | 9 +++++++++ openmls/src/treesync/node/leaf_node.rs | 2 +- traits/src/types.rs | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/openmls/src/group/mls_group/config.rs b/openmls/src/group/mls_group/config.rs index 499f94ef34..b734280b4e 100644 --- a/openmls/src/group/mls_group/config.rs +++ b/openmls/src/group/mls_group/config.rs @@ -245,6 +245,15 @@ impl MlsGroupConfigBuilder { self } + /// Sets the group creator's required capabilities + pub fn required_capabilities( + mut self, + required_capabilities: RequiredCapabilitiesExtension, + ) -> Self { + self.config.required_capabilities = required_capabilities; + self + } + /// Finalizes the builder and retursn an `[MlsGroupConfig`]. pub fn build(self) -> MlsGroupConfig { self.config diff --git a/openmls/src/treesync/node/leaf_node.rs b/openmls/src/treesync/node/leaf_node.rs index 6627fc2e14..21e9e8279f 100644 --- a/openmls/src/treesync/node/leaf_node.rs +++ b/openmls/src/treesync/node/leaf_node.rs @@ -375,7 +375,7 @@ impl LeafNode { } /// Return a reference to [`Capabilities`]. - pub(crate) fn capabilities(&self) -> &Capabilities { + pub fn capabilities(&self) -> &Capabilities { &self.payload.capabilities } diff --git a/traits/src/types.rs b/traits/src/types.rs index bf2626f8cb..23ec0b0174 100644 --- a/traits/src/types.rs +++ b/traits/src/types.rs @@ -323,6 +323,14 @@ impl From for VerifiableCiphersuite { } } +impl TryFrom for Ciphersuite { + type Error = tls_codec::Error; + + fn try_from(value: VerifiableCiphersuite) -> Result { + value.0.try_into() + } +} + /// MLS ciphersuites. #[allow(non_camel_case_types)] #[allow(clippy::upper_case_acronyms)]