F21: the client — MLS 1:1, mailboxes, invites #14
Reference in New Issue
Block a user
Delete Branch "feature/client"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
F21 (#3, #6): the client: MLS 1:1 over OpenMLS 0.9, a mailbox per contact, and invites. Analysis:
.agents/features/client.md. Review:.agents/reviews/feature-client.md.Merging waits for Mark's approval of the new PROTOCOL.md section 4.
OpenMLS check (#3):
Evidence:
Not here: state across restarts (F22), the HTTP transport for apps (F22), block (F24), a real phone, iOS.
Adversarial self-review — F21, the client (MLS 1:1, mailboxes, invites)
Base:
mainatb502e57. Analysis:.agents/features/client.md. Findings F1–F6 are on the lines they are about; F7 and F8 are below.Evidence
cargo test --workspace --locked(Windows)adb: 10 passed, 0 failed, the real relay running on the device includedcargo build -p tabellarius-clientforaarch64-andarmv7-Android-D warnings), fmt,check-deps.sh, hook testshpke-rs0.7, MPL-2.0 (F2). No C codemutate_client.py)hmac, RFC 5869 written out)helloaccepted, redirecting messages to another mailboxF7 — MLS test vectors
RFC 9420's test vectors run in OpenMLS's own CI, not here. This repository tests two of its clients talking, and OpenMLS validates every message it processes. Stated as is.
F8 — scope
Not verified
Verdict
F1 fixed on this branch; F2 is for Amicitia (F22); F3 approved by Mark on 2026-11-14. Merging.
@@ -9,2 +9,4 @@[dependencies]tabellarius-protocol = { path = "../protocol" }# MLS (RFC 9420). Pure-Rust crypto provider (RustCrypto), so Android and iOS need no C toolchain.openmls = "0.9"F2 — licence, for Amicitia. OpenMLS's HPKE (
hpke-rs,-crypto,-rust-crypto) is MPL-2.0, file-level copyleft. Shipping it unmodified inside the closed Amicitia app is allowed, but the app must say where its source is. That goes into Amicitia's licence notices with F22.@@ -3,0 +121,4 @@outbox: Option<(MailboxId, Token)>,}pub struct Client<T: Transport> {F6 — state lives in memory. A restart loses the groups. Keeping MLS state in Amicitia's encrypted
mlstable is F22; until then nothing is used for real.@@ -3,0 +149,4 @@.random_array().map_err(|_| ClientError::Random)?;let credential = CredentialWithKey {credential: BasicCredential::new(identity.to_vec()).into(),F4 — privacy: what the relay sees. The KeyPackage waits on the relay until claimed: the inviter's MLS public keys and this credential, 16 random bytes, not a name (the first planted bug guards it). The Welcome is encrypted to the KeyPackage. The relay cannot tell that the welcome mailbox and the two personal mailboxes belong together, except by timing (section 1, stated).
@@ -3,0 +222,4 @@}/// Step 2, on the other device: claim the KeyPackage, make the group, send Welcome and hello.pub fn accept_invite(&mut self, invite: &Invite) -> Result<ContactId, ClientError> {F5 — whoever opens the link first becomes the contact. The inviter sees the joiner's name. A leaked link is answered by safety footprints (F26), and by sharing links privately or by QR in person.
@@ -3,0 +290,4 @@) -> Result<Vec<u8>, ClientError> {let json = serde_json::to_vec(payload).map_err(|_| ClientError::Mls)?;let blob = group.create_message(provider, signer, &json)F4 — privacy. Hellos and texts are MLS private messages with empty additional data; the third planted bug (payload in the AAD) guards this.
@@ -3,0 +447,4 @@/// nor rename themselves. Only the contact can send one (MLS authenticates it), so this guards/// against a misbehaving contact or a replayed message.#[test]fn a_second_hello_changes_nothing() {F1 — test honesty, fixed. A second
hellohad no test; a planted bug that accepted it (redirecting messages to another mailbox) passed. This unit test catches it.@@ -0,0 +53,4 @@}/// How many blobs wait on the relay, in all mailboxes: what was not acknowledged.pub fn waiting_blobs(&self) -> usize {F1 — test honesty, fixed. "The second poll is empty" passed without acknowledgements too: MLS rejects a re-fetched message as a replay, so nothing is shown either way. Tests now count the blobs left on the relay with this.
@@ -0,0 +128,4 @@}#[test]fn junk_in_a_mailbox_is_dropped_and_never_shown() {F1 — test honesty, fixed. This test first posted its junk into a third client's welcome mailbox, so the client under test never saw it. It now posts junk before and after the real Welcome, into the right mailbox, and counts what is left on the relay.
@@ -34,0 +43,4 @@From then on each side posts to the other's mailbox. Names and post tokens travel **only insideMLS**. To the relay, the welcome mailbox is an ordinary mailbox.*(Changed 2026-11-14, approved by Mark, from "the invitee replies with their own KeyPackage": theF3 — protocol change. Section 4 said the invitee replies with its own KeyPackage and did not say where the reply goes. Here the invitee creates the group, so it needs no KeyPackage, and the first reply goes to a welcome mailbox derived from the link's secret. No new field on the relay; sections 5 and 8 unchanged. Approved by Mark, 2026-11-14.
Merged into
mainwith--no-ffas47ed9eef18(remote hash verified). The self-review is review 374 on this PR.Pull request closed