Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
beltram committed Feb 21, 2024
1 parent 6f2c352 commit 49ebafa
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions openmls/src/group/core_group/test_proposals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async fn proposal_queue_functions(ciphersuite: Ciphersuite, backend: &impl OpenM
let kpi = KeyPackageIn::from(alice_update_key_package.clone());

assert!(kpi
.standalone_validate(backend, ProtocolVersion::Mls10)
.standalone_validate(backend, ProtocolVersion::Mls10, true)
.await
.is_ok());

Expand Down Expand Up @@ -197,7 +197,7 @@ async fn proposal_queue_order(ciphersuite: Ciphersuite, backend: &impl OpenMlsCr
let kpi = KeyPackageIn::from(alice_update_key_package.clone());

assert!(kpi
.standalone_validate(backend, ProtocolVersion::Mls10)
.standalone_validate(backend, ProtocolVersion::Mls10, true)
.await
.is_ok());

Expand Down
1 change: 1 addition & 0 deletions openmls/src/group/public_group/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ async fn public_group(ciphersuite: Ciphersuite, backend: &impl OpenMlsCryptoProv
ratchet_tree.into(),
verifiable_group_info,
ProposalStore::new(),
true,
)
.await
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion openmls/src/group/tests/test_proposal_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ async fn test_valsem105(ciphersuite: Ciphersuite, backend: &impl OpenMlsCryptoPr
.await;

let kpi: KeyPackageIn = charlie_key_package.clone().into();
kpi.standalone_validate(backend, ProtocolVersion::Mls10)
kpi.standalone_validate(backend, ProtocolVersion::Mls10, true)
.await
.unwrap();

Expand Down
8 changes: 4 additions & 4 deletions openmls/src/key_packages/test_key_packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async fn generate_key_package(ciphersuite: Ciphersuite, backend: &impl OpenMlsCr

let kpi = KeyPackageIn::from(key_package);
assert!(kpi
.standalone_validate(backend, ProtocolVersion::Mls10)
.standalone_validate(backend, ProtocolVersion::Mls10, true)
.await
.is_ok());
}
Expand Down Expand Up @@ -101,7 +101,7 @@ async fn application_id_extension(ciphersuite: Ciphersuite, backend: &impl OpenM

let kpi = KeyPackageIn::from(key_package.clone());
assert!(kpi
.standalone_validate(backend, ProtocolVersion::Mls10)
.standalone_validate(backend, ProtocolVersion::Mls10, true)
.await
.is_ok());

Expand Down Expand Up @@ -138,7 +138,7 @@ async fn key_package_validation(ciphersuite: Ciphersuite, backend: &impl OpenMls
let kpi = KeyPackageIn::tls_deserialize(&mut encoded.as_slice()).unwrap();

let err = kpi
.standalone_validate(backend, ProtocolVersion::Mls10)
.standalone_validate(backend, ProtocolVersion::Mls10, true)
.await
.unwrap_err();
// Expect an invalid protocol version error
Expand All @@ -158,7 +158,7 @@ async fn key_package_validation(ciphersuite: Ciphersuite, backend: &impl OpenMls
let kpi = KeyPackageIn::tls_deserialize(&mut encoded.as_slice()).unwrap();

let err = kpi
.standalone_validate(backend, ProtocolVersion::Mls10)
.standalone_validate(backend, ProtocolVersion::Mls10, true)
.await
.unwrap_err();
// Expect an invalid init/encryption key error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async fn run_test_vector(
let ratchet_tree = RatchetTree::from(RatchetTreeIn::from_nodes(nodes));

let tree_before =
TreeSync::from_ratchet_tree(backend, ciphersuite, ratchet_tree, &group_id, false)
TreeSync::from_ratchet_tree(backend, ciphersuite, ratchet_tree, &group_id, false, true)
.await
.map_err(|e| format!("Error while creating tree sync: {e:?}"))?;

Expand Down
14 changes: 10 additions & 4 deletions openmls/src/treesync/tests_and_kats/kats/kat_tree_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,16 @@ async fn run_test_vector(
.into_verified(ciphersuite, backend.crypto(), group_id)
.unwrap();

let treesync =
TreeSync::from_ratchet_tree(backend, ciphersuite, ratchet_tree.clone(), group_id, true)
.await
.map_err(|e| format!("Error while creating tree sync: {e:?}"))?;
let treesync = TreeSync::from_ratchet_tree(
backend,
ciphersuite,
ratchet_tree.clone(),
group_id,
true,
true,
)
.await
.map_err(|e| format!("Error while creating tree sync: {e:?}"))?;

let diff = treesync.empty_diff();

Expand Down
2 changes: 1 addition & 1 deletion openmls/src/treesync/tests_and_kats/kats/kat_treekem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub async fn run_test_vector(test: TreeKemTest, backend: &impl OpenMlsCryptoProv
.into_verified(ciphersuite, backend.crypto(), group_id)
.unwrap();

TreeSync::from_ratchet_tree(backend, ciphersuite, ratchet_tree, group_id, true)
TreeSync::from_ratchet_tree(backend, ciphersuite, ratchet_tree, group_id, true, true)
.await
.unwrap()
};
Expand Down
7 changes: 4 additions & 3 deletions openmls/src/treesync/tests_and_kats/tests/test_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ async fn test_free_leaf_computation(

// Get the encryption key pair from the leaf.
let group_id = GroupId::random(backend);
let tree = TreeSync::from_ratchet_tree(backend, ciphersuite, ratchet_tree, &group_id, true)
.await
.expect("error generating tree");
let tree =
TreeSync::from_ratchet_tree(backend, ciphersuite, ratchet_tree, &group_id, true, true)
.await
.expect("error generating tree");

// Create and add a new leaf. It should go to leaf index 1

Expand Down

0 comments on commit 49ebafa

Please sign in to comment.