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

Add Mutable and Immutable Metadata #17

Merged
merged 18 commits into from
Feb 10, 2024

Conversation

keks
Copy link

@keks keks commented Jan 25, 2024

Note: This PR sits on top of PR #16

This PR adds support for metadata and immutable metadata extensions.


## Unknown extensions

Some extensions carry data, but don't alter the behaviour of the protocol (e.g. the application_id extension). OpenMLS allows the use of arbitrary such extensions in the group context, key packages and leaf nodes. Such extensions can be instantiated and retrieved through the use of the `UnknownExtension` struct and the `ExtensionType::Unknown` extension type. Such "unknown" extensions are handled transparently by OpenMLS, but can be used by the application, e.g. to have a group agree on pieces of data.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supporting arbitrary extensions in the GroupContext is not RFC compliant. Extensions in the GroupContext need to be supported by every member (ie, also have an indication of support in their capabilities field).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think that's not RFC compliant?
Indicating support in capabilities if of course required. But MLS does not restrict extensions. In the contrary, implementations are supposed to handle any (unknown) extension gracefully. That's what the grease mechanisms tries to ensure.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It says in section 13.4:

  • Clients must verify they support every extension in a GroupContext. Otherwise, it must refuse to join a group
  • Clients must verify every other client supports extensions in the GroupContext

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the documentation a mis-statement, or does openmls actually allow arbitrary GroupContext extensions?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It allows arbitrary group context extension, as long as all members support them.
As such, it is compliant with the RFC. The difference to other extensions is that the MLS implementation isn't aware of them. But it doesn't need to be as long as they are only relevant for the application. This way using especially private extension (0xF000 - 0xFFFF) becomes much easier, because the protocol implementation doesn't need to be made aware of them.
That said, @keks found an issue in the validation check for this (see openmls#1487). This is part of the larger effort of getting all validation checks into OpeMLS (see the validation label for some of them).

@neekolas neekolas merged commit 0da7dcb into xmtp:main Feb 10, 2024
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants