Skip to content

Merge upstream openmls/openmls main (65396d8) into main - #55

Merged
tylerhawkes merged 68 commits into
mainfrom
tyler/merge-upstream-main
Jul 22, 2026
Merged

tylerhawkes merged 68 commits into
mainfrom
tyler/merge-upstream-main

Conversation

@tylerhawkes

@tylerhawkes tylerhawkes commented Jul 22, 2026 •

Copy link
Copy Markdown

What

Merges upstream openmls/openmls main (65396d8) into our main. This is phase 1 of 2: it brings the fork current with ~2.5 months / 67 upstream commits. A follow-up storage replay PR restores the persisted layout on top of this.

Why merge instead of rebase

Our main is already a merge-based fork (f850fdf6 is itself a merge of upstream). Continuing to merge keeps history/provenance intact and future merges cheap, and it lets us isolate the storage-critical divergence into its own reviewable follow-up rather than burying it in a rebase.

Conflicts resolved (3 files)

All three are the same root cause — upstream's openmls#2060 extensions-draft-08 → extensions-draft rename landing next to our carries:

  • extensions/codec.rs — merged the metadata::Metadata import and kept the ImmutableMetadata (de)serialize arms; took the feature rename.
  • extensions/mod.rs — kept ImmutableMetadata in both enums, all four validity match-arms, and the immutable_metadata() accessor; took upstream's storage_tag numbering untouched.
  • mls_group/membership.rs — split the error import so UpdateGroupMembershipError stays unconditional (the ungated update_group_membership needs it) while EmptyInputError keeps upstream's virtual-clients-draft gate.

⚠️ Storage caveat — do not pin libxmtp to this commit

To keep this merge free of storage semantics, ImmutableMetadata is parked at the next free storage_tag (9 on ExtensionType, 8 on Extension), leaving upstream's Unknown=6 / Grease=7 / AppData=8 numbering undisturbed. That is not the layout existing XMTP groups are persisted with. The follow-up replay PR restores the fork's persisted numbering (ImmutableMetadata=6, shifting Unknown/Grease/AppData up), re-adds the variant-index lock tests, the tolerant trailing-field deserialization, and the portable usize→u64 encoding. Only that replay commit is safe to pin.

Verification

Compiles clean: default features, --features extensions-draft, and --tests --features extensions-draft,extensions-draft-test-dependencies.

Note

Merge upstream openmls main into main, adding virtual clients, targeted messages, and PQ ciphersuite support

  • Renames the extensions-draft-08 feature to extensions-draft across all crates, CI workflows, and storage backends.
  • Adds a virtual-clients-draft feature enabling virtual MLS clients: deterministic reuse-guard derivation via FF1-AES128 PRP, DualUseRatchet for own-message decryption, VC emulation epoch registration/derivation, and new storage APIs for emulation state, operation trees, and retained key material.
  • Adds a targeted-messages-draft feature with PSK-based HPKE encrypt/decrypt (hpke_open_psk, hpke_seal_psk_resolved_aad) and TargetedMessage wire format (value 6).
  • Adds a draft-ietf-mls-pq-ciphersuites feature with ML-KEM 768/1024 KEMs, ML-DSA 44/65/87 signature schemes, and corresponding ciphersuite variants in both libcrux and RustCrypto providers.
  • Replaces the actix-web delivery service with axum + tokio, removes GuardedRng in favor of an HMAC-DRBG (SHA-256), and bumps tls_codec to 0.5 and rand to 0.10.
  • Introduces UnresolvedAppDataCommit processing: commits with AppDataUpdate proposals are no longer staged immediately; callers must call stage_app_data_commit after computing updates.
  • Adds a serialization_helpers proc-macro crate providing Serialize/Deserialize derives with explicit #[storage_tag] discriminants for non-self-describing formats, fixing storage-tag stability for CredentialType, ExtensionType, Extension, ProposalType, and Proposal.
  • Own PrivateMessage echoes now surface as ProcessedMessageContent::OwnPrivateMessage instead of returning a decryption error; own pending commits surface as OwnPendingCommit.
  • Risk: ProcessedMessageContent has new variants (OwnPendingCommit, OwnPrivateMessage, UnresolvedAppDataCommit) that all match arms must handle; storage serialization tag behavior changes for several enums when 0-8-1-storage-format is not set.

