Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #223

Merged
merged 5 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mls-rs-codec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ thiserror = { version = "1.0.40", optional = true }
assert_matches = "1.5.0"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { version = "0.3.26", default-features = false }
wasm-bindgen-test = { version = "=0.3.26", default-features = false }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { version = "0.2.79" }
wasm-bindgen = { version = "=0.2.87" }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mls_build_async)'] }
6 changes: 3 additions & 3 deletions mls-rs-codec/src/cow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use alloc::{

use crate::{Error, MlsDecode, MlsEncode, MlsSize};

impl<'a, T> MlsSize for Cow<'a, T>
impl<T> MlsSize for Cow<'_, T>
where
T: MlsSize + ToOwned,
{
Expand All @@ -14,7 +14,7 @@ where
}
}

impl<'a, T> MlsEncode for Cow<'a, T>
impl<T> MlsEncode for Cow<'_, T>
where
T: MlsEncode + ToOwned,
{
Expand All @@ -24,7 +24,7 @@ where
}
}

impl<'a, T> MlsDecode for Cow<'a, T>
impl<T> MlsDecode for Cow<'_, T>
where
T: ToOwned,
<T as ToOwned>::Owned: MlsDecode,
Expand Down
4 changes: 2 additions & 2 deletions mls-rs-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ async-trait = "0.1.74"
assert_matches = "1.5.0"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { version = "0.3.26", default-features = false }
wasm-bindgen-test = { version = "=0.3.26", default-features = false }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { version = "^0.2.79" }
wasm-bindgen = { version = "=0.2.87" }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mls_build_async)', 'cfg(coverage_nightly)'] }
2 changes: 1 addition & 1 deletion mls-rs-core/src/identity/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub enum MemberValidationContext<'a> {
None,
}

