From 71d3217e647415fda3ae7fcfb5ba7004089ac3bd Mon Sep 17 00:00:00 2001 From: Jazz Turner-Baggs <473256+jazzz@users.noreply.github.com> Date: Tue, 28 Jul 2026 21:14:33 -0700 Subject: [PATCH] Re-enable XWING (#193) --- core/conversations/src/conversation/group_v1.rs | 6 +++--- core/conversations/src/conversation/group_v2.rs | 11 +++-------- core/conversations/src/inbox_v2.rs | 3 +-- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/core/conversations/src/conversation/group_v1.rs b/core/conversations/src/conversation/group_v1.rs index d275b2f..c7b4cad 100644 --- a/core/conversations/src/conversation/group_v1.rs +++ b/core/conversations/src/conversation/group_v1.rs @@ -47,7 +47,7 @@ impl std::fmt::Debug for GroupV1Convo { impl GroupV1Convo { // Create a new conversation with the creator as the only participant. pub fn new(cx: &mut ServiceContext) -> Result { - let config = Self::mls_create_config(cx); + let config = Self::mls_create_config(); let mls_group = MlsGroup::new( &cx.mls_provider, &cx.mls_identity, @@ -114,9 +114,9 @@ impl GroupV1Convo { Ok(()) } - fn mls_create_config(cx: &mut ServiceContext) -> MlsGroupCreateConfig { + fn mls_create_config() -> MlsGroupCreateConfig { MlsGroupCreateConfig::builder() - .ciphersuite(cx.mls_provider.crypto().supported_ciphersuites()[0]) + .ciphersuite(crate::inbox_v2::CIPHER_SUITE) .use_ratchet_tree_extension(true) // This is handy for now, until there is central store for this data .build() } diff --git a/core/conversations/src/conversation/group_v2.rs b/core/conversations/src/conversation/group_v2.rs index c82c5ae..15cc703 100644 --- a/core/conversations/src/conversation/group_v2.rs +++ b/core/conversations/src/conversation/group_v2.rs @@ -23,7 +23,6 @@ use openmls::extensions::{Extension, Extensions, UnknownExtension}; use openmls::group::MlsGroupCreateConfig; use openmls::prelude::tls_codec::Deserialize as _; use openmls::prelude::{KeyPackageIn, OpenMlsProvider as _, ProtocolVersion}; -use openmls_traits::crypto::OpenMlsCrypto; use prost::Message; use shared_traits::{IdentId, IdentIdRef}; use std::sync::Arc; @@ -108,11 +107,7 @@ fn rand_string(n: usize) -> String { hex::encode(bytes) } -fn group_config( - cx: &mut ServiceContext, - name: &str, - desc: &str, -) -> MlsGroupCreateConfig { +fn group_config(name: &str, desc: &str) -> MlsGroupCreateConfig { let meta = ConvoMetaInfo::new(name, desc); let extensions = Extensions::from_vec(vec![Extension::Unknown( @@ -122,7 +117,7 @@ fn group_config( .expect("failed to create extensions"); MlsGroupCreateConfig::builder() - .ciphersuite(cx.mls_provider.crypto().supported_ciphersuites()[0]) + .ciphersuite(crate::inbox_v2::CIPHER_SUITE) .capabilities(capabilities_with_group_metadata()) .use_ratchet_tree_extension(true) // Embed the ratchet tree in the Welcome so joiners can build the group .with_group_context_extensions(extensions) @@ -136,7 +131,7 @@ impl GroupV2Convo { desc: &str, ) -> Result { let convo_id = rand_string(5); - let group_config = group_config(service_ctx, name, desc); + let group_config = group_config(name, desc); let conversation = Conversation::create( &convo_id, &member_id(service_ctx), diff --git a/core/conversations/src/inbox_v2.rs b/core/conversations/src/inbox_v2.rs index ff63d7d..ead4575 100644 --- a/core/conversations/src/inbox_v2.rs +++ b/core/conversations/src/inbox_v2.rs @@ -26,9 +26,8 @@ use crate::service_context::{ExternalServices, ServiceContext}; use crate::utils::{blake2b_hex, hash_size}; use crate::{AddressedEnvelope, IdentId, IdentIdRef, IdentityProvider}; -// Downgraded from MLS_256_XWING_CHACHA20POLY1305_SHA256_Ed25519 until demls accepts an external provider pub(crate) const CIPHER_SUITE: Ciphersuite = - Ciphersuite::MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519; + Ciphersuite::MLS_256_XWING_CHACHA20POLY1305_SHA256_Ed25519; // Define unique Identifiers derivations used in InboxV2 fn delivery_address_for(ident_id: IdentIdRef) -> String {