Skip to content

Commit

Permalink
Merge branch 'main' into uniffi-roster-update
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeisler authored Mar 22, 2024
2 parents 0d90266 + 98cf9fe commit 6e1b331
Show file tree
Hide file tree
Showing 19 changed files with 153 additions and 125 deletions.
2 changes: 1 addition & 1 deletion mls-rs-codec-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-codec-derive"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
description = "Derive macro crate for mls-rs-codec"
homepage = "https://github.com/awslabs/mls-rs"
Expand Down
4 changes: 2 additions & 2 deletions mls-rs-codec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-codec"
version = "0.5.1"
version = "0.5.2"
edition = "2021"
description = "TLS codec and MLS specific encoding used by mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -14,7 +14,7 @@ preallocate = []
std = ["dep:thiserror"]

[dependencies]
mls-rs-codec-derive = { version = "0.1.0", path = "../mls-rs-codec-derive" }
mls-rs-codec-derive = { version = "0.1.1", path = "../mls-rs-codec-derive" }
thiserror = { version = "1.0.40", optional = true }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions mls-rs-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-core"
version = "0.17.1"
version = "0.18.0"
edition = "2021"
description = "Core components and traits for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -22,7 +22,7 @@ test_suite = ["serde", "dep:serde_json", "dep:itertools"]
serde = ["dep:serde", "zeroize/serde", "hex/serde", "dep:serde_bytes"]

[dependencies]
mls-rs-codec = { version = "0.5.0", path = "../mls-rs-codec", default-features = false}
mls-rs-codec = { version = "0.5.2", path = "../mls-rs-codec", default-features = false}
zeroize = { version = "1", default-features = false, features = ["alloc", "zeroize_derive"] }
arbitrary = { version = "1", features = ["derive"], optional = true }
thiserror = { version = "1.0.40", optional = true }
Expand Down
16 changes: 8 additions & 8 deletions mls-rs-crypto-awslc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-awslc"
version = "0.10.0"
version = "0.11.0"
edition = "2021"
description = "AWS-LC based CryptoProvider for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -9,20 +9,20 @@ keywords = ["mls", "mls-rs", "aws-lc"]
license = "Apache-2.0 OR MIT"

[dependencies]
aws-lc-rs = "1.6.1"
aws-lc-rs = "1.6.2"
aws-lc-sys = { version = "0.13.0" }
mls-rs-core = { path = "../mls-rs-core", version = "0.17.1" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.8.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", version = "0.9.0" }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", version = "0.10.0" }
mls-rs-core = { path = "../mls-rs-core", version = "0.18.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.9.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", version = "0.10.0" }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", version = "0.11.0" }
thiserror = "1.0.40"
zeroize = { version = "1", features = ["zeroize_derive"] }
maybe-async = "0.2.10"

