From a2af6b34ca8b9fae9c83c3952cf3f57cb6892efc Mon Sep 17 00:00:00 2001 From: beltram Date: Mon, 27 Nov 2023 15:41:37 +0100 Subject: [PATCH] wip --- openmls/src/group/tests/external_add_proposal.rs | 1 + openmls/src/group/tests/external_remove_proposal.rs | 1 + openmls/src/group/tests/test_commit_validation.rs | 1 + openmls/src/group/tests/test_external_commit_validation.rs | 1 + openmls/src/group/tests/test_framing_validation.rs | 1 + openmls/src/group/tests/test_past_secrets.rs | 1 + openmls/src/group/tests/test_proposal_validation.rs | 1 + openmls/src/group/tests/test_wire_format_policy.rs | 1 + openmls/src/messages/tests/test_codec.rs | 6 +++--- openmls/src/messages/tests/test_export_group_info.rs | 4 ++-- openmls/src/messages/tests/test_proposals.rs | 6 +++--- openmls/src/messages/tests/test_welcome.rs | 1 + openmls/src/treesync/mod.rs | 1 + openmls/src/treesync/tests_and_kats/tests/test_diff.rs | 1 + 14 files changed, 19 insertions(+), 8 deletions(-) diff --git a/openmls/src/group/tests/external_add_proposal.rs b/openmls/src/group/tests/external_add_proposal.rs index 6618a2db3f..e81835f3d5 100644 --- a/openmls/src/group/tests/external_add_proposal.rs +++ b/openmls/src/group/tests/external_add_proposal.rs @@ -16,6 +16,7 @@ use crate::{ use openmls_traits::types::Ciphersuite; use super::utils::*; +use crate::test_utils::*; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); diff --git a/openmls/src/group/tests/external_remove_proposal.rs b/openmls/src/group/tests/external_remove_proposal.rs index 8c7b19a7d8..0887a961eb 100644 --- a/openmls/src/group/tests/external_remove_proposal.rs +++ b/openmls/src/group/tests/external_remove_proposal.rs @@ -11,6 +11,7 @@ use crate::{ use openmls_traits::types::Ciphersuite; use super::utils::*; +use crate::test_utils::*; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); diff --git a/openmls/src/group/tests/test_commit_validation.rs b/openmls/src/group/tests/test_commit_validation.rs index aa9ddfd052..5aa4d0e78a 100644 --- a/openmls/src/group/tests/test_commit_validation.rs +++ b/openmls/src/group/tests/test_commit_validation.rs @@ -10,6 +10,7 @@ use tls_codec::{Deserialize, Serialize}; use super::utils::{ generate_credential_with_key, generate_key_package, resign_message, CredentialWithKeyAndSigner, }; +use crate::test_utils::*; use crate::{ binary_tree::LeafNodeIndex, ciphersuite::signable::Signable, diff --git a/openmls/src/group/tests/test_external_commit_validation.rs b/openmls/src/group/tests/test_external_commit_validation.rs index b0dbf13669..081cb13afe 100644 --- a/openmls/src/group/tests/test_external_commit_validation.rs +++ b/openmls/src/group/tests/test_external_commit_validation.rs @@ -9,6 +9,7 @@ use rstest_reuse::apply; use tls_codec::{Deserialize, Serialize}; use self::utils::*; +use crate::test_utils::*; use crate::{ ciphersuite::{hash_ref::ProposalRef, signable::Verifiable}, framing::{ diff --git a/openmls/src/group/tests/test_framing_validation.rs b/openmls/src/group/tests/test_framing_validation.rs index 83c7f10e3d..556c5c5f22 100644 --- a/openmls/src/group/tests/test_framing_validation.rs +++ b/openmls/src/group/tests/test_framing_validation.rs @@ -18,6 +18,7 @@ use crate::{ use super::utils::{ generate_credential_with_key, generate_key_package, CredentialWithKeyAndSigner, }; +use crate::test_utils::*; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); diff --git a/openmls/src/group/tests/test_past_secrets.rs b/openmls/src/group/tests/test_past_secrets.rs index 0943e73c4c..ec871c0512 100644 --- a/openmls/src/group/tests/test_past_secrets.rs +++ b/openmls/src/group/tests/test_past_secrets.rs @@ -3,6 +3,7 @@ use openmls_rust_crypto::OpenMlsRustCrypto; use openmls_traits::{types::Ciphersuite, OpenMlsCryptoProvider}; +use crate::test_utils::*; use rstest::*; use rstest_reuse::{self, *}; diff --git a/openmls/src/group/tests/test_proposal_validation.rs b/openmls/src/group/tests/test_proposal_validation.rs index 5084f3d855..b2cff815d4 100644 --- a/openmls/src/group/tests/test_proposal_validation.rs +++ b/openmls/src/group/tests/test_proposal_validation.rs @@ -13,6 +13,7 @@ use tls_codec::{Deserialize, Serialize}; use super::utils::{ generate_credential_with_key, generate_key_package, resign_message, CredentialWithKeyAndSigner, }; +use crate::test_utils::*; use crate::{ binary_tree::LeafNodeIndex, ciphersuite::hash_ref::ProposalRef, diff --git a/openmls/src/group/tests/test_wire_format_policy.rs b/openmls/src/group/tests/test_wire_format_policy.rs index 586276001a..dd1d2f1713 100644 --- a/openmls/src/group/tests/test_wire_format_policy.rs +++ b/openmls/src/group/tests/test_wire_format_policy.rs @@ -6,6 +6,7 @@ use openmls_traits::{signatures::Signer, types::Ciphersuite, OpenMlsCryptoProvid use rstest::*; use rstest_reuse::{self, *}; +use crate::test_utils::*; use crate::{ framing::*, group::{config::CryptoConfig, errors::*, *}, diff --git a/openmls/src/messages/tests/test_codec.rs b/openmls/src/messages/tests/test_codec.rs index 6b4a87408b..9bfef8fe34 100644 --- a/openmls/src/messages/tests/test_codec.rs +++ b/openmls/src/messages/tests/test_codec.rs @@ -1,6 +1,4 @@ -use openmls_rust_crypto::OpenMlsRustCrypto; -use tls_codec::{Deserialize, Serialize}; - +use crate::test_utils::*; use crate::{ extensions::Extensions, group::GroupId, @@ -8,6 +6,8 @@ use crate::{ schedule::psk::{ExternalPsk, PreSharedKeyId, Psk, ResumptionPsk, ResumptionPskUsage}, test_utils::*, }; +use openmls_rust_crypto::OpenMlsRustCrypto; +use tls_codec::{Deserialize, Serialize}; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); diff --git a/openmls/src/messages/tests/test_export_group_info.rs b/openmls/src/messages/tests/test_export_group_info.rs index e14c14c5e1..b20b8de431 100644 --- a/openmls/src/messages/tests/test_export_group_info.rs +++ b/openmls/src/messages/tests/test_export_group_info.rs @@ -1,5 +1,4 @@ -use tls_codec::{Deserialize, Serialize}; - +use crate::test_utils::*; use crate::{ ciphersuite::signable::Verifiable, group::test_core_group::setup_alice_group, @@ -9,6 +8,7 @@ use crate::{ }, test_utils::*, }; +use tls_codec::{Deserialize, Serialize}; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); diff --git a/openmls/src/messages/tests/test_proposals.rs b/openmls/src/messages/tests/test_proposals.rs index 3f8ca0e160..93c1f59313 100644 --- a/openmls/src/messages/tests/test_proposals.rs +++ b/openmls/src/messages/tests/test_proposals.rs @@ -1,6 +1,4 @@ -use openmls_rust_crypto::OpenMlsRustCrypto; -use tls_codec::{Deserialize, Serialize}; - +use crate::test_utils::*; use crate::{ binary_tree::LeafNodeIndex, ciphersuite::hash_ref::ProposalRef, @@ -10,6 +8,8 @@ use crate::{ }, test_utils::*, }; +use openmls_rust_crypto::OpenMlsRustCrypto; +use tls_codec::{Deserialize, Serialize}; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); diff --git a/openmls/src/messages/tests/test_welcome.rs b/openmls/src/messages/tests/test_welcome.rs index 53aae69003..7eb74b4764 100644 --- a/openmls/src/messages/tests/test_welcome.rs +++ b/openmls/src/messages/tests/test_welcome.rs @@ -1,3 +1,4 @@ +use crate::test_utils::*; use openmls_basic_credential::SignatureKeyPair; use openmls_rust_crypto::OpenMlsRustCrypto; use openmls_traits::{ diff --git a/openmls/src/treesync/mod.rs b/openmls/src/treesync/mod.rs index 0cd5b34e80..9911d7c63d 100644 --- a/openmls/src/treesync/mod.rs +++ b/openmls/src/treesync/mod.rs @@ -719,6 +719,7 @@ impl TreeSync { #[cfg(test)] mod test { use super::*; + use crate::test_utils::*; #[cfg(debug_assertions)] #[test] diff --git a/openmls/src/treesync/tests_and_kats/tests/test_diff.rs b/openmls/src/treesync/tests_and_kats/tests/test_diff.rs index 1058a1245e..8d58d0881b 100644 --- a/openmls/src/treesync/tests_and_kats/tests/test_diff.rs +++ b/openmls/src/treesync/tests_and_kats/tests/test_diff.rs @@ -3,6 +3,7 @@ use openmls_traits::{types::Ciphersuite, OpenMlsCryptoProvider}; use rstest::*; use rstest_reuse::apply; +use crate::test_utils::*; use crate::{ credentials::test_utils::new_credential, key_packages::KeyPackageBundle,