Skip to content

Commit

Permalink
streamline constants
Browse files Browse the repository at this point in the history
  • Loading branch information
kkohbrok committed Jan 24, 2024
1 parent 9436197 commit cd81e93
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions coreclient/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@ use self::{
pub const FRIENDSHIP_PACKAGE_PROPOSAL_TYPE: u16 = 0xff00;
pub const GROUP_DATA_EXTENSION_TYPE: u16 = 0xff01;

pub const DEFAULT_MLS_VERSION: ProtocolVersion = ProtocolVersion::Mls10;
pub const DEFAULT_CIPHERSUITE: Ciphersuite =
Ciphersuite::MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519;

pub const REQUIRED_EXTENSION_TYPES: [ExtensionType; 3] = [
ExtensionType::Unknown(QS_CLIENT_REFERENCE_EXTENSION_TYPE),
ExtensionType::Unknown(GROUP_DATA_EXTENSION_TYPE),
ExtensionType::LastResort,
];
//pub const REQUIRED_EXTENSION_TYPES: [ExtensionType; 1] =
// [ExtensionType::Unknown(QS_CLIENT_REFERENCE_EXTENSION_TYPE)];
pub const REQUIRED_PROPOSAL_TYPES: [ProposalType; 0] = [];
pub const REQUIRED_PROPOSAL_TYPES: [ProposalType; 1] =
[ProposalType::Unknown(FRIENDSHIP_PACKAGE_PROPOSAL_TYPE)];
pub const REQUIRED_CREDENTIAL_TYPES: [CredentialType; 1] = [CredentialType::Infra];

pub fn default_required_capabilities() -> RequiredCapabilitiesExtension {
Expand All @@ -96,13 +99,11 @@ pub fn default_required_capabilities() -> RequiredCapabilitiesExtension {
}

// Default capabilities for every leaf node we create.
pub const SUPPORTED_PROTOCOL_VERSIONS: [ProtocolVersion; 1] = [ProtocolVersion::Mls10];
pub const SUPPORTED_CIPHERSUITES: [Ciphersuite; 1] =
[Ciphersuite::MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519];
pub const SUPPORTED_PROTOCOL_VERSIONS: [ProtocolVersion; 1] = [DEFAULT_MLS_VERSION];
pub const SUPPORTED_CIPHERSUITES: [Ciphersuite; 1] = [DEFAULT_CIPHERSUITE];
pub const SUPPORTED_EXTENSIONS: [ExtensionType; 3] = REQUIRED_EXTENSION_TYPES;
pub const SUPPORTED_PROPOSALS: [ProposalType; 1] =
[ProposalType::Unknown(FRIENDSHIP_PACKAGE_PROPOSAL_TYPE)];
pub const SUPPORTED_CREDENTIALS: [CredentialType; 1] = [CredentialType::Infra];
pub const SUPPORTED_PROPOSALS: [ProposalType; 1] = REQUIRED_PROPOSAL_TYPES;
pub const SUPPORTED_CREDENTIALS: [CredentialType; 1] = REQUIRED_CREDENTIAL_TYPES;

pub fn default_capabilities() -> Capabilities {
Capabilities::new(
Expand Down

0 comments on commit cd81e93

Please sign in to comment.