Skip to content

Commit

Permalink
Expose content type of encrypted messages to external group
Browse files Browse the repository at this point in the history
  • Loading branch information
stefunctional committed Jan 10, 2024
1 parent e8d573c commit 3f78522
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions mls-rs/src/external_client/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::{
snapshot::RawGroupState,
state::GroupState,
transcript_hash::InterimTranscriptHash,
validate_group_info, ExportedTree, GroupContext, Roster,
validate_group_info, ContentType, ExportedTree, GroupContext, Roster,
},
identity::SigningIdentity,
protocol_version::ProtocolVersion,
Expand Down Expand Up @@ -81,7 +81,7 @@ pub enum ExternalReceivedMessage {
/// Received proposal and its unique identifier.
Proposal(ProposalMessageDescription),
/// Encrypted message that can not be processed.
Ciphertext,
Ciphertext(ContentType),
}

/// A handle to an observed group that can track plaintext control messages
Expand Down Expand Up @@ -584,9 +584,11 @@ where
#[cfg(feature = "private_message")]
async fn process_ciphertext(
&mut self,
_cipher_text: PrivateMessage,
cipher_text: PrivateMessage,
) -> Result<EventOrContent<Self::OutputType>, MlsError> {
Ok(EventOrContent::Event(ExternalReceivedMessage::Ciphertext))
Ok(EventOrContent::Event(ExternalReceivedMessage::Ciphertext(
cipher_text.content_type,
)))
}

async fn update_key_schedule(
Expand Down
2 changes: 1 addition & 1 deletion mls-rs/src/group/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ use self::state_repo::GroupStateRepository;
pub(crate) use group_info::GroupInfo;

use self::framing::MlsMessage;
pub use self::framing::Sender;
pub use self::framing::{ContentType, Sender};
pub use commit::*;
pub use context::GroupContext;
pub use roster::*;
Expand Down

0 comments on commit 3f78522

Please sign in to comment.