[dev-dependencies]
assert_matches = "1.5.0"
mls-rs-core = { path = "../mls-rs-core", version = "0.17.1", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.8.0", features = ["test_utils"] }
mls-rs-core = { path = "../mls-rs-core", version = "0.18.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.9.0", features = ["test_utils"] }
futures-test = "0.3.25"

[target.'cfg(mls_build_async)'.dependencies]
Expand Down
8 changes: 4 additions & 4 deletions mls-rs-crypto-hpke/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-hpke"
version = "0.8.0"
version = "0.9.0"
edition = "2021"
description = "HPKE implementation based on mls-rs-crypto-traits used by mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -15,8 +15,8 @@ std = ["mls-rs-core/std", "mls-rs-crypto-traits/std", "dep:thiserror", "zeroize/
test_utils = ["mls-rs-core/test_suite"]

[dependencies]
mls-rs-core = { path = "../mls-rs-core", default-features = false, version = "0.17.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, version = "0.9.0" }
mls-rs-core = { path = "../mls-rs-core", default-features = false, version = "0.18.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, version = "0.10.0" }
thiserror = { version = "1.0.40", optional = true }
zeroize = { version = "1", default-features = false, features = ["alloc", "zeroize_derive"] }
cfg-if = "^1"
Expand All @@ -28,7 +28,7 @@ serde_json = { version = "^1.0" }
assert_matches = "1.5.0"
mockall = "0.12"
hex = { version = "^0.4.3", features = ["serde"] }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", features = ["mock"], version = "0.9.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", features = ["mock"], version = "0.10.0" }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { version = "0.3.26", default-features = false }
Expand Down
14 changes: 7 additions & 7 deletions mls-rs-crypto-openssl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-openssl"
version = "0.8.0"
version = "0.9.0"
edition = "2021"
description = "OpenSSL based CryptoProvider for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -14,10 +14,10 @@ default = ["x509"]

[dependencies]
openssl = { version = "0.10.40" }
mls-rs-core = { path = "../mls-rs-core", version = "0.17.0" }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", optional = true, version = "0.10.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.8.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", version = "0.9.0" }
mls-rs-core = { path = "../mls-rs-core", version = "0.18.0" }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", optional = true, version = "0.11.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.9.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", version = "0.10.0" }
thiserror = "1.0.40"
zeroize = { version = "1", features = ["zeroize_derive"] }
maybe-async = "0.2.10"
Expand All @@ -27,8 +27,8 @@ hex = { version = "^0.4.3", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "^1.0" }
assert_matches = "1.5.0"
mls-rs-core = { path = "../mls-rs-core", version = "0.17.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.8.0", features = ["test_utils"] }
mls-rs-core = { path = "../mls-rs-core", version = "0.18.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.9.0", features = ["test_utils"] }

[target.'cfg(mls_build_async)'.dependencies]
async-trait = "0.1.74"
14 changes: 7 additions & 7 deletions mls-rs-crypto-rustcrypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-rustcrypto"
version = "0.9.0"
version = "0.10.0"
edition = "2021"
description = "RustCrypto based CryptoProvider for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand Down Expand Up @@ -29,9 +29,9 @@ std = [
]

[dependencies]
mls-rs-core = { path = "../mls-rs-core", default-features = false, version = "0.17.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, version = "0.8.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, version = "0.9.0" }
mls-rs-core = { path = "../mls-rs-core", default-features = false, version = "0.18.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, version = "0.9.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, version = "0.10.0" }

thiserror = { version = "1.0.40", optional = true }
zeroize = { version = "1", default-features = false, features = ["alloc", "zeroize_derive"] }
Expand All @@ -58,7 +58,7 @@ ed25519-dalek = { version = "2", default-features = false, features = ["alloc",
sec1 = { version = "0.7", default-features = false, features = ["alloc"] }

# X509 feature
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", optional = true, version = "0.10.0" }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", optional = true, version = "0.11.0" }
x509-cert = { version = "0.2", optional = true, features = ["std"] }
spki = { version = "0.7", optional = true, features = ["std", "alloc"] }
const-oid = { version = "0.9", optional = true, features = ["std"] }
Expand All @@ -69,8 +69,8 @@ hex = { version = "^0.4.3", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "^1.0" }
assert_matches = "1.5.0"
mls-rs-core = { path = "../mls-rs-core", version = "0.17.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, version = "0.8.0", features = ["test_utils"] }
mls-rs-core = { path = "../mls-rs-core", version = "0.18.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, version = "0.9.0", features = ["test_utils"] }

[target.'cfg(mls_build_async)'.dependencies]
async-trait = "0.1.74"
4 changes: 2 additions & 2 deletions mls-rs-crypto-traits/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-traits"
version = "0.9.0"
version = "0.10.0"
edition = "2021"
description = "Crypto traits required to create a CryptoProvider for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -14,7 +14,7 @@ std = ["mls-rs-core/std"]
default = ["std"]

[dependencies]
mls-rs-core = { path = "../mls-rs-core", version = "0.17.0", default-features = false }
mls-rs-core = { path = "../mls-rs-core", version = "0.18.0", default-features = false }
mockall = { version = "^0.11", optional = true }
maybe-async = "0.2.10"

Expand Down
10 changes: 5 additions & 5 deletions mls-rs-crypto-webcrypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-webcrypto"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
description = "SubtleCrypto based CryptoProvider for supporting mls-rs in a browser"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -9,9 +9,9 @@ keywords = ["mls", "mls-rs"]
license = "Apache-2.0 OR MIT"

[dependencies]
mls-rs-core = { path = "../mls-rs-core", default-features = false, features = ["std"], version = "0.17.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, features = ["std"], version = "0.8.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, features = ["std"], version = "0.9.0" }
mls-rs-core = { path = "../mls-rs-core", default-features = false, features = ["std"], version = "0.18.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, features = ["std"], version = "0.9.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, features = ["std"], version = "0.10.0" }
thiserror = "1.0.40"
zeroize = { version = "1", features = ["zeroize_derive"] }
maybe-async = "0.2.10"
Expand All @@ -26,7 +26,7 @@ web-sys = { version = "0.3.64", features = ["Window", "CryptoKey", "CryptoKeyPai
const-oid = { version = "0.9", features = ["db"] }

[dev-dependencies]
mls-rs-core = { path = "../mls-rs-core", version = "0.17.0", features = ["test_suite"] }
mls-rs-core = { path = "../mls-rs-core", version = "0.18.0", features = ["test_suite"] }
wasm-bindgen-test = { version = "0.3.26", default-features = false }
futures-test = "0.3.25"
serde_json = "^1.0"
Expand Down
10 changes: 5 additions & 5 deletions mls-rs-ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-ffi"
version = "0.5.0"
version = "0.6.0"
edition = "2021"
description = "Helper crate to generate FFI definitions for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -19,9 +19,9 @@ std = ["mls-rs/std", "safer-ffi-gen/std"]
x509 = ["mls-rs-identity-x509"]

[dependencies]
mls-rs = { path = "../mls-rs", version = "0.38.0", features = ["ffi"] }
mls-rs-crypto-openssl = { path = "../mls-rs-crypto-openssl", version = "0.8.0", optional = true }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", version = "0.10.0", optional = true }
mls-rs-provider-sqlite = { path = "../mls-rs-provider-sqlite", version = "0.10.0", default-features = false, optional = true }
mls-rs = { path = "../mls-rs", version = "0.39.0", features = ["ffi"] }
mls-rs-crypto-openssl = { path = "../mls-rs-crypto-openssl", version = "0.9.0", optional = true }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", version = "0.11.0", optional = true }
mls-rs-provider-sqlite = { path = "../mls-rs-provider-sqlite", version = "0.11.0", default-features = false, optional = true }
safer-ffi = { version = "0.1.3", default-features = false }
safer-ffi-gen = { version = "0.9.2", default-features = false }
4 changes: 2 additions & 2 deletions mls-rs-identity-x509/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-identity-x509"
version = "0.10.0"
version = "0.11.0"
edition = "2021"
description = "X509 Identity utilities for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -13,7 +13,7 @@ default = ["std"]
std = ["mls-rs-core/std", "dep:thiserror"]

[dependencies]
mls-rs-core = { path = "../mls-rs-core", default-features = false, features = ["x509"], version = "0.17.0" }
mls-rs-core = { path = "../mls-rs-core", default-features = false, features = ["x509"], version = "0.18.0" }
maybe-async = "0.2.10"
thiserror = { version = "1.0.40", optional = true }

Expand Down
6 changes: 3 additions & 3 deletions mls-rs-provider-sqlite/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-provider-sqlite"
version = "0.10.0"
version = "0.11.0"
edition = "2021"
description = "SQLite based state storage for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -9,11 +9,11 @@ keywords = ["mls", "mls-rs"]
license = "Apache-2.0 OR MIT"

[dependencies]
mls-rs-core = { path = "../mls-rs-core", version = "0.17.0" }
mls-rs-core = { path = "../mls-rs-core", version = "0.18.0" }
thiserror = "1.0.40"
wasm-bindgen = { version = "0.2", optional = true }
zeroize = { version = "1", features = ["zeroize_derive"] }
rusqlite = { version = "0.30", default-features = false }
rusqlite = { version = "0.31", default-features = false }
rand = "0.8"
hex = { version = "0.4" }
maybe-async = "0.2.10"
Expand Down
6 changes: 3 additions & 3 deletions mls-rs-uniffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ name = "mls_rs_uniffi"
[dependencies]
async-trait = "0.1.77"
maybe-async = "0.2.10"
mls-rs = { path = "../mls-rs" }
mls-rs-core = { path = "../mls-rs-core" }
mls-rs-crypto-openssl = { path = "../mls-rs-crypto-openssl" }
mls-rs = { version = "0.39.0", path = "../mls-rs" }
mls-rs-core = { version = "0.18.0", path = "../mls-rs-core" }
mls-rs-crypto-openssl = { version = "0.9.0", path = "../mls-rs-crypto-openssl" }
thiserror = "1.0.57"
uniffi = "0.26.0"

Expand Down
87 changes: 87 additions & 0 deletions mls-rs-uniffi/tests/custom_storage_sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
from dataclasses import dataclass, field

from mls_rs_uniffi import CipherSuite, generate_signature_keypair, Client, \
GroupStateStorage, EpochRecord, ClientConfig, ProtocolVersion


@dataclass
class GroupStateData:
state: bytes
epoch_data: list[EpochRecord] = field(default_factory=list)


class PythonGroupStateStorage(GroupStateStorage):

def __init__(self):
self.groups: dict[str, GroupStateData] = {}

def state(self, group_id: bytes):
group = self.groups.get(group_id.hex())
if group == None:
return None

return group.state

def epoch(self, group_id: bytes, epoch_id: int):
group = self.groups.get(group_id.hex())
if group == None:
return None

for epoch in group.epoch_data:
if epoch.id == epoch_id:
return epoch

return None

def write(self, group_id: bytes, group_state: bytes,
epoch_inserts: list[EpochRecord],
epoch_updates: list[EpochRecord]):
if group_id.hex() not in self.groups:
self.groups[group_id.hex()] = GroupStateData(group_state)
group = self.groups[group_id.hex()]

for insert in epoch_inserts:
group.epoch_data.append(insert)

for update in epoch_updates:
for i in range(len(group.epoch_data)):
if group.epoch_data[i].id == update.id:
group.epoch_data[i] = update

def max_epoch_id(self, group_id: bytes):
group = self.groups.get(group_id.hex())
if group == None:
return None

last = group.epoch_data.last()

if last == None:
return None

return last.id


group_state_storage = PythonGroupStateStorage()
client_config = ClientConfig(group_state_storage,
use_ratchet_tree_extension=True)

key = generate_signature_keypair(CipherSuite.CURVE25519_AES128)
alice = Client(b'alice', key, client_config)

key = generate_signature_keypair(CipherSuite.CURVE25519_AES128)
bob = Client(b'bob', key, client_config)

alice = alice.create_group(None)
message = bob.generate_key_package_message()

output = alice.add_members([message])
alice.process_incoming_message(output.commit_message)
bob = bob.join_group(None, output.welcome_messages[0]).group

msg = alice.encrypt_application_message(b'hello, bob')
output = bob.process_incoming_message(msg)

alice.write_to_storage()

assert output.data == b'hello, bob'
assert len(group_state_storage.groups) == 1
1 change: 1 addition & 0 deletions mls-rs-uniffi/tests/scenarios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ macro_rules! generate_python_tests {

generate_python_tests!(generate_signature_keypair, None);
generate_python_tests!(client_config_default_sync, None);
generate_python_tests!(custom_storage_sync, None);
generate_python_tests!(roster_update_sync, None);

// TODO(mulmarta): it'll break if we use async trait which will be
Expand Down
Loading

0 comments on commit 6e1b331

Please sign in to comment.