diff --git a/openmls/src/framing/mls_content.rs b/openmls/src/framing/mls_content.rs index 5bc9e75a22..2cf35d8e26 100644 --- a/openmls/src/framing/mls_content.rs +++ b/openmls/src/framing/mls_content.rs @@ -227,7 +227,8 @@ pub(crate) fn framed_content_tbs_serialized<'context, W: Write>( // NewMemberCommit. written += match serialized_context.into() { Some(context) if matches!(sender, Sender::Member(_) | Sender::NewMemberCommit) => { - writer.write(context)? + writer.write_all(context)?; + context.len() } _ => 0, }; diff --git a/openmls/src/group/core_group/new_from_welcome.rs b/openmls/src/group/core_group/new_from_welcome.rs index 08e5b4b272..d2d98de122 100644 --- a/openmls/src/group/core_group/new_from_welcome.rs +++ b/openmls/src/group/core_group/new_from_welcome.rs @@ -316,7 +316,7 @@ mod tests { fn psk_ids_should_be_valid() { let group_id = GroupId::from_slice(b"test"); let epoch = GroupEpoch(1); - let psks = vec![ + let psks = [ ResumptionPsk::new(ResumptionPskUsage::Reinit, group_id.clone(), epoch), ResumptionPsk::new(ResumptionPskUsage::Branch, group_id.clone(), epoch), ResumptionPsk::new(ResumptionPskUsage::Application, group_id, epoch), @@ -328,7 +328,7 @@ mod tests { fn psk_ids_should_be_valid_application() { let group_id = GroupId::from_slice(b"test"); let epoch = GroupEpoch(1); - let psks = vec![ + let psks = [ ResumptionPsk::new(ResumptionPskUsage::Application, group_id.clone(), epoch), ResumptionPsk::new(ResumptionPskUsage::Application, group_id.clone(), epoch), ResumptionPsk::new(ResumptionPskUsage::Application, group_id.clone(), epoch), @@ -341,7 +341,7 @@ mod tests { fn psk_ids_should_be_invalid_reinit() { let group_id = GroupId::from_slice(b"test"); let epoch = GroupEpoch(1); - let psks = vec![ + let psks = [ ResumptionPsk::new(ResumptionPskUsage::Reinit, group_id.clone(), epoch), ResumptionPsk::new(ResumptionPskUsage::Branch, group_id.clone(), epoch), ResumptionPsk::new(ResumptionPskUsage::Reinit, group_id.clone(), epoch), @@ -357,7 +357,7 @@ mod tests { fn psk_ids_should_be_invalid_branch() { let group_id = GroupId::from_slice(b"test"); let epoch = GroupEpoch(1); - let psks = vec![ + let psks = [ ResumptionPsk::new(ResumptionPskUsage::Reinit, group_id.clone(), epoch), ResumptionPsk::new(ResumptionPskUsage::Branch, group_id.clone(), epoch), ResumptionPsk::new(ResumptionPskUsage::Branch, group_id.clone(), epoch), @@ -373,7 +373,7 @@ mod tests { fn psk_ids_should_be_invalid() { let group_id = GroupId::from_slice(b"test"); let epoch = GroupEpoch(1); - let psks = vec![ + let psks = [ ResumptionPsk::new(ResumptionPskUsage::Reinit, group_id.clone(), epoch), ResumptionPsk::new(ResumptionPskUsage::Branch, group_id.clone(), epoch), ResumptionPsk::new(ResumptionPskUsage::Reinit, group_id.clone(), epoch),