impl<'a> MemberValidationContext<'a> {
impl MemberValidationContext<'_> {
pub fn new_extensions(&self) -> Option<&ExtensionList> {
match self {
Self::ForCommit { new_extensions, .. } => Some(*new_extensions),
Expand Down
2 changes: 1 addition & 1 deletion mls-rs-crypto-awslc/src/x509/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ pub struct X509ExtensionContext<'a> {
pub(crate) phantom: PhantomData<&'a Certificate>,
}

impl<'a> X509ExtensionContext<'a> {
impl X509ExtensionContext<'_> {
pub fn as_mut_ptr(&mut self) -> *mut X509V3_CTX {
&mut self.inner
}
Expand Down
2 changes: 1 addition & 1 deletion mls-rs-crypto-hpke/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ hex = { version = "^0.4.3", features = ["serde"] }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", features = ["mock"], version = "0.12.0" }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { version = "0.3.26", default-features = false }
wasm-bindgen-test = { version = "=0.3.26", default-features = false }
getrandom = { version = "0.2", features = ["js"] }

[target.'cfg(mls_build_async)'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion mls-rs-crypto-rustcrypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false,
async-trait = "0.1.74"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { version = "0.3.26", default-features = false }
wasm-bindgen-test = { version = "=0.3.26", default-features = false }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mls_build_async)'] }
4 changes: 2 additions & 2 deletions mls-rs-crypto-webcrypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ zeroize = { version = "1", features = ["zeroize_derive"] }
maybe-async = "0.2.10"
async-trait = "0.1.74"
js-sys = "0.3.64"
wasm-bindgen = "0.2.87"
wasm-bindgen = "=0.2.87"
wasm-bindgen-futures = "0.4.37"
serde-wasm-bindgen = "0.6"
serde = { version = "1.0", features = ["derive"] }
Expand All @@ -27,7 +27,7 @@ const-oid = { version = "0.9", features = ["db"] }

[dev-dependencies]
mls-rs-core = { path = "../mls-rs-core", version = "0.20.0", features = ["test_suite"] }
wasm-bindgen-test = { version = "0.3.26", default-features = false }
wasm-bindgen-test = { version = "=0.3.26", default-features = false }
futures-test = "0.3.25"
serde_json = "^1.0"
hex = { version = "^0.4.3", features = ["serde"] }
Expand Down
4 changes: 2 additions & 2 deletions mls-rs-crypto-webcrypto/src/aead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ impl Aead {
.then_some(())
.ok_or(CryptoError::WrongKeyLength)?;

let params = AesGcmParams::new(key_type.algorithm(), &Uint8Array::from(nonce));
let mut params = AesGcmParams::new(key_type.algorithm(), &Uint8Array::from(nonce));
let aad = Uint8Array::from(aad.unwrap_or_default());
params.set_additional_data(&aad);
params.additional_data(&aad);
let key = key_type.import(&crypto, key).await?;

let out = match key_type {
Expand Down
4 changes: 2 additions & 2 deletions mls-rs-crypto-webcrypto/src/key_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ impl KeyType {
| KeyType::EcdhSecret(curve)
| KeyType::EcdsaPublic(curve)
| KeyType::EcdsaSecret(curve) => {
let params = EcKeyImportParams::new(self.algorithm());
params.set_named_curve(curve);
let mut params = EcKeyImportParams::new(self.algorithm());
params.named_curve(curve);

crypto.import_key_with_object(self.format(), &key, &params, true, &key_usages)?
}
Expand Down
4 changes: 2 additions & 2 deletions mls-rs-identity-x509/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ assert_matches = "1"
rand = "0.8"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { version = "0.3.26", default-features = false }
wasm-bindgen-test = { version = "=0.3.26", default-features = false }
getrandom = { version = "0.2", features = ["js"] }


[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { version = "^0.2.79" }
wasm-bindgen = { version = "=0.2.87" }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mls_build_async)'] }
2 changes: 1 addition & 1 deletion mls-rs-provider-sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT"
[dependencies]
mls-rs-core = { path = "../mls-rs-core", version = "0.20.0" }
thiserror = "1.0.40"
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen = { version = "=0.2.87", optional = true }
zeroize = { version = "1", features = ["zeroize_derive"] }
rusqlite = { version = "0.31", default-features = false }
rand = "0.8"
Expand Down
4 changes: 2 additions & 2 deletions mls-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ serde = { version = "1.0", default-features = false, features = ["alloc", "deriv
hex = { version = "^0.4.3", default-features = false, features = ["serde", "alloc"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { version = "^0.2.79" }
wasm-bindgen = { version = "=0.2.87" }
getrandom = { version = "0.2", features = ["js", "custom"], default-features = false }
rand_core = { version = "0.6", default-features = false, features = ["alloc"] }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { version = "0.3.26", default-features = false }
wasm-bindgen-test = { version = "=0.3.26", default-features = false }
mls-rs-crypto-webcrypto = { path = "../mls-rs-crypto-webcrypto", version = "0.6.0" }
criterion = { version = "0.5.1", default-features = false, features = ["plotters", "cargo_bench_support", "async_futures", "html_reports"] }

Expand Down
2 changes: 1 addition & 1 deletion mls-rs/src/group/group_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct SignableGroupInfo<'a> {
signer: LeafIndex,
}

impl<'a> Signable<'a> for GroupInfo {
impl Signable<'_> for GroupInfo {
const SIGN_LABEL: &'static str = "GroupInfoTBS";
type SigningContext = ();

Expand Down
2 changes: 1 addition & 1 deletion mls-rs/src/group/message_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub(crate) struct ProvisionalState {
// psk
// reinit
pub(crate) fn path_update_required(proposals: &ProposalBundle) -> bool {
let res = proposals.external_init_proposals().first().is_some();
let res = !proposals.external_init_proposals().is_empty();

#[cfg(feature = "by_ref_proposal")]
let res = res || !proposals.update_proposals().is_empty();
Expand Down
4 changes: 2 additions & 2 deletions mls-rs/src/group/message_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub(crate) struct AuthenticatedContentTBS<'a> {
pub(crate) context: Option<&'a GroupContext>,
}

impl<'a> MlsSize for AuthenticatedContentTBS<'a> {
impl MlsSize for AuthenticatedContentTBS<'_> {
fn mls_encoded_len(&self) -> usize {
self.protocol_version.mls_encoded_len()
+ self.wire_format.mls_encoded_len()
Expand All @@ -168,7 +168,7 @@ impl<'a> MlsSize for AuthenticatedContentTBS<'a> {
}
}

impl<'a> MlsEncode for AuthenticatedContentTBS<'a> {
impl MlsEncode for AuthenticatedContentTBS<'_> {
fn mls_encode(&self, writer: &mut Vec<u8>) -> Result<(), mls_rs_codec::Error> {
self.protocol_version.mls_encode(writer)?;
self.wire_format.mls_encode(writer)?;
Expand Down
21 changes: 12 additions & 9 deletions mls-rs/src/group/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2318,7 +2318,7 @@ mod tests {
}

#[maybe_async::test(not(mls_build_async), async(mls_build_async, crate::futures_test))]
async fn test_reused_key_package() -> Result<(), MlsError> {
async fn test_reused_key_package() {
let mut alice_group = test_group(TEST_PROTOCOL_VERSION, TEST_CIPHER_SUITE).await;
let (bob_client, bob_key_package) =
test_client_with_key_pkg(TEST_PROTOCOL_VERSION, TEST_CIPHER_SUITE, "bob").await;
Expand All @@ -2328,33 +2328,36 @@ mod tests {
let commit_output = alice_group
.group
.commit_builder()
.add_member(bob_key_package.clone())?
.add_member(bob_key_package.clone())
.unwrap()
.build()
.await?;
.await
.unwrap();

// Bob joins group.
let (mut bob_group, _) = bob_client
.join_group(None, &commit_output.welcome_messages[0])
.await?;
.await
.unwrap();
// This deletes the key package used to join the group.
bob_group.write_to_storage().await?;
bob_group.write_to_storage().await.unwrap();

// Carla adds Bob, reusing the same key package.
let commit_output = carla_group
.group
.commit_builder()
.add_member(bob_key_package.clone())?
.add_member(bob_key_package.clone())
.unwrap()
.build()
.await?;
.await
.unwrap();

// Bob cannot join Carla's group.
let bob_group = bob_client
.join_group(None, &commit_output.welcome_messages[0])
.await
.map(|_| ());
assert_matches!(bob_group, Err(MlsError::WelcomeKeyPackageNotFound));

Ok(())
}

#[cfg(feature = "last_resort_key_package_ext")]
Expand Down
2 changes: 1 addition & 1 deletion mls-rs/src/group/proposal_filter/filtering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ use {crate::iter::ParallelIteratorExt, rayon::prelude::*};
#[cfg(mls_build_async)]
use futures::{StreamExt, TryStreamExt};

impl<'a, C, P, CSP> ProposalApplier<'a, C, P, CSP>
impl<C, P, CSP> ProposalApplier<'_, C, P, CSP>
where
C: IdentityProvider,
P: PreSharedKeyStorage,
Expand Down
2 changes: 1 addition & 1 deletion mls-rs/src/group/proposal_filter/filtering_lite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use crate::group::{
#[cfg(all(feature = "std", feature = "psk"))]
use std::collections::HashSet;

impl<'a, C, P, CSP> ProposalApplier<'a, C, P, CSP>
impl<C, P, CSP> ProposalApplier<'_, C, P, CSP>
where
C: IdentityProvider,
P: PreSharedKeyStorage,
Expand Down
2 changes: 1 addition & 1 deletion mls-rs/src/key_package/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl KeyPackageGeneration {
}
}

impl<'a, CP> KeyPackageGenerator<'a, CP>
impl<CP> KeyPackageGenerator<'_, CP>
where
CP: CipherSuiteProvider,
{
Expand Down
2 changes: 1 addition & 1 deletion mls-rs/src/key_package/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl KeyPackage {
}
}

impl<'a> Signable<'a> for KeyPackage {
impl Signable<'_> for KeyPackage {
const SIGN_LABEL: &'static str = "KeyPackageTBS";

type SigningContext = ();
Expand Down
2 changes: 1 addition & 1 deletion mls-rs/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub(crate) mod test_utils {
pub signature: Vec<u8>,
}

impl<'a> Signable<'a> for TestSignable {
impl Signable<'_> for TestSignable {
const SIGN_LABEL: &'static str = "SignWithLabel";

type SigningContext = Vec<u8>;
Expand Down
4 changes: 2 additions & 2 deletions mls-rs/src/tree_kem/leaf_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ struct LeafNodeTBS<'a> {
leaf_index: Option<u32>,
}

impl<'a> MlsSize for LeafNodeTBS<'a> {
impl MlsSize for LeafNodeTBS<'_> {
fn mls_encoded_len(&self) -> usize {
self.public_key.mls_encoded_len()
+ self.signing_identity.mls_encoded_len()
Expand All @@ -201,7 +201,7 @@ impl<'a> MlsSize for LeafNodeTBS<'a> {
}
}

impl<'a> MlsEncode for LeafNodeTBS<'a> {
impl MlsEncode for LeafNodeTBS<'_> {
fn mls_encode(&self, writer: &mut Vec<u8>) -> Result<(), mls_rs_codec::Error> {
self.public_key.mls_encode(writer)?;
self.signing_identity.mls_encode(writer)?;
Expand Down
2 changes: 1 addition & 1 deletion mls-rs/src/tree_kem/leaf_node_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub enum ValidationContext<'a> {
Commit((&'a [u8], u32, Option<MlsTime>)),
}

impl<'a> ValidationContext<'a> {
impl ValidationContext<'_> {
fn signing_context(&self) -> LeafNodeSigningContext {
match *self {
ValidationContext::Add(_) => Default::default(),
Expand Down
Loading