From b0e3742e4637ad89160ed45bc9a3fdf21bb5d61f Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Sun, 7 Jan 2024 11:07:44 -0800 Subject: [PATCH] Clean up extensions creation --- openmls/src/group/public_group/builder.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openmls/src/group/public_group/builder.rs b/openmls/src/group/public_group/builder.rs index 36738d02ca..aeae7f9630 100644 --- a/openmls/src/group/public_group/builder.rs +++ b/openmls/src/group/public_group/builder.rs @@ -93,18 +93,17 @@ impl TempBuilderPG1 { _ => LibraryError::custom("Unexpected ExtensionError").into(), })?; let required_capabilities = Extension::RequiredCapabilities(required_capabilities); - let mut extensions = - if let Some(ext_senders) = self.external_senders.map(Extension::ExternalSenders) { - Extensions::from_vec(vec![required_capabilities, ext_senders]) - } else { - Extensions::from_vec(vec![required_capabilities]) - }?; + let mut extensions = Extensions::from_vec(vec![required_capabilities])?; + if let Some(ext_senders) = self.external_senders.map(Extension::ExternalSenders) { + extensions.add(ext_senders)?; + } if let Some(group_context_extensions) = self.group_context_extensions { for extension in group_context_extensions.iter() { extensions.add(extension.clone())?; } } + let group_context = GroupContext::create_initial_group_context( self.crypto_config.ciphersuite, self.group_id,