Macroscope summarized 57367bb.

tylerhawkes and others added 30 commits May 4, 2026 10:35
This avoids /library/std/src/sys/time/unsupported.rs:35:9:
      time not implemented on this platform
…penmls#1963)

This PR is the first in a number of PRs towards implementing the [virtual clients draft](https://github.com/mlswg/mls-virtual-clients).

This PR adds the `virtual-clients-draft` feature flag. Guarded by that flag, it adds a two-stage mechanism that allows sending an application message and deleting the corresponding message secret in two separate steps.

This PR also generally enables clients to decrypt their own application messages by introducing a new `DualUseRatchet` in addition to the sender and decryption ratchets. The `DualUseRatchet` stores additional metadata to properly maintain the retention window for missed messages. In particular, ratchet secrets used for encryption shouldn't influence the retention of secrets for decryption of missed messages.
This PR allows clients to send and receive commits via a virtual client.

- Allow derivation of virtual-client specific secrets from emulation group and store them in the storage provider
- Allow creation of virtual client commits from those secrets and embed information in leaf component
- When receiving a virtual client commit sent by another emulation client, read embedded information, derive the correct secrets and process commit
- Extended storage interface for virtual client secrets 

External commits are not covered yet and will be handled in a follow-up.
…y default (openmls#2032)

- Run tests with only the MTI ciphersuite and the rustcrypto provider (add a PQ ciphersuite later)
- Introduce new `all-ciphersuites` feature flag that causes tests to run with all ciphersuites enabled
- Remove kat generation from test runs, hide them behind feature flag
- Introduce new nightly CI job that runs tests with all ciphersuites and all providers enabled
Add `process_message_with_app_data_updates` to `PublicGroup`, mirroring
the corresponding `MlsGroup` API so that public-group consumers can
process messages and observe application data updates.
* chore: fix broken documentation link

* enable js feature in [email protected]

* Revert "enable js feature in [email protected]"

This reverts commit ddd27b5.
* update dependencies

* upgrade rand to 0.10 in openmls

* remove unused rstest which pull [email protected]

* use [email protected] in ds-lib

* fix rand usage in tests

* fix compilation for wasm
… provider (openmls#2046)

Add post-quantum and P-384 ciphersuite support to the RustCrypto
provider, hidden behind the `draft-ietf-mls-pq-ciphersuites` feature
flag:

- `MLS_192_MLKEM1024_AES256GCM_SHA384_P384` (ML-KEM1024 + ECDSA P-384)
- `MLS_256_MLKEM1024_AES256GCM_SHA512_MLDSA87` (ML-KEM1024 + ML-DSA87)
- the remaining PQ ciphersuites supported by RustCrypto, plus the custom
  AIR_128_MLKEM768_AES256GCM_SHA384_Ed25519 ciphersuite

Wire ML-DSA 0.1 signing into basic_credential, propagate the feature
flag across crates, and adjust KAT/storage tests for the new
ciphersuites and ciphersuite-dependent hash lengths.
…penmls#2030)

This PR implements the reuse guard computation/derivation aspect of the virtual clients draft.

When sending a PrivateMessage, clients compute the reuse guard based on the emulation group state that was last used to update the group. This binding between higher-level group (ID) and emulation group epoch is stored in the storage provider.

The reuse guard is computed using a small-space PRP, which is pulled in as a dependency.
On the spec-level, computing the reuse guard in this way avoids reuse guard collisions between emulator clients.

Emulator clients that receive a PrivateMessage from a sibling emulator client in a higher-level group can reverse the reuse guard computation to determine which emulator client has sent the message. This change, along with the failure modes associated with this reversing operation required some threading of information through various function calls. I apologize for the churn.
…openmls#2031)

This PR is only relevant when using the `virtual-clients-draft` feature flag. It enable processing of external commits by sibling emulator clients.
* feat: add unchecked constructors to bypass KeyPackage/LeafNode validation

Add functions that allow assuming a `KeyPackage` and `LeafNode` are
already verified, constructing the validated types without re-running
signature/struct validation. Intended for callers that have verified
the input through another path.

* rename to into_unchecked

* add safety section in docs

* introduce unchecked-conversions flag and add unchecked conv for extensions
Add a new application PSK type and the corresponding proposal/staged
commit handling, allowing applications to inject their own pre-shared
keys into the key schedule.

Additionally rename `propose_external_psk` to `propose_pre_shared_key`
and `propose_external_psk_by_value` to `propose_pre_shared_key_by_value`.
The former methods are deprecated.
This PR switches virtual client operations from the 32byte PPRF to a more efficient SecretTree-style PR with one leaf per emulation group member plus on ratchet per operation type.

This PR defers to follow-up PRs:

- KeyPackage creation and Welcome processing
- `GenerationId` usage
- `VirtualClientAction` via SafeAAD
- Backwards-compat pass

Completely out of scope for now:

- Onboarding new emulator clients via state transfer
- Update proposals (in higher-level groups)
- Private handshake messages
)

Replace the actix-web stack with axum 0.8 + tokio, dropping a large
transitive dependency tree (actix-*, brotli, zstd, cookie, h2, ...).

Also remove unused dependencies.
The function should have been infallible from the beginning. This is a
remnant from openmls#2045.
Adds KeyPackage building and Welcome processing for virtual clients (behind `virtual-clients-draft`), so a virtual client can publish KeyPackages that a sibling recovers and uses to join higher-level groups.

- **Building:** `KeyPackageBuilder::build_vc_batch` allocates one `key_package` operation generation per batch, derives a per-KeyPackage seed (and from it the init and leaf encryption keys) for each index, and embeds an encrypted `DerivationInfo` in each leaf under `VC_COMPONENT_ID`. Returns a `VcKeyPackageBatch` with the generation and the built bundles.
- **Carrying between siblings:** `assemble_vc_key_package_upload` builds and retains the key material for a received KeyPackage upload message.
- **Welcome:** `find_and_validate_vc_own_leaf` locates the joined leaf by its derived encryption key, decrypts the leaf's `DerivationInfo`, and checks the embedded `(leaf_index, generation, key_package_index)` against the retained material.
So far it was only derived if the test-utils feature is set. The main
point of the In packages is not to prevent us from serializing received
messages, but from derializing into types we assume are verified.

When using these types in APIs in other projects, it's a little annoying
having to propagate or work around this In/Out split on the higher layer
as well. For example, when submitting an MlsMessage as an HTTP POST body
to a relay, if we only impl one of Serialize and Deserialize, then the
request type would have to be different on client on server, which
reduces code reuse.
Meant to do this in openmls#2071, but didn't actually. Do it now.
raphaelrobert and others added 21 commits July 7, 2026 17:18
* targeted messages

* fix docs

* address review comments

* apply spec changes

* add test vector from spec

* use internal padding size

* adjust comment

* one more parameter

* format
This PR allows emulator clients to process virtual client external commits from other emulator clients that are not resyncs, i.e. that result in the creation of a new group.

This PR also adds some wire format details that are required for a follow-up PR that allows emulator clients to process virtual client group creations by sibling emulator clients.
This PR allows emulator clients to locally bootstrap groups created by sibling emulator clients.
* better AppDataUpdate processing API

* adjust other crates

* fix merge

* fix test

* address one more review comment
* better AppDataUpdate processing API

* adjust other crates

* fix merge

* fix test

* process own private messages

* address review comments
Based on openmls#2092. Adds the same pattern of AppDataUpdate processing for PublicGroups.
…#2105)

Processing a commit checked for sibling VC material before checking
whether the commit matches the group's pending commit. Since an own
commit fanned back by the DS has the same shape as a sibling's commit
(Sender::Member(own_leaf) with VC derivation info on the path leaf),
load_vc_commit_material re-derived the operation secret the sender had
already consumed at send time and processing failed with
OperationGenerationConsumed, making OwnPendingCommit unreachable for
VC commits.

Check the pending-commit match first, so an own commit echo surfaces
as OwnPendingCommit without touching the operation secret tree.
Sibling commits never match the pending commit's confirmation tag and
still take the VC staging path.
confirm_message deleted the given generation from the current epoch's
own application ratchet. If the group advanced an epoch between
create_unconfirmed_message and the confirmation, it either silently
no-oped, retaining the old secret forever, or deleted a different
message's still-unconfirmed secret that shared the generation number
in the new epoch, making a lost race against a sibling undecryptable.

confirm_message now takes the creation epoch, carried on
UnconfirmedMessage, and deletes exactly the secret its create call
retained, or nothing: aged-out epochs and already-consumed generations
are no-op successes, future epochs are rejected. The new
confirm_handshake_message applies the same semantics to the handshake
ratchet, giving retained own proposal and commit secrets a cleanup
path. Proposals and commits share the per-epoch handshake ratchet, so
one endpoint covers both.
The newly added `VcKeyPackageBatchBuilder` allows to build heterogeneous
batches of key packages. Build the batch on `finalize`. Dropping the
builder without calling `finalize` burns no generation.
* early detection of ciphersuite support

* a few fixes
…enmls#2107)

Handshake messages framed as PrivateMessages retained their own encryption secret but discarded the ratchet generation, so applications could not confirm them, and no GenerationId was derived from the handshake ratchet.

encrypt() now derives a GenerationId for proposals and commits when the group is bound to an emulation epoch. content_to_mls_message returns the framed message together with HandshakeConfirmationData (epoch, generation, generation id) for ciphertext-framed messages. CommitBuilder surfaces it via CommitMessageBundle::confirmation() and the new propose_unconfirmed mirrors propose() while returning the confirmation data. Existing propose_* signatures are unchanged. Propose is now re-exported, making the generic propose API publicly usable.
- tls_codec to 0.5
- libcrux and hpke to latest releases
- rand to 0.10 for libcrux
- use hmac-drbg in libcrux provider
…enmls#2115)

This commit introduces a new concept `ImportSecret` from the amended
virtual client draft. The `ImportSecret` operation imports a secret from
the emulation group's ciphersuite into the target ciphersuite. This
operation must be performed even when the ciphersuites are the same.

This resolves an ambiguity in with respect to which ciphersuite secrets
are derived that are used in the context of virtual client.
…penmls#2119)

When registering an emulation epoch, we store the epoch id along with
the epoch it was registered for in the storage for the group. Next call
of `register_vc_emulation_epoch` returns the same epoch id if the epoch
of the group did not advance.

The data is deleted when the group is deleted or the member is removed.
* build(ci): increase wasm size limit check to 2 MB in CI
* also increase the gzip limit
@tylerhawkes
tylerhawkes force-pushed the tyler/merge-upstream-main branch from 01c8f5a to 57367bb Compare July 22, 2026 19:34
@macroscopeapp

macroscopeapp Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Macroscope skipped reviewing this pull request. Per-review cost limit exceeded (workspace setting).

This review would cost an estimated $34.12, which exceeds your per-review limit of $10.00.

The top 3 files driving up this estimate:

File Size Estimate
openmls/src/group/mls_group/processing.rs 48.52KB $2.43
openmls/src/group/mls_group/creation.rs 43.36KB $2.17
openmls/src/group/mls_group/staged_commit.rs 33.77KB $1.69

Tip

To get this pull request reviewed, you can:

  1. Comment @macroscope-app on this PR to request a manual review (monthly spend limits still apply).
  2. Exclude the file(s) above from review by adding a pattern to your .macroscope/ignore.md — note that creating this file replaces Macroscope's built-in default ignores rather than extending them.
  3. Raise your cost limit in your workspace billing settings.

Turn off this reminder going forward

@macroscopeapp

macroscopeapp Bot commented Jul 22, 2026

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

Unable to check for correctness in 57367bb. CODEOWNERS file was modified by a non-owner — requires human review

You can customize Macroscope's approvability policy. Learn more.

@tylerhawkes
tylerhawkes merged commit 500bd9f into main Jul 22, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.