diff --git a/openmls/src/binary_tree/array_representation/diff.rs b/openmls/src/binary_tree/array_representation/diff.rs index 1733819913..b6b4b7211f 100644 --- a/openmls/src/binary_tree/array_representation/diff.rs +++ b/openmls/src/binary_tree/array_representation/diff.rs @@ -101,7 +101,7 @@ impl<'a, L: Clone + Debug + Default, P: Clone + Debug + Default> From<&'a ABinar } } -impl<'a, L: Clone + Debug + Default, P: Clone + Debug + Default> AbDiff<'a, L, P> { +impl AbDiff<'_, L, P> { // Functions handling interactions with leaves. /////////////////////////////////////////////// diff --git a/openmls/src/framing/message_in.rs b/openmls/src/framing/message_in.rs index 0f99bc753a..f9d559c868 100644 --- a/openmls/src/framing/message_in.rs +++ b/openmls/src/framing/message_in.rs @@ -176,6 +176,7 @@ impl MlsMessageIn { /// Enum containing a message for use with `process_message` and an /// [`MlsGroup`]. Both [`PublicMessage`] and [`PrivateMessage`] implement /// [`Into`]. +#[allow(clippy::large_enum_variant)] #[derive(Debug, Clone)] pub enum ProtocolMessage { /// A [`ProtocolMessage`] containing a [`PrivateMessage`]. diff --git a/openmls/src/framing/private_message.rs b/openmls/src/framing/private_message.rs index a5010cc8a6..c4551e203f 100644 --- a/openmls/src/framing/private_message.rs +++ b/openmls/src/framing/private_message.rs @@ -320,6 +320,7 @@ impl PrivateMessage { /// opaque padding[length_of_padding]; /// } PrivateMessageContent; /// ``` +#[allow(dead_code)] #[derive(Debug, Clone)] pub(crate) struct PrivateMessageContent { // The `content` field is serialized and deserialized manually without the diff --git a/openmls/src/framing/public_message.rs b/openmls/src/framing/public_message.rs index 7982f9ee14..12b6651a0b 100644 --- a/openmls/src/framing/public_message.rs +++ b/openmls/src/framing/public_message.rs @@ -189,7 +189,7 @@ pub(crate) struct ConfirmedTranscriptHashInput<'a> { pub(super) signature: &'a Signature, } -impl<'a> ConfirmedTranscriptHashInput<'a> { +impl ConfirmedTranscriptHashInput<'_> { pub(crate) fn calculate_confirmed_transcript_hash( self, crypto: &impl OpenMlsCrypto, @@ -238,7 +238,7 @@ pub(crate) struct InterimTranscriptHashInput<'a> { pub(crate) confirmation_tag: &'a ConfirmationTag, } -impl<'a> InterimTranscriptHashInput<'a> { +impl InterimTranscriptHashInput<'_> { pub fn calculate_interim_transcript_hash( self, crypto: &impl OpenMlsCrypto, diff --git a/openmls/src/group/core_group/create_commit_params.rs b/openmls/src/group/core_group/create_commit_params.rs index 60dcfcef70..eb27cddd59 100644 --- a/openmls/src/group/core_group/create_commit_params.rs +++ b/openmls/src/group/core_group/create_commit_params.rs @@ -89,7 +89,7 @@ impl<'a> CreateCommitParamsBuilder<'a> { } } -impl<'a> CreateCommitParams<'a> { +impl CreateCommitParams<'_> { pub(crate) fn builder() -> TempBuilderCCPM0 { TempBuilderCCPM0 {} } diff --git a/openmls/src/group/core_group/proposals.rs b/openmls/src/group/core_group/proposals.rs index 76f7b6e81d..f2b1f1f932 100644 --- a/openmls/src/group/core_group/proposals.rs +++ b/openmls/src/group/core_group/proposals.rs @@ -603,7 +603,7 @@ pub struct QueuedAddProposal<'a> { sender: &'a Sender, } -impl<'a> QueuedAddProposal<'a> { +impl QueuedAddProposal<'_> { /// Returns a reference to the proposal pub fn add_proposal(&self) -> &AddProposal { self.add_proposal @@ -622,7 +622,7 @@ pub struct QueuedRemoveProposal<'a> { sender: &'a Sender, } -impl<'a> QueuedRemoveProposal<'a> { +impl QueuedRemoveProposal<'_> { /// Returns a reference to the proposal pub fn remove_proposal(&self) -> &RemoveProposal { self.remove_proposal @@ -641,7 +641,7 @@ pub struct QueuedUpdateProposal<'a> { sender: &'a Sender, } -impl<'a> QueuedUpdateProposal<'a> { +impl QueuedUpdateProposal<'_> { /// Returns a reference to the proposal pub fn update_proposal(&self) -> &UpdateProposal { self.update_proposal @@ -660,7 +660,7 @@ pub struct QueuedPskProposal<'a> { sender: &'a Sender, } -impl<'a> QueuedPskProposal<'a> { +impl QueuedPskProposal<'_> { /// Returns a reference to the proposal pub fn psk_proposal(&self) -> &PreSharedKeyProposal { self.psk_proposal diff --git a/openmls/src/group/core_group/staged_commit.rs b/openmls/src/group/core_group/staged_commit.rs index 2a4b9aa445..df214dc00a 100644 --- a/openmls/src/group/core_group/staged_commit.rs +++ b/openmls/src/group/core_group/staged_commit.rs @@ -111,8 +111,8 @@ impl CoreGroup { /// - ValSem242 /// - ValSem243 /// - ValSem244 - /// Returns an error if the given commit was sent by the owner of this - /// group. + /// + /// Returns an error if the given commit was sent by the owner of this group. pub(crate) async fn stage_commit( &self, mls_content: &AuthenticatedContent, diff --git a/openmls/src/group/mls_group/membership.rs b/openmls/src/group/mls_group/membership.rs index 7f7bcd4ad8..82b1e1ed9b 100644 --- a/openmls/src/group/mls_group/membership.rs +++ b/openmls/src/group/mls_group/membership.rs @@ -109,7 +109,6 @@ impl MlsGroup { /// The [Welcome] is [Some] when the queue of pending proposals contained /// add proposals /// The [GroupInfo] is [Some] if the group has the `use_ratchet_tree_extension` flag set. - /// /// Returns an error if there is a pending commit. // FIXME: #1217 diff --git a/openmls/src/group/mls_group/mod.rs b/openmls/src/group/mls_group/mod.rs index 2dea8a478f..57e13b6d33 100644 --- a/openmls/src/group/mls_group/mod.rs +++ b/openmls/src/group/mls_group/mod.rs @@ -77,46 +77,46 @@ impl From for StagedCommit { /// states and their transitions are as follows: /// /// * [`MlsGroupState::Operational`]: This is the main state of the group, which -/// allows access to all of its functionality, (except merging pending commits, -/// see the [`MlsGroupState::PendingCommit`] for more information) and it's the -/// state the group starts in (except when created via -/// [`MlsGroup::join_by_external_commit()`], see the functions documentation for -/// more information). From this `Operational`, the group state can either -/// transition to [`MlsGroupState::Inactive`], when it processes a commit that -/// removes this client from the group, or to [`MlsGroupState::PendingCommit`], -/// when this client creates a commit. +/// allows access to all of its functionality, (except merging pending commits, +/// see the [`MlsGroupState::PendingCommit`] for more information) and it's the +/// state the group starts in (except when created via +/// [`MlsGroup::join_by_external_commit()`], see the functions documentation for +/// more information). From this `Operational`, the group state can either +/// transition to [`MlsGroupState::Inactive`], when it processes a commit that +/// removes this client from the group, or to [`MlsGroupState::PendingCommit`], +/// when this client creates a commit. /// /// * [`MlsGroupState::Inactive`]: A group can enter this state from any other -/// state when it processes a commit that removes this client from the group. -/// This is a terminal state that the group can not exit from. If the clients -/// wants to re-join the group, it can either be added by a group member or it -/// can join via external commit. +/// state when it processes a commit that removes this client from the group. +/// This is a terminal state that the group can not exit from. If the clients +/// wants to re-join the group, it can either be added by a group member or it +/// can join via external commit. /// /// * [`MlsGroupState::PendingCommit`]: This state is split into two possible -/// sub-states, one for each Commit type: -/// [`PendingCommitState::Member`] and [`PendingCommitState::Member`]: +/// sub-states, one for each Commit type: +/// [`PendingCommitState::Member`] and [`PendingCommitState::Member`]: /// /// * If the client creates a commit for this group, the `PendingCommit` state -/// is entered with [`PendingCommitState::Member`] and with the [`StagedCommit`] as -/// additional state variable. In this state, it can perform the same -/// operations as in the [`MlsGroupState::Operational`], except that it cannot -/// create proposals or commits. However, it can merge or clear the stored -/// [`StagedCommit`], where both actions result in a transition to the -/// [`MlsGroupState::Operational`]. Additionally, if a commit from another -/// group member is processed, the own pending commit is also cleared and -/// either the `Inactive` state is entered (if this client was removed from -/// the group as part of the processed commit), or the `Operational` state is -/// entered. +/// is entered with [`PendingCommitState::Member`] and with the [`StagedCommit`] as +/// additional state variable. In this state, it can perform the same +/// operations as in the [`MlsGroupState::Operational`], except that it cannot +/// create proposals or commits. However, it can merge or clear the stored +/// [`StagedCommit`], where both actions result in a transition to the +/// [`MlsGroupState::Operational`]. Additionally, if a commit from another +/// group member is processed, the own pending commit is also cleared and +/// either the `Inactive` state is entered (if this client was removed from +/// the group as part of the processed commit), or the `Operational` state is +/// entered. /// /// * A group can enter the [`PendingCommitState::External`] sub-state only as -/// the initial state when the group is created via -/// [`MlsGroup::join_by_external_commit()`]. In contrast to the -/// [`PendingCommitState::Member`] `PendingCommit` state, the only possible -/// functionality that can be used is the [`MlsGroup::merge_pending_commit()`] -/// function, which merges the pending external commit and transitions the -/// state to [`MlsGroupState::PendingCommit`]. For more information on the -/// external commit process, see [`MlsGroup::join_by_external_commit()`] or -/// Section 11.2.1 of the MLS specification. +/// the initial state when the group is created via +/// [`MlsGroup::join_by_external_commit()`]. In contrast to the +/// [`PendingCommitState::Member`] `PendingCommit` state, the only possible +/// functionality that can be used is the [`MlsGroup::merge_pending_commit()`] +/// function, which merges the pending external commit and transitions the +/// state to [`MlsGroupState::PendingCommit`]. For more information on the +/// external commit process, see [`MlsGroup::join_by_external_commit()`] or +/// Section 11.2.1 of the MLS specification. #[derive(Debug, Serialize, Deserialize)] pub enum MlsGroupState { /// There is currently a pending Commit that hasn't been merged yet. diff --git a/openmls/src/group/public_group/diff/compute_path.rs b/openmls/src/group/public_group/diff/compute_path.rs index a86ec16a93..7c444c758c 100644 --- a/openmls/src/group/public_group/diff/compute_path.rs +++ b/openmls/src/group/public_group/diff/compute_path.rs @@ -37,7 +37,7 @@ pub(crate) struct PathComputationResult { pub(crate) new_keypairs: Vec, } -impl<'a> PublicGroupDiff<'a> { +impl PublicGroupDiff<'_> { #[allow(clippy::too_many_arguments)] pub(crate) fn compute_path( &mut self, diff --git a/openmls/src/group/public_group/staged_commit.rs b/openmls/src/group/public_group/staged_commit.rs index da71b102fc..2876fe2d29 100644 --- a/openmls/src/group/public_group/staged_commit.rs +++ b/openmls/src/group/public_group/staged_commit.rs @@ -177,6 +177,7 @@ impl PublicGroup { /// - ValSem242 /// - ValSem243 /// - ValSem244 + /// /// Returns an error if the given commit was sent by the owner of this /// group. /// TODO #1255: This will be used by the `process_message` function of the diff --git a/openmls/src/group/public_group/validation.rs b/openmls/src/group/public_group/validation.rs index 8a2dca0c0c..8a675711ba 100644 --- a/openmls/src/group/public_group/validation.rs +++ b/openmls/src/group/public_group/validation.rs @@ -399,6 +399,7 @@ impl PublicGroup { /// Validate Update proposals. This function implements the following checks: /// - ValSem111: Update Proposal: The sender of a full Commit must not include own update proposals /// - ValSem112: Update Proposal: The sender of a standalone update proposal must be of type member + /// /// TODO: #133 This validation must be updated according to Sec. 13.2 pub(crate) fn validate_update_proposals( &self, diff --git a/openmls/src/lib.rs b/openmls/src/lib.rs index 562ba5c5e6..9ecaa05c12 100644 --- a/openmls/src/lib.rs +++ b/openmls/src/lib.rs @@ -147,11 +147,7 @@ #![cfg_attr(not(test), forbid(unsafe_code))] #![deny(rustdoc::broken_intra_doc_links)] #![deny(rustdoc::private_intra_doc_links)] -#![cfg(any( - target_pointer_width = "32", - target_pointer_width = "64", - target_pointer_width = "128" -))] +#![cfg(any(target_pointer_width = "32", target_pointer_width = "64"))] // === Testing === diff --git a/openmls/src/messages/external_proposals.rs b/openmls/src/messages/external_proposals.rs index 36a67e745c..5c65f67c12 100644 --- a/openmls/src/messages/external_proposals.rs +++ b/openmls/src/messages/external_proposals.rs @@ -68,7 +68,7 @@ impl ExternalProposal { /// * `epoch` - group's epoch /// * `signer` - of the sender to sign the message /// * `sender` - index of the sender of the proposal (in the [crate::extensions::ExternalSendersExtension] array - /// from the Group Context) + /// from the Group Context) pub fn new_remove( removed: LeafNodeIndex, group_id: GroupId, diff --git a/openmls/src/tree/sender_ratchet.rs b/openmls/src/tree/sender_ratchet.rs index 1a6d1dd1e1..b2ea670f2d 100644 --- a/openmls/src/tree/sender_ratchet.rs +++ b/openmls/src/tree/sender_ratchet.rs @@ -21,13 +21,13 @@ pub(crate) type Generation = u32; /// **Parameters** /// /// - out_of_order_tolerance: -/// This parameter defines a window for which decryption secrets are kept. -/// This is useful in case the DS cannot guarantee that all application messages have total order within an epoch. -/// Use this carefully, since keeping decryption secrets affects forward secrecy within an epoch. -/// The default value is 5. +/// This parameter defines a window for which decryption secrets are kept. +/// This is useful in case the DS cannot guarantee that all application messages have total order within an epoch. +/// Use this carefully, since keeping decryption secrets affects forward secrecy within an epoch. +/// The default value is 5. /// - maximum_forward_distance: -/// This parameter defines how many incoming messages can be skipped. This is useful if the DS -/// drops application messages. The default value is 1000. +/// This parameter defines how many incoming messages can be skipped. This is useful if the DS +/// drops application messages. The default value is 1000. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct SenderRatchetConfiguration { out_of_order_tolerance: Generation, diff --git a/openmls/src/treesync/diff.rs b/openmls/src/treesync/diff.rs index 013f04236b..5a1e58fa94 100644 --- a/openmls/src/treesync/diff.rs +++ b/openmls/src/treesync/diff.rs @@ -92,7 +92,7 @@ impl<'a> From<&'a TreeSync> for TreeSyncDiff<'a> { } } -impl<'a> TreeSyncDiff<'a> { +impl TreeSyncDiff<'_> { /// Filtered direct path, skips the nodes whose copath resolution is empty. pub(crate) fn filtered_direct_path(&self, leaf_index: LeafNodeIndex) -> Vec { // Full direct path diff --git a/openmls/src/treesync/node.rs b/openmls/src/treesync/node.rs index 5d615c085e..83fc6961fe 100644 --- a/openmls/src/treesync/node.rs +++ b/openmls/src/treesync/node.rs @@ -26,6 +26,7 @@ pub(crate) mod validate; /// }; /// } Node; /// ``` +#[allow(clippy::large_enum_variant)] #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, TlsSize, TlsSerialize)] #[repr(u8)] pub enum Node { @@ -37,6 +38,7 @@ pub enum Node { ParentNode(ParentNode), } +#[allow(clippy::large_enum_variant)] #[derive( Debug, PartialEq, Eq, Clone, Serialize, Deserialize, TlsSize, TlsDeserialize, TlsSerialize, )] diff --git a/openmls/src/treesync/treekem.rs b/openmls/src/treesync/treekem.rs index 81af6432b2..a0744b2cea 100644 --- a/openmls/src/treesync/treekem.rs +++ b/openmls/src/treesync/treekem.rs @@ -35,7 +35,7 @@ use crate::{ versions::ProtocolVersion, }; -impl<'a> TreeSyncDiff<'a> { +impl TreeSyncDiff<'_> { /// Encrypt the given `path` to the nodes in the copath resolution of the /// owner of this [`TreeSyncDiff`]. The `group_context` is used in the /// encryption of the nodes, while the `exclusion_list` is used to filter