| Internet-Draft | MLS | October 2021 |
| Barnes, et al. | Expires 14 April 2022 | [Page] |
Messaging applications are increasingly making use of end-to-endsecurity mechanisms to ensure that messages are only accessible tothe communicating endpoints, and not to any servers involved in deliveringmessages. Establishing keys to provide such protections ischallenging for group chat settings, in which more than twoclients need to agree on a key but may not be online at the sametime. In this document, we specify a key establishmentprotocol that provides efficient asynchronous group key establishmentwith forward secrecy and post-compromise security for groupsin size ranging from two to thousands.¶
This note is to be removed before publishing as an RFC.¶
Source for this draft and an issue tracker can be found athttps://github.com/mlswg/mls-protocol.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is athttps://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 14 April 2022.¶
Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
DISCLAIMER: This is a work-in-progress draft of MLS and has not yetseen significant security analysis. It should not be used as a basisfor building production systems.¶
RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH The source forthis draft is maintained in GitHub. Suggested changes should besubmitted as pull requests at https://github.com/mlswg/mls-protocol.Instructions are on that page as well. Editorial changes can bemanaged in GitHub, but any substantive change should be discussed onthe MLS mailing list.¶
A group of users who want to send each other encrypted messages needsa way to derive shared symmetric encryption keys. For two parties,this problem has been studied thoroughly, with the Double Ratchetemerging as a common solution[doubleratchet][signal].Channels implementing the Double Ratchet enjoy fine-grained forward secrecyas well as post-compromise security, but are nonetheless efficientenough for heavy use over low-bandwidth networks.¶
For a group of size greater than two, a common strategy is tounilaterally broadcast symmetric "sender" keys over existing sharedsymmetric channels, and then for each member to send messages to thegroup encrypted with their own sender key. Unfortunately, while thisimproves efficiency over pairwise broadcast of individual messages andprovides forward secrecy (with the addition of a hash ratchet),it is difficult to achieve post-compromise security withsender keys. An adversary who learns a sender key can often indefinitely andpassively eavesdrop on that member's messages. Generating anddistributing a new sender key provides a form of post-compromisesecurity with regard to that sender. However, it requirescomputation and communications resources that scale linearly withthe size of the group.¶
In this document, we describe a protocol based on tree structuresthat enable asynchronous group keying with forward secrecy andpost-compromise security. Based on earlier work on "asynchronousratcheting trees"[art], the protocol presented here uses anasynchronous key-encapsulation mechanism for tree structures.This mechanism allows the members of the group to derive and updateshared keys with costs that scale as the log of the group size.¶
RFC EDITOR PLEASE DELETE THIS SECTION.¶
draft-12¶
draft-11¶
draft-10¶
draft-09¶
draft-08¶
draft-07¶
draft-06¶
draft-05¶
draft-04¶
draft-03¶
draft-02¶
draft-01¶
draft-00¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT","SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and"OPTIONAL" in this document are to be interpreted as described inBCP 14[RFC2119][RFC8174] when, and only when, they appear in allcapitals, as shown here.¶
An agent that uses this protocol to establish shared cryptographicstate with other clients. A client is defined by thecryptographic keys it holds.¶
A collection of clients with shared cryptographic state.¶
A client that is included in the shared state of a group, hencehas access to the group's secrets.¶
A signed object describing a client's identity and capabilities, and includinga hybrid public-key encryption (HPKE[I-D.irtf-cfrg-hpke]) public key thatcan be used to encrypt to that client.¶
A key package that is prepublished by a client, which other clients can use tointroduce the client to a new group.¶
A signing key pair used to authenticate the sender of a message.¶
Terminology specific to tree computations is described inSection 5.¶
We use the TLS presentation language[RFC8446] todescribe the structure of protocol messages.¶
This protocol is designed to execute in the context of a Service Provider (SP)as described in[I-D.ietf-mls-architecture]. In particular, we assumethe SP provides the following services:¶
The goal of this protocol is to allow a group of clients to exchangeconfidential and authenticated messages. It does so by deriving a sequenceof secrets and keys known only to members. Those should be secret against anactive network adversary and should have both forward secrecy andpost-compromise security with respect to compromise of any members.¶
We describe the information stored by each client asstate, which includesboth public and private data. An initial state is set up by a group creator,which is a group containing only itself. The creator then sendsAddproposals for each client in the initial set of members, followed by aCommitmessage which incorporates all of theAdds into the group state. Finally, thegroup creator generates aWelcome message corresponding to the Commit andsends this directly to all the new members, who can use the informationit contains to set up their own group state and derive a sharedsecret. Members exchange Commit messages for post-compromise security, to add newmembers, and to remove existing members. These messages produce new sharedsecrets which are causally linked to their predecessors, forming a logicalDirected Acyclic Graph (DAG) of states.¶
The protocol algorithms we specify here follow. Each algorithm specifiesboth (i) how a client performs the operation and (ii) how other clientsupdate their state based on it.¶
There are three major operations in the lifecycle of a group:¶
Each of these operations is "proposed" by sending a message of the correspondingtype (Add / Update / Remove). The state of the group is not changed, however,until a Commit message is sent to provide the group with fresh entropy. In thissection, we show each proposal being committed immediately, but in more advanceddeployment cases an application might gather several proposals beforecommitting them all at once.¶
Before the initialization of a group, clients publish InitKeys (as KeyPackageobjects) to a directory provided by the Service Provider.¶
GroupA B C Directory Channel| | | | || KeyPackageA | | | ||------------------------------------------------->| || | | | || | KeyPackageB | | || |-------------------------------->| || | | | || | | KeyPackageC | || | |--------------->| || | | | |¶
When a client A wants to establish a group with B and C, it first initializes agroup state containing only itself and downloads KeyPackages for B and C. Foreach member, A generates an Add and Commit message adding that member, andbroadcasts them to the group. It also generates a Welcome message and sends thisdirectly to the new member (there's no need to send it to the group). Only afterA has received its Commit message back from the server does it update its stateto reflect the new member's addition.¶
Upon receiving the Welcome message, the new member will be able to read and sendnew messages to the group. Messages received before the client has joined thegroup are ignored.¶
GroupA B C Directory Channel| | | | || KeyPackageB, KeyPackageC | ||<-------------------------------------------| ||state.init() | | | || | | | || | | | Add(A->AB) || | | | Commit(Add) ||--------------------------------------------------------------->|| | | | || Welcome(B) | | | ||------------->|state.join() | | || | | | || | | | Add(A->AB) || | | | Commit(Add) ||<---------------------------------------------------------------||state.add(B) | | | || | | | || | | | || | | | Add(AB->ABC) || | | | Commit(Add) ||--------------------------------------------------------------->|| | | | || | Welcome(C) | | ||---------------------------->|state.join() | || | | | || | | | Add(AB->ABC) || | | | Commit(Add) ||<---------------------------------------------------------------||state.add(C) |<------------------------------------------------|| |state.add(C) | | || | | | |¶
Subsequent additions of group members proceed in the same way. Anymember of the group can download a KeyPackage for a new clientand broadcast an Add message that the current group can use to updatetheir state, and a Welcome message that the new client can use toinitialize its state and join the group.¶
To enforce the forward secrecy and post-compromise security of messages,each member periodically updates their leaf secret.Any member can update this information at any time by generating a freshKeyPackage and sending an Update message followed by a Commit message.Once all members have processed both, the group's secrets will be unknown to anattacker that had compromised the sender's prior leaf secret.¶
Update messages should be sent at regular intervals of time as long as the groupis active, and members that don't update should eventually be removed from thegroup. It's left to the application to determine an appropriate amount of timebetween Updates.¶
GroupA B ... Z Directory Channel| | | | || | Update(B) | | || |------------------------------------------->|| Commit(Upd) | | | ||---------------------------------------------------------->|| | | | || | | | Update(B) || | | | Commit(Upd) ||<----------------------------------------------------------||state.upd(B) |<-------------------------------------------|| |state.upd(B) |<----------------------------|| | |state.upd(B) | || | | | |¶
Members are removed from the group in a similar way.Any member of the group can send a Remove proposal followed by aCommit message, which adds new entropy to the group statethat's known to all except the removed member.Note that this does not necessarily imply that any memberis actually allowed to evict other members; groups canenforce access control policies on top of thesebasic mechanism.¶
GroupA B ... Z Directory Channel| | | | || | | Remove(B) | || | | Commit(Rem) | || | |---------------------------->|| | | | || | | | Remove(B) || | | | Commit(Rem) ||<----------------------------------------------------------||state.rem(B) | |<----------------------------|| | |state.rem(B) | || | | | || | | | |¶
The protocol uses "ratchet trees" for deriving shared secrets amonga group of clients.¶
Trees consist ofnodes. A node is aleaf if it has no children, and aparent otherwise; note that allparents in our trees have preciselytwo children, aleft child and aright child. A node is therootof a tree if it has no parents, andintermediate if it has bothchildren and parents. Thedescendants of a node are that node, itschildren, and the descendants of its children, and we say a treecontains a node if that node is a descendant of the root of thetree. Nodes aresiblings if they share the same parent.¶
Asubtree of a tree is the tree given by the descendants of anynode, thehead of the subtree. Thesize of a tree or subtree is thenumber of leaf nodes it contains. For a given parent node, itsleftsubtree is the subtree with its left child as head (respectivelyright subtree).¶
All trees used in this protocol are left-balanced binary trees. Abinary tree isfull (andbalanced) if its size is a power oftwo and for any parent node in the tree, its left and right subtreeshave the same size.¶
A binary tree isleft-balanced if for everyparent, either the parent is balanced, or the left subtree of thatparent is the largest full subtree that could be constructed fromthe leaves present in the parent's own subtree.Given a list ofn items, there is a unique left-balancedbinary tree structure with these elements as leaves.¶
(Note that left-balanced binary trees are the same structure that isused for the Merkle trees in the Certificate Transparency protocol[I-D.ietf-trans-rfc6962-bis].)¶
Thedirect path of a root is the empty list, and of any other nodeis the concatenation of that node's parent along with the parent's direct path.Thecopath of a node is the node's sibling concatenated with the list ofsiblings of all the nodes in its direct path, excluding the root.¶
For example, in the below tree:¶
7 = root ______|______ / \ 3 11 __|__ __| / \ / \ 1 5 9 | / \ / \ / \ |A B C D E F G 1 1 10 1 2 3 4 5 6 7 8 9 0 1 2¶
Each node in the tree is assigned anindex, starting at zero andrunning from left to right. A node is a leaf node if and only if ithas an even index. The node indices for the nodes in the above treeare as follows:¶
A tree withn leaves has2*n - 1 nodes. For example, the above tree has 7leaves (A, B, C, D, E, F, G) and 13 nodes. The root of a tree withn leavesis always the node with index2^k - 1, wherek is the largest number suchthat2^k < n.¶
A particular instance of a ratchet tree is defined by the same parameters thatdefine an instance of HPKE, namely:¶
DeriveKeyPair function thatcreates a key pair for the KEM from a symmetric secret¶Extract andExpand functions¶Each node in a ratchet tree contains up to five values:¶
The conditions under which each of these values must or must not bepresent are laid out inSection 5.3.¶
A node in the tree may also beblank, indicating that no value ispresent at that node. Theresolution of a node is an ordered listof non-blank nodes that collectively cover all non-blank descendantsof the node.¶
For example, consider the following tree, where the "_" characterrepresents a blank node and unmerged leaves are indicated in squarebrackets:¶
_ __|__ / \ _ 5[C] / \ / \A _ C D0 1 2 3 4 5 6¶
In this tree, we can see all of the above rules in play:¶
Every node, regardless of whether the node is blank or populated, hasa correspondinghash that summarizes the contents of the subtreebelow that node. The rules for computing these hashes are describedinSection 7.6.¶
We generally assume that each participant maintains a complete andup-to-date view of the public state of the group's ratchet tree,including the public keys for all nodes and the credentialsassociated with the leaf nodes.¶
No participant in an MLS group knows the private key associated withevery node in the tree. Instead, each member is assigned to a leaf of the tree,which determines the subset of private keys it knows. Thecredential stored at that leaf is one provided by the member.¶
In particular, MLS maintains the members' views of the tree in sucha way as to maintain thetree invariant:¶
The private key for a node in the tree is known to a member ofthe group only if that member's leaf is a descendant ofthe node.¶
In other words, if a node is not blank, then it holds a public key.The corresponding private key is known only to members occupyingleaves below that node.¶
The reverse implication is not true: A member may not know the private keys ofall the intermediate nodes they're below. Such a member has anunmerged leaf.Encrypting to an intermediate node requires encrypting to the node's public key,as well as the public keys of all the unmerged leaves below it. A leaf isunmerged when it is first added, because the process of adding the leaf does notgive it access to all of the nodes above it in the tree. Leaves are "merged" asthey receive the private keys for nodes, as described inSection 5.4.¶
A member of an MLS group advances the key schedule to provide forward secrecyand post-compromise security by providing the group with fresh key material tobe added into the group's shared secret.To do so, one member of the group generates fresh keymaterial, applies it to their local tree state, and then sends this key materialto other members in the group via an UpdatePath message (seeSection 7.8) .All other group members then apply the key material in the UpdatePath to theirown local tree state to derive the group's now-updated shared secret.¶
To begin, the generator of the UpdatePath updates its leafKeyPackage and its direct path to the root with new secret values. TheHPKE leaf public key within the KeyPackage MUST be derived from a freshlygenerated HPKE secret key to provide post-compromise security.¶
The generator of the UpdatePath starts by sampling a fresh random value called"leaf_secret", and uses the leaf_secret to generate their leaf HPKE key pair(seeSection 7) and to seed a sequence of "path secrets", one for eachancestor of its leaf. In this setting,path_secret[0] refers to the node directly above the leaf,path_secret[1] for its parent, and so on. At each step, the pathsecret is used to derive a new secret value for the correspondingnode, from which the node's key pair is derived.¶
leaf_node_secret = DeriveSecret(leaf_secret, "node")path_secret[0] = DeriveSecret(leaf_secret, "path")path_secret[n] = DeriveSecret(path_secret[n-1], "path")node_secret[n] = DeriveSecret(path_secret[n], "node")leaf_priv, leaf_pub = KEM.DeriveKeyPair(leaf_node_secret)node_priv[n], node_pub[n] = KEM.DeriveKeyPair(node_secret[n])¶
For example, suppose there is a group with four members, with C an unmerged leafat node 5:¶
3 __|__ / \ 1 5[C] / \ / \A B C D0 1 2 3 4 5 6¶
If member B subsequently generates an UpdatePath based on a secret"leaf_secret", then it would generate the following sequenceof path secrets:¶
path_secret[1] --> node_secret[1] --> node_priv[1], node_pub[1] ^ |path_secret[0] --> node_secret[0] --> node_priv[0], node_pub[0] ^ |leaf_secret --> leaf_node_secret --> leaf_priv, leaf_pub ~> leaf_key_package¶
After applying the UpdatePath, the tree will have the following structure, wherelp andnp[i] represent the leaf_priv and node_priv values generated asdescribed above:¶
np[1] -> 3 __|__ / \np[0] -> 1 5[C] / \ / \ A B C D ^ | lp 0 1 2 3 4 5 6¶
After performing these operations, the generator of the UpdatePath MUSTdelete the leaf_secret.¶
After generating fresh key material and applying it to ratchet forward theirlocal tree state as described in the prior section, the generator must broadcastthis update to other members of the group in a Commit message, whoapply it to keep their local views of the tree insync with the sender's. More specifically, when a member commits a change tothe tree (e.g., to add or remove a member), it transmits an UpdatePathcontaining a set of public keys and encrypted path secretsfor intermediate nodes in the direct path of its leaf. Theother members of the group use these values to updatetheir view of the tree, aligning their copy of the tree to thesender's.¶
An UpdatePath containsthe following information for each node in the direct path of thesender's leaf, including the root:¶
The path secret value for a given node is encrypted for the subtreecorresponding to the parent's non-updated child, that is, the childon the copath of the sender's leaf node.There is one encryption of the path secret to each public key in the resolutionof the non-updated child.¶
The recipient of an UpdatePath processes it with the following steps:¶
Compute the updated path secrets.¶
Merge the updated path secrets into the tree.¶
For all updated nodes,¶
For example, in order to communicate the example update described inthe previous section, the sender would transmit the followingvalues:¶
| Public Key | Ciphertext(s) |
|---|---|
| node_pub[1] | E(pk(5), path_secret[1]), E(pk(C), path_secret[1]) |
| node_pub[0] | E(pk(A), path_secret[0]) |
In this table, the value pk(ns[X]) represents the public keyderived from the node secret X, whereas pk(X) represents the public leaf keyfor user X. The value E(K, S) representsthe public-key encryption of the path secret S to thepublic key K (using HPKE).¶
After processing the update, each recipient MUST delete outdated key material,specifically:¶
Each MLS session uses a single ciphersuite that specifies thefollowing primitives to be used in group key computations:¶
MLS uses draft-08 of HPKE[I-D.irtf-cfrg-hpke] for public-key encryption.TheDeriveKeyPair function associated to the KEM for the ciphersuite mapsoctet strings to HPKE key pairs.¶
Ciphersuites are represented with the CipherSuite type. HPKE public keysare opaque values in a format defined by the underlyingprotocol (see the Cryptographic Dependencies section of the HPKE specification for moreinformation).¶
opaque HPKEPublicKey<1..2^16-1>;¶
The signature algorithm specified in the ciphersuite is the mandatory algorithmto be used for signatures in MLSPlaintext and the tree signatures. It MUST bethe same as the signature algorithm specified in the credential field of theKeyPackage objects in the leaves of the tree (including the InitKeysused to add new members).¶
The ciphersuites are defined in sectionSection 16.1.¶
A member of a group authenticates the identities of other participants by meansof credentials issued by some authentication system, like a PKI. Each type ofcredential MUST express the following data in the context of the group it isused with:¶
Credentials MAY also include information that allows a relying partyto verify the identity / signing key binding.¶
Additionally, Credentials SHOULD specify the signature scheme corresponding toeach contained public key.¶
// See RFC 8446 and the IANA TLS SignatureScheme registryuint16 SignatureScheme;// See IANA registry for registered valuesuint16 CredentialType;struct { opaque identity<0..2^16-1>; SignatureScheme signature_scheme; opaque signature_key<0..2^16-1>;} BasicCredential;struct { opaque cert_data<0..2^16-1>;} Certificate;struct { CredentialType credential_type; select (Credential.credential_type) { case basic: BasicCredential; case x509: Certificate chain<1..2^32-1>; };} Credential;¶A BasicCredential is a raw, unauthenticated assertion of an identity/keybinding. The format of the key in thepublic_key field is defined by therelevant ciphersuite: the group ciphersuite for a credential in a ratchet tree,the KeyPackage ciphersuite for a credential in a KeyPackage object.¶
For X509Credential, each entry in the chain represents a single DER-encodedX509 certificate. The chain is ordered such that the first entry (chain[0])is the end-entity certificate and each subsequent certificate in the chainMUST be the issuer of the previous certificate. The algorithm for thepublic_key in the end-entity certificate MUST match the relevantciphersuite.¶
For ciphersuites using Ed25519 or Ed448 signature schemes, the public key is inthe format specified[RFC8032]. For ciphersuites using ECDSA with the NISTcurves P-256 or P-521, the public key is the output of the uncompressedElliptic-Curve-Point-to-Octet-String conversion according to[SECG].¶
The signatures used throughout this document are encoded as specified in[RFC8446]. In particular, ECDSA signatures are DER-encoded and EdDSA signaturesare defined as the concatenation ofr ands as specified in[RFC8032].¶
Note that each new credential that has not already been validatedby the application MUST be validated against the AuthenticationService.¶
In order to facilitate asynchronous addition of clients to agroup, it is possible to pre-publish key packages thatprovide some public information about a user. KeyPackagestructures provide information about a client that any existingmember can use to add this client to the group asynchronously.¶
A KeyPackage object specifies a ciphersuite that the client supports, as well asproviding a public key that others can use for key agreement.¶
Theidentity arising from the credential, together with theendpoint_id inthe KeyPackage serve to uniquely identify a client in a group.¶
When used as InitKeys, KeyPackages are intended to be used only once and SHOULD NOTbe reused except in case of last resort. (SeeSection 15.4).Clients MAY generate and publish multiple InitKeys tosupport multiple ciphersuites.¶
KeyPackages contain a public key chosen by the client, which theclient MUST ensure uniquely identifies a given KeyPackage objectamong the set of KeyPackages created by this client.¶
The value for hpke_init_key MUST be a public key for the asymmetricencryption scheme defined by cipher_suite. The whole structureis signed using the client's signature key. A KeyPackage objectwith an invalid signature field MUST be considered malformed.The input to the signature computation comprises all of the fieldsexcept for the signature field.¶
enum { reserved(0), mls10(1), (255)} ProtocolVersion;// See IANA registry for registered valuesuint16 ExtensionType;struct { ExtensionType extension_type; opaque extension_data<0..2^32-1>;} Extension;struct { ProtocolVersion version; CipherSuite cipher_suite; HPKEPublicKey hpke_init_key; opaque endpoint_id<0..255>; Credential credential; Extension extensions<8..2^32-1>; opaque signature<0..2^16-1>;} KeyPackage;¶KeyPackage objects MUST contain at least two extensions, one of typecapabilities, and one oftypelifetime. Thecapabilities extensionallow MLS session establishment to be safe from downgrade attacks on theparameters described (as discussed inSection 10), while still only advertisingone version / ciphersuite per KeyPackage.¶
As theKeyPackage is a structure which is stored in the RatchetTree and updated depending on the evolution of this tree, eachmodification of its content MUST be reflected by a change of itssignature. This allow other members to control the validity of the KeyPackageat any time and in particular in the case of a newcomer joining the group.¶
When it is necessary to refer to a specific KeyPackage, protocol messagesincorporate a KeyPackageID:¶
struct { opaque key_package_hash<0..255>;} KeyPackageID¶
This value is the hash of the KeyPackage, using the hash indicated by thecipher_suite field. KeyPackage hashes are used in a Welcome message toindicate which KeyPackage is being used to include the new member. Since membersof a group are uniquely identified by their leaf KeyPackages, messages within agroup use the hash of this key package to refer to group members, e.g., tospecify the target of a Remove proposal or the signer of an MLSPlaintext.¶
Thecapabilities extension indicates what protocol versions, ciphersuites,protocol extensions, and non-default proposal types are supported by a client.Proposal types defined in this document are considered "default" and thus neednot be listed.¶
struct { ProtocolVersion versions<0..255>; CipherSuite ciphersuites<0..255>; ExtensionType extensions<0..255>; ProposalType proposals<0..255>;} Capabilities;¶This extension MUST be always present in a KeyPackage. Extensions that appearin theextensions field of a KeyPackage MUST be included in theextensionsfield of thecapabilities extension.¶
Thelifetime extension represents the times between which clients willconsider a KeyPackage valid. This time is represented as an absolute time,measured in seconds since the Unix epoch (1970-01-01T00:00:00Z). A client MUSTNOT use the data in a KeyPackage for any processing before thenot_beforedate, or after thenot_after date.¶
uint64 not_before;uint64 not_after;¶
Applications MUST define a maximum total lifetime that is acceptable for aKeyPackage, and reject any KeyPackage where the total lifetime is longer thanthis duration.¶
This extension MUST always be present in a KeyPackage.¶
Within MLS, a KeyPackage is identified by its hash (see, e.g.,Section 11.2.2). Theexternal_key_id extension allows applications to addan explicit, application-defined identifier to a KeyPackage.¶
opaque external_key_id<0..2^16-1>;¶
Theparent_hash extension carries information to authenticate the structure ofthe tree, as described below.¶
opaque parent_hash<0..255>;¶
Consider a ratchet tree with a parent node P and children V and S. The parent hashof P changes whenever anUpdatePath object is applied to the ratchet tree alonga path traversing node V (and hence also P). The new "Parent Hash of P (with Co-PathChild S)" is obtained by hashing P'sParentHashInput struct using the resolutionof S to populate theoriginal_child_resolution field. This way, P's Parent Hashfixes the new HPKE public keys of all nodes on the path from P to the root.Furthermore, for each such key PK the hash also binds the set of HPKE public keysto which PK's secret key was encrypted in the commit packet that anounced theUpdatePath object.¶
struct { HPKEPublicKey public_key; opaque parent_hash<0..255>; HPKEPublicKey original_child_resolution<0..2^32-1>;} ParentHashInput;¶The Parent Hash of P with Co-Path Child S is the hash of aParentHashInput objectpopulated as follows. The fieldpublic_key contains the HPKE public key of P. If Pis the root, thenparent_hash is set to a zero-length octet string.Otherwiseparent_hash is the Parent Hash of P's parent with P's sibling as theco-path child.¶
Finally,original_child_resolution is the array ofHPKEPublicKey values of thenodes in the resolution of S but with theunmerged_leaves of P omitted. Forexample, in the ratchet tree depicted inSection 5.2 theParentHashInput of node 5 with co-path child 4 would contain an emptyoriginal_child_resolution since 4's resolution includes only itself but 4 is alsoan unmerged leaf of 5. Meanwhile, theParentHashInput of node 5 with co-path child6 has an array with one element in it: the HPKE public key of 6.¶
The Parent Hash of P appears in three types of structs. If V is itself a parent nodethen P's Parent Hash is stored in theparent_hash fields of both V'sParentHashInput struct and V'sParentNode struct. (TheParentNode struct isused to encapsulate all public information about V that must be conveyed to a newmember joining the group as well as to define the Tree Hash of node V.)¶
If, on the other hand, V is a leaf and its KeyPackage contains theparent_hashextension then the Parent Hash of P (with V's sibling as co-path child) is stored inthat field. In particular, the extension MUST be present in theleaf_key_packagefield of anUpdatePath object. (This way, the signature of such a KeyPackage alsoserves to attest to which keys the group member introduced into the ratchet tree andto whom the corresponding secret keys were sent. This helps prevent malicious insidersfrom constructing artificial ratchet trees with a node V whose HPKE secret key isknown to the insider yet where the insider isn't assigned a leaf in the subtree rootedat V. Indeed, such a ratchet tree would violate the tree invariant.)¶
To this end, when processing a Commit message clients MUST recompute theexpected value ofparent_hash for the committer's new leaf and verify that itmatches theparent_hash value in the suppliedleaf_key_package. Moreover, whenjoining a group, new members MUST authenticate each non-blank parent node P. A parentnode P is authenticated by performing the following check:¶
The left-child recursion under the right child of P is necessary because the expansion ofthe tree to the right due to Add proposals can cause blank nodes to be interposedbetween a parent node and its right child.¶
To allow group members to verify that they agree on the public cryptographic stateof the group, this section defines a scheme for generating a hash value (calledthe "tree hash") that represents the contents of the group's ratchet tree and themembers' KeyPackages. The tree hash of a tree is the tree hash of its root node,which we define recursively, starting with the leaves.¶
As some nodes may be blank while others contain data we use the following structto include data if present.¶
struct { uint8 present; select (present) { case 0: struct{}; case 1: T value; }} optional<T>;¶The tree hash of a leaf node is the hash of leaf'sLeafNodeHashInput object whichmight include a Key Package depending on whether or not it is blank.¶
struct { uint32 node_index; optional<KeyPackage> key_package;} LeafNodeHashInput;¶Now the tree hash of any non-leaf node is recursively defined to be the hash ofitsParentNodeTreeHashInput. This includes an optionalParentNodeobject depending on whether the node is blank or not.¶
struct { HPKEPublicKey public_key; opaque parent_hash<0..255>; uint32 unmerged_leaves<0..2^32-1>;} ParentNode;struct { uint32 node_index; optional<ParentNode> parent_node; opaque left_hash<0..255>; opaque right_hash<0..255>;} ParentNodeTreeHashInput;¶Theleft_hash andright_hash fields hold the tree hashes of the node'sleft and right children, respectively.¶
Each member of the group maintains a GroupContext object thatsummarizes the state of the group:¶
struct { opaque group_id<0..255>; uint64 epoch; opaque tree_hash<0..255>; opaque confirmed_transcript_hash<0..255>; Extension extensions<0..2^32-1>;} GroupContext;¶The fields in this state have the following semantics:¶
group_id field is an application-defined identifier for thegroup.¶epoch field represents the current version of the group key.¶tree_hash field contains a commitment to the contents of thegroup's ratchet tree and the credentials for the members of thegroup, as described inSection 7.6.¶confirmed_transcript_hash field contains a running hash overthe messages that led to this state.¶When a new member is added to the group, an existing member of thegroup provides the new member with a Welcome message. The Welcomemessage provides the information the new member needs to initializeits GroupContext.¶
Different changes to the group will have different effects on the group state.These effects are described in their respective subsections ofSection 11.1.The following general rules apply:¶
group_id field is constant¶epoch field increments by one for each Commit message thatis processed¶tree_hash is updated to represent the current tree andcredentials¶confirmed_transcript_hash is updated with the data for anMLSPlaintext message encoding a Commit message in two parts:¶struct { WireFormat wire_format; opaque group_id<0..255>; uint64 epoch; Sender sender; opaque authenticated_data<0..2^32-1>; ContentType content_type = commit; Commit commit; opaque signature<0..2^16-1>;} MLSPlaintextCommitContent;struct { optional<MAC> confirmation_tag;} MLSPlaintextCommitAuthData;interim_transcript_hash_[0] = ""; // zero-length octet stringconfirmed_transcript_hash_[n] = Hash(interim_transcript_hash_[n] || MLSPlaintextCommitContent_[n]);interim_transcript_hash_[n+1] = Hash(confirmed_transcript_hash_[n] || MLSPlaintextCommitAuthData_[n]);¶Thus theconfirmed_transcript_hash field in a GroupContext object represents atranscript over the whole history of MLSPlaintext Commit messages, up to theconfirmation tag field in the current MLSPlaintext message. The confirmationtag is then included in the transcript for the next epoch. The interimtranscript hash is computed by new members using the confirmation tag in theGroupInfo struct, and enables existing members to incorporate a Commit messageinto the transcript without having to store the whole MLSPlaintextCommitAuthDatastructure.¶
As shown above, when a new group is created, theinterim_transcript_hash fieldis set to the zero-length octet string.¶
As described inSection 11.2, each MLS Commit message may optionallytransmit a KeyPackage leaf and node values along its direct path.The path contains a public key and encrypted secret value for allintermediate nodes in the path above the leaf. The path is orderedfrom the closest node to the leaf to the root; each node MUST be theparent of its predecessor.¶
struct { opaque kem_output<0..2^16-1>; opaque ciphertext<0..2^16-1>;} HPKECiphertext;struct { HPKEPublicKey public_key; HPKECiphertext encrypted_path_secret<0..2^32-1>;} UpdatePathNode;struct { KeyPackage leaf_key_package; UpdatePathNode nodes<0..2^32-1>;} UpdatePath;¶For eachUpdatePathNode, the resolution of the corresponding copath node MUSTbe filtered by removing all new leaf nodes added as part of this MLS Commitmessage. The number of ciphertexts in theencrypted_path_secret vector MUST beequal to the length of the filtered resolution, with each ciphertext being theencryption to the respective resolution node.¶
The HPKECiphertext values are computed as¶
kem_output, context = SetupBaseS(node_public_key, group_context)ciphertext = context.Seal("", path_secret)¶wherenode_public_key is the public key of the node that the pathsecret is being encrypted for, group_context is the current GroupContext objectfor the group, and the functionsSetupBaseS andSeal are defined according to[I-D.irtf-cfrg-hpke].¶
Decryption is performed in the corresponding way, using the privatekey of the resolution node and the ephemeral public keytransmitted in the message.¶
Group keys are derived using theExtract andExpand functions from the KDFfor the group's ciphersuite, as well as the functions defined below:¶
ExpandWithLabel(Secret, Label, Context, Length) = KDF.Expand(Secret, KDFLabel, Length)Where KDFLabel is specified as:struct { uint16 length = Length; opaque label<7..255> = "mls10 " + Label; opaque context<0..2^32-1> = Context;} KDFLabel;DeriveSecret(Secret, Label) = ExpandWithLabel(Secret, Label, "", KDF.Nh)¶The valueKDF.Nh is the size of an output fromKDF.Extract, in bytes. Inthe below diagram:¶
0 represents an all-zero byte string of lengthKDF.Nh.¶When processing a handshake message, a client combines thefollowing information to derive new epoch secrets:¶
Given these inputs, the derivation of secrets for an epochproceeds as shown in the following diagram:¶
init_secret_[n-1] | V commit_secret -> KDF.Extract | V ExpandWithLabel(., "joiner", GroupContext_[n], KDF.Nh) | V joiner_secret | Vpsk_secret (or 0) -> KDF.Extract | +--> DeriveSecret(., "welcome") | = welcome_secret | V ExpandWithLabel(., "epoch", GroupContext_[n], KDF.Nh) | V epoch_secret | +--> DeriveSecret(., <label>) | = <secret> | V DeriveSecret(., "init") | V init_secret_[n]¶
A number of secrets are derived from the epoch secret for different purposes:¶
| Secret | Label |
|---|---|
sender_data_secret | "sender data" |
encryption_secret | "encryption" |
exporter_secret | "exporter" |
authentication_secret | "authentication" |
external_secret | "external" |
confirmation_key | "confirm" |
membership_key | "membership" |
resumption_secret | "resumption" |
The "external secret" is used to derive an HPKE key pair whose private key isheld by the entire group:¶
external_priv, external_pub = KEM.DeriveKeyPair(external_secret)¶
The public keyexternal_pub can be published as part of thePublicGroupStatestruct in order to allow non-members to join the group using an external commit.¶
In addition to initializing a new epoch via KDF invocations as described above,an MLS group can also initialize a new epoch via an asymmetric interaction usingthe external key pair for the previous epoch. This is done when an new memberis joining via an external commit.¶
In this process, the joiner sends a newinit_secret value to the group usingthe HPKE export method. The joiner then uses thatinit_secret withinformation provided in the PublicGroupState and an external Commit to initializetheir copy of the key schedule for the new epoch.¶
kem_output, context = SetupBaseS(external_pub, "")init_secret = context.export("MLS 1.0 external init secret", KDF.Nh)¶Members of the group receive thekem_output in an ExternalInit proposal andpreform the corresponding calculation to retrieve theinit_secret value.¶
context = SetupBaseR(kem_output, external_priv, "")init_secret = context.export("MLS 1.0 external init secret", KDF.Nh)¶In both cases, theinfo input to HPKE is set to the PublicGroupState for theprevious epoch, encoded using the TLS serialization.¶
Groups which already have an out-of-band mechanism to generateshared group secrets can inject those into the MLS key schedule to seedthe MLS group secrets computations by this external entropy.¶
Injecting an external PSK can improve security in the casewhere having a full run of updates across members is too expensive, or ifthe external group key establishment mechanism providesstronger security against classical or quantum adversaries.¶
Note that, as a PSK may have a different lifetime than an update, it does notnecessarily provide the same Forward Secrecy (FS) or Post-Compromise Security(PCS) guarantees as a Commit message. Unlike the key pairs populated in thetree by an Update or Commit, which always freshly generated, PSKs may bepre-distributed and stored. This creates the risk that a PSK may be compromisedin the process of distribution and storage. The security that the group getsfrom injecting a PSK thus depends on both the entropy of the PSK and the risk ofcompromise. These factors are outside of the scope of this document, but shouldbe considered by application designers relying on PSKs.¶
Each PSK in MLS has a type that designates how it was provisioned.External PSKs are provided by the application, while recovery and re-init PSKsare derived from the MLS key schedule and used in cases where it isnecessary to authenticate a member's participation in a prior group state.In particular, in addition to external PSK types, a PSK derived from within MLSmay be used in the following cases:¶
The injection of one or more PSKs into the key schedule is signaled in two ways:1) as aPreSharedKey proposal, and 2) in theGroupSecrets object of aWelcome message sent to new members added in that epoch.¶
enum { reserved(0), external(1), reinit(2), branch(3) (255)} PSKType;struct { PSKType psktype; select (PreSharedKeyID.psktype) { case external: opaque psk_id<0..255>; case reinit: opaque psk_group_id<0..255>; uint64 psk_epoch; case branch: opaque psk_group_id<0..255>; uint64 psk_epoch; } opaque psk_nonce<0..255>;} PreSharedKeyID;struct { PreSharedKeyID psks<0..2^16-1>;} PreSharedKeys;¶On receiving a Commit with aPreSharedKey proposal or a GroupSecrets objectwith thepsks field set, the receiving Client includes them in the keyschedule in the order listed in the Commit, or in thepsks field respectively.For resumption PSKs, the PSK is defined as theresumption_secret of the group andepoch specified in thePreSharedKeyID object. Specifically,psk_secret iscomputed as follows:¶
struct { PreSharedKeyID id; uint16 index; uint16 count;} PSKLabel;psk_extracted_[i] = KDF.Extract(0, psk_[i])psk_input_[i] = ExpandWithLabel(psk_extracted_[i], "derived psk", PSKLabel, KDF.Nh)psk_secret_[0] = 0psk_secret_[i] = KDF.Extract(psk_input[i-1], psk_secret_[i-1])psk_secret = psk_secret[n]¶Here0 represents the all-zero vector of lengthKDF.Nh. Theindex field inPSKLabel corresponds to the index of the PSK in thepsk array, while thecount field contains the total number of PSKs. In other words, the PSKs arechained together with KDF.Extract invocations, as follows:¶
0 0 = psk_secret_[0] | | V Vpsk_[0] --> KDF.Extract --> ExpandWithLabel --> KDF.Extract = psk_secret_[1] | 0 | | | V Vpsk_[1] --> KDF.Extract --> ExpandWithLabel --> KDF.Extract = psk_secret_[1] | 0 ... | | V Vpsk_[n] --> KDF.Extract --> ExpandWithLabel --> KDF.Extract = psk_secret_[n]¶
In particular, if there are no PreSharedKey proposals in a given Commit, thenthe resultingpsk_secret ispsk_secret_[0], the all-zero vector.¶
For the generation of encryption keys and nonces, the key schedule begins withtheencryption_secret at the root and derives a tree of secrets with the samestructure as the group's ratchet tree. Each leaf in the Secret Tree isassociated with the same group member as the corresponding leaf in the ratchettree. Nodes are also assigned an index according to their position in the arrayrepresentation of the tree (described inAppendix A). If N is a node index inthe Secret Tree then left(N) and right(N) denote the children of N (if theyexist).¶
The secret of any other node in the tree is derived from its parent's secretusing a call to DeriveTreeSecret:¶
DeriveTreeSecret(Secret, Label, Node, Generation, Length) = ExpandWithLabel(Secret, Label, TreeContext, Length)Where TreeContext is specified as:struct { uint32 node = Node; uint32 generation = Generation;} TreeContext;¶If N is a node index in the Secret Tree then the secrets of the childrenof N are defined to be:¶
tree_node_[N]_secret | | +--> DeriveTreeSecret(., "tree", left(N), 0, KDF.Nh) | = tree_node_[left(N)]_secret | +--> DeriveTreeSecret(., "tree", right(N), 0, KDF.Nh) = tree_node_[right(N)]_secret¶
The secret in the leaf of the Secret Tree is used to initiate two symmetric hashratchets, from which a sequence of single-use keys and nonces are derived, asdescribed inSection 8.4. The root of each ratchet is computed as:¶
tree_node_[N]_secret | | +--> DeriveTreeSecret(., "handshake", N, 0, KDF.Nh) | = handshake_ratchet_secret_[N]_[0] | +--> DeriveTreeSecret(., "application", N, 0, KDF.Nh) = application_ratchet_secret_[N]_[0]¶
As described inSection 9, MLS encrypts three differenttypes of information:¶
The sender information used to look up the key for content encryption isencrypted with an AEAD where the key and nonce are derived from bothsender_data_secret and a sample of the encrypted message content.¶
For handshake and application messages, a sequence of keys is derived via a"sender ratchet". Each sender has their own sender ratchet, and each step alongthe ratchet is called a "generation".¶
A sender ratchet starts from a per-sender base secret derived from a SecretTree, as described inSection 8.3. The base secret initiates a symmetrichash ratchet which generates a sequence of keys and nonces. The sender uses thej-th key/nonce pair in the sequence to encrypt (using the AEAD) the j-th messagethey send during that epoch. Each key/nonce pair MUST NOT be used to encryptmore than one message.¶
Keys, nonces, and the secrets in ratchets are derived usingDeriveTreeSecret. The context in a given call consists of the indexof the sender's leaf in the ratchet tree and the current position inthe ratchet. In particular, the node index of the sender's leaf in theratchet tree is the same as the node index of the leaf in the Secret Treeused to initialize the sender's ratchet.¶
ratchet_secret_[N]_[j] | +--> DeriveTreeSecret(., "nonce", N, j, AEAD.Nn) | = ratchet_nonce_[N]_[j] | +--> DeriveTreeSecret(., "key", N, j, AEAD.Nk) | = ratchet_key_[N]_[j] | VDeriveTreeSecret(., "secret", N, j, KDF.Nh)= ratchet_secret_[N]_[j+1]¶
Here, AEAD.Nn and AEAD.Nk denote the lengthsin bytes of the nonce and key for the AEAD scheme defined bythe ciphersuite.¶
It is important to delete all security-sensitive values as soon as they areconsumed. A sensitive value S is said to beconsumed if¶
Here, S may be theinit_secret,commit_secret,epoch_secret,encryption_secret as well as any secret in a Secret Tree or one of theratchets.¶
As soon as a group member consumes a value they MUST immediately delete(all representations of) that value. This is crucial to ensuringforward secrecy for past messages. Members MAY keep unconsumed values aroundfor some reasonable amount of time to handle out-of-order message delivery.¶
For example, suppose a group member encrypts or (successfully) decrypts anapplication message using the j-th key and nonce in the ratchet of nodeindex N in some epoch n. Then, for that member, at least the followingvalues have been consumed and MUST be deleted:¶
commit_secret,joiner_secret,epoch_secret,encryption_secret ofthat epoch n as well as theinit_secret of the previous epoch n-1,¶application_ratchet_nonce_[N]_[j] andapplication_ratchet_key_[N]_[j].¶Concretely, suppose we have the following Secret Tree and ratchet forparticipant D:¶
G / \ / \ E F / \ / \ A B C D / \ HR0 AR0 -+- K0 | | | +- N0 | AR1 -+- K1 | | | +- N1 | AR2¶
Then if a client uses key K1 and nonce N1 during epoch n then it must consume(at least) values G, F, D, AR0, AR1, K1, N1 as well as the key schedule secretsused to derive G (theencryption_secret), namelyinit_secret of epoch n-1andcommit_secret,joiner_secret,epoch_secret of epoch n. The client MAYretain (not consume) the values K0 and N0 to allow for out-of-order delivery,and SHOULD retain AR2 for processing future messages.¶
The main MLS key schedule provides anexporter_secret which canbe used by an application as the basis to derive new secrets calledexported_value outside the MLS layer.¶
MLS-Exporter(Label, Context, key_length) = ExpandWithLabel(DeriveSecret(exporter_secret, Label), "exporter", Hash(Context), key_length)¶
Each application SHOULD provide a unique label toMLS-Exporter thatidentifies its use case. This is to prevent twoexported outputs from being generated with the same values and usedfor different functionalities.¶
The exported values are bound to the group epoch from which theexporter_secret is derived, hence reflects a particular state ofthe group.¶
It is RECOMMENDED for the application generating exported valuesto refresh those values after a Commit is processed.¶
The main MLS key schedule provides aresumption_secret which can provide extrasecurity in some cross-group operations.¶
The application SHOULD specify an upper limit on the number of pastepochs for which theresumption_secret may be stored.¶
There are two ways in which aresumption_secret can be used: to re-initializethe group with different parameters, or to create asub-group of an existing group as detailed inSection 8.2.¶
Resumption keys are distinguished from exporter keys in that they have specificuse inside the MLS protocol, whereas the use of exporter secrets may bedecided by an external application. They are thus derived separately to avoidkey material reuse.¶
The main MLS key schedule provides a per-epochauthentication_secret.If one of the parties is being actively impersonated by an attacker, theirauthentication_secret will differ from that of the other group members.Thus, members of a group MAY use theirauthentication_secrets withinan out-of-band authentication protocol to ensure that theyshare the same view of the group.¶
Handshake and application messages use a common framing structure.This framing provides encryption to ensure confidentiality within thegroup, as well as signing to authenticate the sender within the group.¶
The two main structures involved are MLSPlaintext and MLSCiphertext.MLSCiphertext represents a signed and encrypted message, withprotections for both the content of the message and relatedmetadata. MLSPlaintext represents a message that is only signed,and not encrypted. Applications MUST use MLSCiphertext to encryptapplication messages and SHOULD use MLSCiphertext to encodehandshake messages, but MAY transmit handshake messages encodedas MLSPlaintext objects in cases where it is necessary for theDelivery Service to examine such messages.¶
enum { reserved(0), application(1), proposal(2), commit(3), (255)} ContentType;enum { reserved(0), member(1), preconfigured(2), new_member(3), (255)} SenderType;struct { SenderType sender_type; switch (sender_type) { case member: KeyPackageID member; case preconfigured: opaque external_key_id<0..255>; case new_member: struct{}; }} Sender;struct { opaque mac_value<0..255>;} MAC;enum { reserved(0), mls_plaintext(1), mls_ciphertext(2), (255)} WireFormat;struct { WireFormat wire_format; opaque group_id<0..255>; uint64 epoch; Sender sender; opaque authenticated_data<0..2^32-1>; ContentType content_type; select (MLSPlaintext.content_type) { case application: opaque application_data<0..2^32-1>; case proposal: Proposal proposal; case commit: Commit commit; } opaque signature<0..2^16-1>; optional<MAC> confirmation_tag; optional<MAC> membership_tag;} MLSPlaintext;struct { WireFormat wire_format = mls_ciphertext; opaque group_id<0..255>; uint64 epoch; ContentType content_type; opaque authenticated_data<0..2^32-1>; opaque encrypted_sender_data<0..255>; opaque ciphertext<0..2^32-1>;} MLSCiphertext;¶The fieldconfirmation_tag MUST be present ifcontent_type equals commit.Otherwise, it MUST NOT be present.¶
External sender types are sent as MLSPlaintext, seeSection 11.1.9for their use.¶
The remainder of this section describes how to compute the signature of anMLSPlaintext object and how to convert it to an MLSCiphertext object formember sender types. The steps are:¶
group_id,epoch,content_type andauthenticated_data fields from theMLSPlaintext object directly¶sender_data_secret for the epoch and a sample of the encryptedMLSCiphertextContent.¶Decryption is done by decrypting the sender data, then the message, and thenverifying the content signature.¶
The following sections describe the encryption and signing processes in detail.¶
Thesignature field in an MLSPlaintext object is computed using the signingprivate key corresponding to the public key, which was authenticated by thecredential at the leaf of the tree indicated by the sender field. The signaturecovers the plaintext metadata and message content, which is all of MLSPlaintextexcept for thesignature, theconfirmation_tag andmembership_tag fields.If the sender is a member of the group, the signature also covers theGroupContext for the current epoch, so that signatures are specific to a givengroup and epoch.¶
struct { select (MLSPlaintextTBS.sender.sender_type) { case member: GroupContext context; case preconfigured: case new_member: struct{}; } WireFormat wire_format; opaque group_id<0..255>; uint64 epoch; Sender sender; opaque authenticated_data<0..2^32-1>; ContentType content_type; select (MLSPlaintextTBS.content_type) { case application: opaque application_data<0..2^32-1>; case proposal: Proposal proposal; case commit: Commit commit; }} MLSPlaintextTBS;¶Themembership_tag field in the MLSPlaintext object authenticates the sender'smembership in the group. For an MLSPlaintext with a sender type other thanmember, this field MUST be omitted. For messages sent by members, it MUST bepresent and set to the following value:¶
struct { MLSPlaintextTBS tbs; opaque signature<0..2^16-1>; optional<MAC> confirmation_tag;} MLSPlaintextTBM;membership_tag = MAC(membership_key, MLSPlaintextTBM);¶Note that themembership_tag only needs to be computed for MLSPlaintextmessages that will be sent over the wire (wire_format == mls_plaintext). Itisn't needed for messages that will be encrypted and transmitted asMLSCiphertext messages (wire_format == mls_ciphertext).¶
Theciphertext field of the MLSCiphertext object is produced by supplying theinputs described below to the AEAD function specified by the ciphersuite in use.The plaintext input contains the content and signature of the MLSPlaintext, plusoptional padding. These values are encoded in the following form:¶
struct { select (MLSCiphertext.content_type) { case application: opaque application_data<0..2^32-1>; case proposal: Proposal proposal; case commit: Commit commit; } opaque signature<0..2^16-1>; optional<MAC> confirmation_tag; opaque padding<0..2^16-1>;} MLSCiphertextContent;¶In the MLS key schedule, the sender creates two distinct key ratchets forhandshake and application messages for each member of the group. When encryptinga message, the sender looks at the ratchets it derived for its own member andchooses an unused generation from either the handshake or application ratchetdepending on the content type of the message. This generation of the ratchet isused to derive a provisional nonce and key.¶
Before use in the encryption operation, the nonce is XORed with a fresh randomvalue to guard against reuse. Because the key schedule generates noncesdeterministically, a client must keep persistent state as to where in the keyschedule it is; if this persistent state is lost or corrupted, a client mightreuse a generation that has already been used, causing reuse of a key/nonce pair.¶
To avoid this situation, the sender of a message MUST generate a fresh random4-byte "reuse guard" value and XOR it with the first four bytes of the noncefrom the key schedule before using the nonce for encryption. The sender MUSTinclude the reuse guard in thereuse_guard field of the sender data object, sothat the recipient of the message can use it to compute the nonce to be used fordecryption.¶
+-+-+-+-+---------...---+| Key Schedule Nonce |+-+-+-+-+---------...---+ XOR+-+-+-+-+---------...---+| Guard | 0 |+-+-+-+-+---------...---+ ===+-+-+-+-+---------...---+| Encrypt/Decrypt Nonce |+-+-+-+-+---------...---+¶
The Additional Authenticated Data (AAD) input to the encryptioncontains an object of the following form, with the values used toidentify the key and nonce:¶
struct { opaque group_id<0..255>; uint64 epoch; ContentType content_type; opaque authenticated_data<0..2^32-1>;} MLSCiphertextContentAAD;¶The "sender data" used to look up the key for the content encryption isencrypted with the ciphersuite's AEAD with a key and nonce derived from both thesender_data_secret and a sample of the encrypted content. Before beingencrypted, the sender data is encoded as an object of the following form:¶
struct { KeyPackageID sender; uint32 generation; opaque reuse_guard[4];} MLSSenderData;¶MLSSenderData.sender is assumed to be amember sender type. When constructingan MLSSenderData from a Sender object, the sender MUST verify Sender.sender_typeismember and use Sender.sender for MLSSenderData.sender.¶
Thereuse_guard field contains a fresh random value used to avoid nonce reusein the case of state loss or corruption, as described inSection 9.2.¶
The key and nonce provided to the AEAD are computed as the KDF of the firstKDF.Nh bytes of the ciphertext generated in the previous section. If thelength of the ciphertext is less thanKDF.Nh, the whole ciphertext is usedwithout padding. In pseudocode, the key and nonce are derived as:¶
ciphertext_sample = ciphertext[0..KDF.Nh-1]sender_data_key = ExpandWithLabel(sender_data_secret, "key", ciphertext_sample, AEAD.Nk)sender_data_nonce = ExpandWithLabel(sender_data_secret, "nonce", ciphertext_sample, AEAD.Nn)¶
The Additional Authenticated Data (AAD) for the SenderData ciphertext is all thefields of MLSCiphertext excludingencrypted_sender_data:¶
struct { opaque group_id<0..255>; uint64 epoch; ContentType content_type;} MLSSenderDataAAD;¶When parsing a SenderData struct as part of message decryption, the recipientMUST verify that the KeyPackageID indicated in thesender field identifies amember of the group.¶
A group is always created with a single member, the "creator". The othermembers are added when the creator effectively sends itself an Add proposal andcommits it, then sends the corresponding Welcome message to the newparticipants. These processes are described in detail inSection 11.1.1,Section 11.2,andSection 11.2.2.¶
The creator of a group MUST take the following steps to initialize the group:¶
capabilities extensionsin these KeyPackages to verify that thechosen version and ciphersuite is the best option supported by all members.¶Initialize a one-member group with the following initial values:¶
KDF.Nh¶The recipient of a Welcome message processes it as described inSection 11.2.2.¶
In principle, the above process could be streamlined by having thecreator directly create a tree and choose a random value for firstepoch's epoch secret. We follow the steps above because it removesunnecessary choices, by which, for example, bad randomness could beintroduced. The only choices the creator makes here are its ownKeyPackage, the leaf secret from which the Commit is built, and theintermediate key pairs along the direct path to the root.¶
The configuration of a group imposes certain requirements on clients in thegroup. At a minimum, all members of the group need to support the ciphersuiteand protocol version in use. Additional requirements can be imposed byincluding arequired_capabilities extension in the GroupContext.¶
struct { ExtensionType extensions<0..255>; ProposalType proposals<0..255>;} RequiredCapabilities;¶This extension lists the extensions and proposal types that must be supported byall members of the group. For new members, it is enforced by existing members during theapplication of Add commits. Existing members should of course be in compliancealready. In order to ensure this continues to be the case even as the group'sextensions can be updated, a GroupContextExtensions proposal is invalid if itcontains arequired_capabilities extension that requires capabililities notsupported by all current members.¶
A new group may be tied to an already existing group for the purpose ofre-initializing the existing group, or to branch into a sub-group.Re-initializing an existing group may be used, for example, to restart the groupwith a different ciphersuite or protocol version. Branching may be used tobootstrap a new group consisting of a subset of current group members, based onthe current group state.¶
In both cases, thepsk_nonce included in thePreSharedKeyID object must be arandomly sampled nonce of lengthKDF.Nh to avoid key re-use.¶
If a client wants to create a subgroup of an existing group, they MAY choose toinclude aPreSharedKeyID in theGroupSecrets object of the Welcome message choosingthepsktypebranch, thegroup_id of the group from which a subgroup is tobe branched, as well as an epoch within the number of epochs for which aresumption_secret is kept.¶
Over the lifetime of a group, its membership can change, and existing membersmight want to change their keys in order to achieve post-compromise security. InMLS, each such change is accomplished by a two-step process:¶
The group thus evolves from one cryptographic state to another each time aCommit message is sent and processed. These states are referred to as "epochs"and are uniquely identified among states of the group by eight-octet epoch values.When a new group is initialized, its initial state epoch is 0x0000000000000000. Each timea state transition occurs, the epoch number is incremented by one.¶
Proposals are included in an MLSPlaintext by way of a Proposal structure thatindicates their type:¶
// See IANA registry for registered valuesuint16 ProposalType;struct { ProposalType msg_type; select (Proposal.msg_type) { case add: Add; case update: Update; case remove: Remove; case psk: PreSharedKey; case reinit: ReInit; case external_init: ExternalInit; case app_ack: AppAck; case group_context_extensions: GroupContextExtensions; };} Proposal;¶On receiving an MLSPlaintext containing a Proposal, a client MUST verify thesignature on the enclosing MLSPlaintext. If the signature verifiessuccessfully, then the Proposal should be cached in such a way that it can beretrieved by hash (as a ProposalOrRef object) in a later Commit message.¶
An Add proposal requests that a client with a specified KeyPackage be addedto the group. The proposer of the Add MUST validate the KeyPackage in the sameway as receipients are required to do below.¶
struct { KeyPackage key_package;} Add;¶The proposer of the Add does not control where in the group's ratchet tree thenew member is added. Instead, the sender of the Commit message chooses alocation for each added member and states it in the Commit message.¶
An Add is applied after being included in a Commit message. The position of theAdd in the list of proposals determines the node indexindex of the leaf nodewhere the new member will be added. For the first Add in the Commit,index isthe leftmost empty leaf in the tree, for the second Add, the next empty leaf tothe right, etc.¶
Validate the KeyPackage:¶
Verify that the following fields in the KeyPackage are unique among themembers of the group (including any other members added in the sameCommit):¶
required_capabilitiesextension, then the required extensions and proposals MUST be listed inthe KeyPackage'scapabilities extension.¶index to the root, addindex to theunmerged_leaves list for the node.¶index to a new node containing thepublic key from the KeyPackage in the Add, as well as the credential underwhich the KeyPackage was signed¶An Update proposal is a similar mechanism to Add with the distinctionthat it is the sender's leaf KeyPackage in the tree which would beupdated with a new KeyPackage.¶
struct { KeyPackage key_package;} Update;¶The values in the following fields of the KeyPackage contained in anUpdateproposal MUST be the same as those of the KeyPackage it replaces in the tree.version,cipher_suite,credential.identity,endpoint_id. However, thevalue of thecredential.signature_key field of the new KeyPackage MUST bedifferent from that of all other KeyPackages in the tree. Furthermore, the valueof thehpke_init_key field of the new KeyPackage MUST be different from thatof the KeyPackage it replaces.¶
A member of the group applies an Update message by taking the following steps:¶
A Remove proposal requests that the member with KeyPackageIDremoved be removedfrom the group.¶
struct { KeyPackageID removed;} Remove;¶A member of the group applies a Remove message by taking the following steps:¶
removed. Thislookup MUST be done on the tree before any non-Remove proposals havebeen applied (the "old" tree in the terminology ofSection 11.2), sinceproposals such as Update can change the KeyPackage stored at a leaf.Letremoved_index be the node index of this leaf node.¶removed_index with a blank node¶removed_index to the root¶A PreSharedKey proposal can be used to request that a pre-shared key beinjected into the key schedule in the process of advancing the epoch.¶
struct { PreSharedKeyID psk;} PreSharedKey;¶Thepsktype of the pre-shared key MUST beexternal and thepsk_nonce MUSTbe a randomly sampled nonce of lengthKDF.Nh. When processing a Commit messagethat includes one or more PreSharedKey proposals, group members derivepsk_secret as described inSection 8.2, where the order of the PSKscorresponds to the order of thePreSharedKey proposals in the Commit.¶
A ReInit proposal represents a request to re-initialize the group with differentparameters, for example, to increase the version number or to change theciphersuite. The re-initialization is done by creating a completely new groupand shutting down the old one.¶
struct { opaque group_id<0..255>; ProtocolVersion version; CipherSuite cipher_suite; Extension extensions<0..2^32-1>;} ReInit;¶A member of the group applies a ReInit proposal by waiting for the committer tosend the Welcome message and by checking that thegroup_id and the parametersof the new group corresponds to the ones specified in the proposal. The Welcomemessage MUST specify exactly one pre-shared key withpsktype = reinit, and withpsk_group_id andpsk_epoch equal to thegroup_id andepoch of theexisting group after the Commit containing thereinit Proposal was processed.The Welcome message may specify the inclusion of other pre-shared keys with apsktype different fromreinit.¶
If a ReInit proposal is included in a Commit, it MUST be the only proposalreferenced by the Commit. If other non-ReInit proposals have been sent duringthe epoch, the committer SHOULD prefer them over the ReInit proposal, allowingthe ReInit to be resent and applied in a subsequent epoch. Theversion fieldin the ReInit proposal MUST be no less than the version for the current group.¶
An ExternalInit proposal is used by new members that want to join a group byusing an external commit. This propsal can only be used in that context.¶
struct { opaque kem_output<0..2^16-1>;} ExternalInit;¶A member of the group applies an ExternalInit message by initializing the nextepoch using an init secret computed as described inSection 8.1.Thekem_output field contains the required KEM output.¶
An AppAck proposal is used to acknowledge receipt of application messages.Though this information implies no change to the group, it is structured as aProposal message so that it is included in the group's transcript by beingincluded in Commit messages.¶
struct { KeyPackageID sender; uint32 first_generation; uint32 last_generation;} MessageRange;struct { MessageRange received_ranges<0..2^32-1>;} AppAck;¶An AppAck proposal represents a set of messages received by the sender in thecurrent epoch. Messages are represented by thesender andgeneration valuesin the MLSCiphertext for the message. Each MessageRange represents receipt of aspan of messages whosegeneration values form a continuous range fromfirst_generation tolast_generation, inclusive.¶
AppAck proposals are sent as a guard against the Delivery Service droppingapplication messages. The sequential nature of thegeneration field providesa degree of loss detection, since gaps in thegeneration sequence indicatedropped messages. AppAck completes this story by addressing the scenario wherethe Delivery Service drops all messages after a certain point, so that a latergeneration is never observed. Obviously, there is a risk that AppAck messagescould be suppressed as well, but their inclusion in the transcript means that ifthey are suppressed then the group cannot advance at all.¶
The schedule on which sending AppAck proposals are sent is up to the application,and determines which cases of loss/suppression are detected. For example:¶
An application using AppAck proposals to guard against loss/suppression ofapplication messages also needs to ensure that AppAck messages and the Commitsthat reference them are not dropped. One way to do this is to always encryptProposal and Commit messages, to make it more difficult for the Delivery Serviceto recognize which messages conatain AppAcks. The application can also haveclients enforce an AppAck schedule, reporting loss if an AppAck is not receivedat the expected time.¶
A GroupContextExtensions proposal is used to update the list of extensions inthe GroupContext for the group.¶
struct { Extension extensions<0..2^32-1>;} GroupContextExtensions;¶
A member of the group applies a GroupContextExtensions proposal with thefollowing steps:¶
required_capabilities extension, verify thatall members of the group support the required capabilities (including thoseadded in the same commit, and excluding those removed).¶Note that once the GroupContext is updated, its inclusion in theconfirmation_tag by way of the key schedule will confirm that all members of thegroup agree on the extensions in use.¶
Add and Remove proposals can be constructed and sent to the group by a partythat is outside the group. For example, a Delivery Service might propose toremove a member of a group who has been inactive for a long time, or propose addinga newly-hired staff member to a group representing a real-world team. Proposalsoriginating outside the group are identified by apreconfigured ornew_member SenderType in MLSPlaintext.¶
ReInit proposals can also be sent to the group by apreconfigured sender, forexample to enforce a changed policy regarding MLS version or ciphersuite.¶
Thenew_member SenderType is used for clients proposing that they themselvesbe added. For this ID type the sender value MUST be zero and the Proposal typeMUST be Add. The MLSPlaintext MUST be signed with the private key correspondingto the KeyPackage in the Add message. Recipients MUST verify that theMLSPlaintext carrying the Proposal message is validly signed with this key.¶
Thepreconfigured SenderType is reserved for signers that are pre-provisionedto the clients within a group. If proposals with these sender IDs are to beaccepted within a group, the members of the group MUST be provisioned by theapplication with a mapping between these IDs and authorized signing keys.Recipients MUST verify that the MLSPlaintext carrying the Proposal message isvalidly signed with the corresponding key. To ensure consistent handling ofexternal proposals, the application MUST ensure that the members of a grouphave the same mapping and apply the same policies to external proposals.¶
An external proposal MUST be sent as an MLSPlaintextobject, since the sender will not have the keys necessary to construct anMLSCiphertext object.¶
A Commit message initiates a new epoch for the group, based on a collection ofProposals. It instructs group members to update their representation of thestate of the group by applying the proposals and advancing the key schedule.¶
Each proposal covered by the Commit is included by a ProposalOrRef value, whichidentifies the proposal to be applied by value or by reference. Proposalssupplied by value are included directly in the Commit object. Proposalssupplied by reference are specified by including the hash of the MLSPlaintext inwhich the Proposal was sent, using the hash function from the group'sciphersuite. For proposals supplied by value, the sender of the proposal is thesame as the sender of the Commit. Conversely, proposals sent by people otherthan the committer MUST be included by reference.¶
enum { reserved(0), proposal(1) reference(2), (255)} ProposalOrRefType;struct { ProposalOrRefType type; select (ProposalOrRef.type) { case proposal: Proposal proposal; case reference: opaque hash<0..255>; }} ProposalOrRef;struct { ProposalOrRef proposals<0..2^32-1>; optional<UpdatePath> path;} Commit;¶A group member that has observed one or more proposals within an epoch MUST senda Commit message before sending application data. This ensures, for example,that any members whose removal was proposed during the epoch are actuallyremoved before any application data is transmitted.¶
The sender of a Commit MUST include all valid proposals that it has receivedduring the current epoch. Invalid proposals include, for example, proposals withan invalid signature or proposals that are semantically invalid, such as an Addwhen the sender does not have the application-level permission to add new users.Proposals with a non-default proposal type MUST NOT be included in a commitunless the proposal type is supported by all the members of the group that willprocess the Commit (i.e., not including any members being added or removed bythe Commit).¶
If there are multiple proposals that apply to the same leaf, the committerchooses one and includes only that one in the Commit, considering the restinvalid. The committer MUST prefer any Remove received, or the most recentUpdate for the leaf if there are no Removes. If there are multiple Add proposalscontaining KeyPackages with the same tuple(credential.identity, endpoint_id)the committer again chooses one to include and considers the rest invalid. Addproposals that contain KeyPackages with an(credential.identity, endpoint_id)tuple that matches that of an existing KeyPackage in the group MUST beconsidered invalid. The comitter MUST consider invalid any Add or Updateproposal if the Credential in the contained KeyPackage shares the same signaturekey with a Credential in any leaf of the group, or indeed if the KeyPackageshares the samehpke_init_key with another KeyPackage in the group.¶
The Commit MUST NOT combine proposals sent within different epochs. In the eventthat a valid proposal is omitted from the next Commit, the sender of theproposal SHOULD retransmit it in the new epoch.¶
A member of the group MAY send a Commit that references no proposals at all,which would thus have an emptyproposals vector. Sucha Commit resets the sender's leaf and the nodes along its direct path, andprovides forward secrecy and post-compromise security with regard to the senderof the Commit. An Update proposal can be regarded as a "lazy" version of thisoperation, where only the leaf changes and intermediate nodes are blanked out.¶
Thepath field of a Commit message MUST be populated if the Commit covers atleast one Update or Remove proposal. Thepath field MUST also be populatedif the Commit covers no proposals at all (i.e., if the proposals vectoris empty). Thepath field MAY be omitted if the Commit covers only Addproposals. In pseudocode, the logic for validating a Commit is as follows:¶
hasUpdates = falsehasRemoves = falsefor i, id in commit.proposals: proposal = proposalCache[id] assert(proposal != null) hasUpdates = hasUpdates || proposal.msg_type == update hasRemoves = hasRemoves || proposal.msg_type == removeif len(commit.proposals) == 0 || hasUpdates || hasRemoves: assert(commit.path != null)¶
To summarize, a Commit can have three different configurations, with differentuses:¶
When creating or processing a Commit, three different ratchet trees andtheir associated GroupContexts are used:¶
A member of the group creates a Commit message and the corresponding Welcomemessage at the same time, by taking the following steps:¶
proposalsfield populated from Proposals received during the current epoch, and an emptypath field.¶Generate the provisional ratchet tree and GroupContext by applying the proposalsreferenced in the initial Commit object, as described inSection 11.1. Updateproposals are applied first, followed by Remove proposals, and then finallyAdd proposals. Add proposals are applied in the order listed in theproposals vector, and always to the leftmost unoccupied leaf in the tree, orthe right edge of the tree if all leaves are occupied.¶
path field: If thepath field is requiredbased on the proposals that are in the commit (see above), then it MUST bepopulated. Otherwise, the sender MAY omit thepath field at its discretion.¶If populating thepath field: Create an UpdatePath using the provisionalratchet tree and GroupContext. Any new member (from an add proposal) MUST beexluded from the resolution during the computation of the UpdatePath. Theleaf_key_package for this UpdatePath must have aparent_hash extension.Note that the KeyPackage in theUpdatePath effectively updates an existingKeyPackage in the group and thus MUST adhere to the same restrictions asKeyPackages used inUpdate proposals.¶
path field in the Commit.¶commit_secret as the valuepath_secret[n+1] derived from thepath_secret[n] value assigned to the root node.¶path field: Set thepath field in the Commit to thenull optional. Definecommit_secret as the all-zero vector of lengthKDF.Nh (the same length as apath_secret value would be). In this case,the new ratchet tree is the same as the provisional ratchet tree.¶psk_secret as specified inSection 8.2, where the orderof PSKs in the derivation corresponds to the order of PreSharedKey proposalsin theproposals vector.¶Construct an MLSPlaintext object containing the Commit object. Sign theMLSPlaintext using the old GroupContext as context.¶
init_secret from the previous epoch, thecommit_secret and thepsk_secret as defined in the previous steps, and the new GroupContext tocompute the newjoiner_secret,welcome_secret,epoch_secret, andderived secrets for the new epoch.¶confirmation_key for the new epoch to compute theconfirmation_tag value, and themembership_key for the old epoch tocompute themembership_tag value in the MLSPlaintext.¶confirmation_tag from the MLSPlaintext.¶Construct a GroupInfo reflecting the new state:¶
joiner_secretfor the new epoch (seeSection 11.2.2)¶For each new member in the group:¶
path field was populated above: Compute the path secretcorresponding to the common ancestor node¶init_secretfor the current epoch and the path secret (if present).¶psks MUST be the same as the order of PreSharedKey proposals in theproposals vector.¶PreSharedKeyID withpsktypereinit and withpsk_group_id andpsk_epoch corresponding to the currentgroup and the epoch after the commit was processed.¶A member of the group applies a Commit message by taking the following steps:¶
epoch field of the enclosing MLSPlaintext message is equalto theepoch field of the current GroupContext object¶sender field.¶proposals vectorare available.¶Generate the provisional ratchet tree and GroupContext by applying the proposalsreferenced in the initial Commit object, as described inSection 11.1. Updateproposals are applied first, followed by Remove proposals, and then finallyAdd proposals. Add proposals are applied in the order listed in theproposals vector, and always to the leftmost unoccupied leaf in the tree, orthe right edge of the tree if all leaves are occupied.¶
path value is populated if theproposals vector containsany Update or Remove proposals, or if it's empty. Otherwise, thepath valueMAY be omitted.¶If thepath value is populated: Process thepath value using theprovisional ratchet tree and GroupContext, to generate the new ratchet treeand thecommit_secret:¶
leaf_key_package at theCommitter's leaf.¶parent_hash extension and that its valuematches the new parent of the sender's leaf node.¶commit_secret as the valuepath_secret[n+1] derived from thepath_secret[n] value assigned to the root node.¶path value is not populated: Definecommit_secret as the all-zerovector of lengthKDF.Nh (the same length as apath_secret value would be).¶psk_secret as specified inSection 8.2, where the orderof PSKs in the derivation corresponds to the order of PreSharedKey proposalsin theproposals vector.¶init_secret from the previous epoch, thecommit_secret and thepsk_secret as defined in the previous steps, and the new GroupContext tocompute the newjoiner_secret,welcome_secret,epoch_secret, andderived secrets for the new epoch.¶confirmation_key for the new epoch to compute the confirmation tagfor this message, as described below, and verify that it is the same as theconfirmation_tag field in the MLSPlaintext object.¶If the Commit included a ReInit proposal, the client MUST NOT use the group tosend messages anymore. Instead, it MUST wait for a Welcome message from the committerand check that¶
version,cipher_suite andextensions fields of the new groupcorresponds to the ones in theReInit proposal, and that theversionis greater than or equal to that of the original group.¶psks field in the Welcome message includes aPreSharedKeyID withpsktype =reinit, andpsk_epoch andpsk_group_id equal to the epochand group ID of the original group after processing the Commit.¶The confirmation tag value confirms that the members of the group have arrivedat the same state of the group:¶
MLSPlaintext.confirmation_tag = MAC(confirmation_key, GroupContext.confirmed_transcript_hash)¶
External Commits are a mechanism for new members (external parties that want tobecome members of the group) to add themselves to a group, without requiringthat an existing member has to come online to issue a Commit that references anAdd Proposal.¶
Whether existing members of the group will accept or reject an External Commitfollows the same rules that are applied to other handshake messages.¶
New members can create and issue an External Commit if they have access to thefollowing information for the group's current epoch:¶
This information is aggregated in aPublicGroupState object as follows:¶
struct { CipherSuite cipher_suite; opaque group_id<0..255>; uint64 epoch; opaque tree_hash<0..255>; opaque interim_transcript_hash<0..255>; Extension group_context_extensions<0..2^32-1>; Extension other_extensions<0..2^32-1>; HPKEPublicKey external_pub; KeyPackageID signer; opaque signature<0..2^16-1>;} PublicGroupState;¶Note that thetree_hash field is used the same way as in the Welcome message.The full tree can be included via theratchet_tree extensionSection 11.3.¶
The signature MUST verify using the public key taken from the credential in theleaf node of the member with KeyPackageIDsigner. The signature covers thefollowing structure, comprising all the fields in the PublicGroupState abovesignature:¶
struct { opaque group_id<0..255>; uint64 epoch; opaque tree_hash<0..255>; opaque interim_transcript_hash<0..255>; Extension group_context_extensions<0..2^32-1>; Extension other_extensions<0..2^32-1>; HPKEPublicKey external_pub; KeyPackageID signer;} PublicGroupStateTBS;¶This signature authenticates the HPKE public key, so that the joiner knows thatthe public key was provided by a member of the group. The fields that are notsigned are included in the key schedule via the GroupContext object. If thejoiner is provided an inaccurate data for these fields, then its external Commitwill have an incorrectconfirmation_tag and thus be rejected.¶
The information in a PublicGroupState is not deemed public in general, butapplications can choose to make it available to new members in order to allowExternal Commits.¶
External Commits work like regular Commits, with a few differences:¶
The proposals included by value in an External Commit MUST meet the followingconditions:¶
credential andendpoint_id ofthe removed leaf MUST be the same as the corresponding values in the AddKeyPackage.¶The proposals included by reference in an External Commit MUST meet the followingconditions:¶
path field (and is therefore a "full"Commit)¶leaf_key_package of thepath field.¶new_member¶In other words, External Commits come in two "flavors" -- a "join" commit thatadds the sender to the group or a "resync" commit that replaces a member's priorappearance with a new one.¶
Note that the "resync" operation allows an attacker that has compromised amember's signature private key to introduce themselves into the group and remove theprior, legitimate member in a single Commit. Without resync, thiscan still be done, but requires two operations, the external Commit to join anda second Commit to remove the old appearance. Applications for whom thisdistinction is salient can choose to disallow external commits that contain aRemove, or to allow such resync commits only if they contain a "reinit" PSKproposal that demonstrates the joining member's presence in a prior epoch of thegroup. With the latter approach, the attacke would need to compromise the PSKas well as the signing key, but the application will need to ensure thatcontinuing, non-resync'ing members have the required PSK.¶
The sender of a Commit message is responsible for sending a Welcome message toany new members added via Add proposals. The Welcome message provides the newmembers with the current state of the group, after the application of the Commitmessage. The new members will not be able to decrypt or verify the Commitmessage, but will have the secrets they need to participate in the epochinitiated by the Commit message.¶
In order to allow the same Welcome message to be sent to all new members,information describing the group is encrypted with a symmetric key and noncederived from thejoiner_secret for the new epoch. Thejoiner_secret isthen encrypted to each new member using HPKE. In the same encrypted package,the committer transmits the path secret for the lowest node contained in thedirect paths of both the committer and the new member. This allows the newmember to compute private keys for nodes in its direct path that are beingreset by the corresponding Commit.¶
If the sender of the Welcome message wants the receiving member to include a PSKin the derivation of theepoch_secret, they can populate thepsks field indicating whichPSK to use.¶
struct { opaque group_id<0..255>; uint64 epoch; opaque tree_hash<0..255>; opaque confirmed_transcript_hash<0..255>; Extension group_context_extensions<0..2^32-1>; Extension other_extensions<0..2^32-1>; MAC confirmation_tag; KeyPackageID signer; opaque signature<0..2^16-1>;} GroupInfo;struct { opaque path_secret<1..255>;} PathSecret;struct { opaque joiner_secret<1..255>; optional<PathSecret> path_secret; PreSharedKeys psks;} GroupSecrets;struct { KeyPackageID new_member<1..255>; HPKECiphertext encrypted_group_secrets;} EncryptedGroupSecrets;struct { ProtocolVersion version = mls10; CipherSuite cipher_suite; EncryptedGroupSecrets secrets<0..2^32-1>; opaque encrypted_group_info<1..2^32-1>;} Welcome;¶The client processing a Welcome message will need to have a copy of the group'sratchet tree. The tree can be provided in the Welcome message, in an extensionof typeratchet_tree. If it is sent otherwise (e.g., provided by a cachingservice on the Delivery Service), then the client MUST download the tree beforeprocessing the Welcome.¶
On receiving a Welcome message, a client processes it using the following steps:¶
secrets array where thenew_membervalue corresponds to one of this client's KeyPackages, using the hashindicated by thecipher_suite field. If no such field exists, or if theciphersuite indicated in the KeyPackage does not match the one in theWelcome message, return an error.¶encrypted_group_secrets using HPKE with the algorithms indicatedby the ciphersuite and the HPKE private key corresponding to the GroupSecrets.If aPreSharedKeyID is part of the GroupSecrets and the client is not inpossession of the corresponding PSK, return an error.¶joiner_secret in the decrypted GroupSecrets object and the PSKsspecified in theGroupSecrets, derive thewelcome_secret and using thatthewelcome_key andwelcome_nonce. Use the key and nonce to decrypt theencrypted_group_info field.¶welcome_nonce = KDF.Expand(welcome_secret, "nonce", AEAD.Nn)welcome_key = KDF.Expand(welcome_secret, "key", AEAD.Nk)¶
signer. If there is no matching leaf node, or ifsignature verification fails, return an error.¶Verify the integrity of the ratchet tree.¶
tree_hash fieldin the GroupInfo.¶parent_hash value (if the child is another parent) or has aparent_hashextension in the KeyPackage containing the same value (if the child is aleaf). If either of the node's children is empty, and in particular does nothave a parent hash, then its respective children'sparent_hash values haveto be considered instead.¶tree array (any even-numbered node) whosekey_package field is identical to the KeyPackage. If no such fieldexists, return an error. Letindex represent the index of this node in thetree.¶Construct a new group state using the information in the GroupInfo object.¶
group_id,epoch,tree_hash,confirmed_transcript_hash, andgroup_context_extensions fields fromthe GroupInfo object.¶index, as defined above.¶index with the private key corresponding to thepublic key in the node.¶path_secret value is set in the GroupSecrets object: Identify thelowest common ancestor of the node indexindex and of the node index ofthe member with KeyPackageIDGroupInfo.signer. Set the private key forthis node to the private key derived from thepath_secret.¶joiner_secret from the GroupSecrets object to generate the epoch secretand other derived secrets for the current epoch.¶confirmed_transcript_hash in the GroupInfo.¶confirmed_transcript_hash from the GroupInfo.¶By default, a GroupInfo message only provides the joiner with a commitmentto the group's ratchet tree. In order to process or generate handshakemessages, the joiner will need to get a copy of the ratchet tree from some othersource. (For example, the DS might provide a cached copy.) The inclusion ofthe tree hash in the GroupInfo message means that the source of the ratchettree need not be trusted to maintain the integrity of tree.¶
In cases where the application does not wish to provide such an external source,the whole public state of the ratchet tree can be provided in an extension oftyperatchet_tree, containing aratchet_tree object of the following form:¶
enum { reserved(0), leaf(1), parent(2), (255)} NodeType;struct { NodeType node_type; select (Node.node_type) { case leaf: KeyPackage key_package; case parent: ParentNode node; };} Node;optional<Node> ratchet_tree<1..2^32-1>;¶The presence of aratchet_tree extension in a GroupInfo message does notresult in any changes to the GroupContext extensions for the group. The ratchettree provided is simply stored by the client and used for MLS operations.¶
If this extension is not provided in a Welcome message, then the client willneed to fetch the ratchet tree over some other channel before it can generate orprocess Commit messages. Applications should ensure that this out-of-bandchannel is provided with security protections equivalent to the protections thatare afforded to Proposal and Commit messages. For example, an application thatencrypts Proposal and Commit messages might distribute ratchet trees encryptedusing a key exchanged over the MLS channel.¶
This protocol includes a mechanism for negotiating extension parameters similarto the one in TLS[RFC8446]. In TLS, extension negotiation is one-to-one: Theclient offers extensions in its ClientHello message, and the server expressesits choices for the session with extensions in its ServerHello andEncryptedExtensions messages. In MLS, extensions appear in the followingplaces:¶
In other words, an application can use GroupContext extensions to ensure thatall members of the group agree on a set of parameters. Clients indicatetheir support for parameters in KeyPackage extensions. New members of agroup are informed of the group's GroupContext extensions via thegroup_context_extensions field in the GroupInfo or PublicGroupState object.Theother_extensions field in a GroupInfo object can be used to provideadditional parameters to new joiners that are used to join the group.¶
This extension mechanism is designed to allow for secure and forward-compatiblenegotiation of extensions. For this to work, implementations MUST correctlyhandle extensible fields:¶
Note that the latter two requirements mean that all MLS extensions aremandatory, in the sense that an extension in use by the group MUST be supportedby all members of the group.¶
This document does not define any way for the parameters of the group to changeonce it has been created; such a behavior could be implemented as an extension.¶
Each Commit message is premised on a given starting state,indicated by theepoch field of the enclosing MLSPlaintextmessage. If the changes implied by a Commit messages are madestarting from a different state, the results will be incorrect.¶
This need for sequencing is not a problem as long as each time agroup member sends a Commit message, it is based on the mostcurrent state of the group. In practice, however, there is a riskthat two members will generate Commit messages simultaneously,based on the same state.¶
When this happens, there is a need for the members of the group todeconflict the simultaneous Commit messages. There are twogeneral approaches:¶
As long as Commit messages cannot be merged, there is a risk ofstarvation. In a sufficiently busy group, a given member may neverbe able to send a Commit message, because he always loses to othermembers. The degree to which this is a practical problem will dependon the dynamics of the application.¶
It might be possible, because of the non-contributivity of intermediatenodes, that Commit messages could be applied one after the otherwithout the Delivery Service having to reject any Commit message,which would make MLS more resilient regarding the concurrency ofCommit messages.The Messaging system can decide to choose the order for applyingthe state changes. Note that there are certain cases (if no totalordering is applied by the Delivery Service) where the ordering isimportant for security, ie. all updates must be executed beforeremoves.¶
Regardless of how messages are kept in sequence, implementationsMUST only update their cryptographic state when valid Commitmessages are received.Generation of Commit messages MUST NOT modify a client's state, since theendpoint doesn't know at that time whether the changes implied bythe Commit message will succeed or not.¶
With this approach, the Delivery Service ensures that incomingmessages are added to an ordered queue and outgoing messages aredispatched in the same order. The server is trusted to break tieswhen two members send a Commit message at the same time.¶
Messages should have a counter field sent in clear-text that canbe checked by the server and used for tie-breaking. The counterstarts at 0 and is incremented for every new incoming message.If two group members send a message with the same counter, thefirst message to arrive will be accepted by the server and thesecond one will be rejected. The rejected message needs to be sentagain with the correct counter number.¶
To prevent counter manipulation by the server, the counter'sintegrity can be ensured by including the counter in a signedmessage envelope.¶
This applies to all messages, not only state changing messages.¶
Order enforcement can be implemented on the client as well,one way to achieve it is to use a two step update protocol: thefirst client sends a proposal to update and the proposal isaccepted when it gets 50%+ approval from the rest of the group,then it sends the approved update. Clients which didn't gettheir proposal accepted, will wait for the winner to send theirupdate before retrying new proposals.¶
While this seems safer as it doesn't rely on the server, it ismore complex and harder to implement. It also could cause starvationfor some clients if they keep failing to get their proposal accepted.¶
The primary purpose of the Handshake protocol is to provide anauthenticated group key exchange to clients. In order to protectApplication messages sent among the members of a group, the Applicationsecret provided by the Handshake key schedule is used to derive noncesand encryption keys for the Message Protection Layer according tothe Application Key Schedule. That is, each epoch is equipped witha fresh Application Key Schedule which consist of a tree of ApplicationSecrets as well as one symmetric ratchet per group member.¶
Each client maintains their own local copy of the Application KeySchedule for each epoch during which they are a group member. Theyderive new keys, nonces and secrets as needed while deleting oldones as soon as they have been used.¶
Application messages MUST be protected with the Authenticated-Encryptionwith Associated-Data (AEAD) encryption scheme associated with theMLS ciphersuite using the common framing mechanism.Note that "Authenticated" in this context does not mean messages areknown to be sent by a specific client but only from a legitimatemember of the group.To authenticate a message from a particular member, signatures arerequired. Handshake messages MUST use asymmetric signatures to stronglyauthenticate the sender of a message.¶
The group members MUST use the AEAD algorithm associated withthe negotiated MLS ciphersuite to AEAD encrypt and decrypt theirApplication messages according to the Message Framing section.¶
The group identifier and epoch allow a recipient to know which group secretsshould be used and from which Epoch secret to start computing other secretsand keys. The sender identifier is used to identify the member'ssymmetric ratchet from the initial group Application secret. The applicationgeneration field is used to determine how far into the ratchet to iterate inorder to reproduce the required AEAD keys and nonce for performing decryption.¶
Application messages SHOULD be padded to provide some resistanceagainst traffic analysis techniques over encrypted traffic.[CLINIC][HCJ16]While MLS might deliver the same payload less frequently acrossa lot of ciphertexts than traditional web servers, it might still providethe attacker enough information to mount an attack. If Alice asks Bob:"When are we going to the movie ?" the answer "Wednesday" might be leakedto an adversary by the ciphertext length. An attacker expecting Alice toanswer Bob with a day of the week might find out the plaintext bycorrelation between the question and the length.¶
Similarly to TLS 1.3, if padding is used, the MLS messages MUST bepadded with zero-valued bytes before AEAD encryption. Upon AEAD decryption,the length field of the plaintext is used to compute the number of bytesto be removed from the plaintext to get the correct data.As the padding mechanism is used to improve protection against trafficanalysis, removal of the padding SHOULD be implemented in a "constant-time"manner at the MLS layer and above layers to prevent timing side-channels thatwould provide attackers with information on the size of the plaintext.The padding length length_of_padding can be chosen at the time of the messageencryption by the sender. Recipients can calculate the padding size from knowingthe total size of the ApplicationPlaintext and the length of the content.¶
During each epoch senders MUST NOT encrypt more data than permitted by thesecurity bounds of the AEAD scheme used.¶
Note that each change to the Group through a Handshake message will also set anewencryption_secret. Hence this change MUST be applied before encryptingany new application message. This is required both to ensure that any usersremoved from the group can no longer receive messages and to (potentially)recover confidentiality and authenticity for future messages despite a paststate compromise.¶
Since each Application message contains the group identifier, the epoch and amessage counter, a client can receive messages out of order.If they are able to retrieve or recompute the correct AEAD decryption keyfrom currently stored cryptographic material clients can decryptthese messages.¶
For usability, MLS clients might be required to keep the AEAD keyand nonce for a certain amount of time to retain the ability to decryptdelayed or out of order messages, possibly still in transit while adecryption is being done.¶
The security goals of MLS are described in[I-D.ietf-mls-architecture].We describe here how the protocol achieves its goals at a high level,though a complete security analysis is outside of the scope of thisdocument.¶
Group secrets are partly derived from the output of a ratchet tree. Ratchettrees work by assigning each member of the group to a leaf in the tree andmaintaining the following property: the private key of a node in the tree isknown only to members of the group that are assigned a leaf in the node'ssubtree. This is called theratchet tree invariant and it makes it possible toencrypt to all group members except one, with a number of ciphertexts that'slogarithmic in the number of group members.¶
The ability to efficiently encrypt to all members except one allows members tobe securely removed from a group. It also allows a member to rotate theirkeypair such that the old private key can no longer be used to decrypt newmessages.¶
The first form of authentication we provide is that group members can verify amessage originated from one of the members of the group. For encrypted messages,this is guaranteed because messages are encrypted with an AEAD under a keyderived from the group secrets. For plaintext messages, this is guaranteed bythe use of amembership_tag which constitutes a MAC over the message, under akey derived from the group secrets.¶
The second form of authentication is that group members can verify a messageoriginated from a particular member of the group. This is guaranteed by adigital signature on each message from the sender's signature key.¶
The signature keys held by group members are critical to the security of MLSagainst active attacks. If a member's signature key is compromised, then anattacker can create KeyPackages impersonating the member; depending on theapplication, this can then allow the attacker to join the group with thecompromised member's identity. For example, if a group has enabled externalparties to join via external commits, then an attacker that has compromised amember's signature key could use an external commit to insert themselves intothe group -- even using a "resync"-style external commit to replace thecompromised member in the group.¶
Applications can mitigate the risks of signature key compromise using pre-sharedkeys. If a group requires joiners to know a PSK in addition to authenticatingwith a credential, then in order to mount an impersonation attack, the attackerwould need to compromise the relevant PSK as well as the victim's signature key.The cost of this mitigation is that the application needs some externalarrangement that ensures that the legitimate members of the group to have therequired PSKs.¶
Post-compromise security is provided between epochs by members regularlyupdating their leaf key in the ratchet tree. Updating their leaf key preventsgroup secrets from continuing to be encrypted to previously compromised publickeys.¶
Forward-secrecy between epochs is provided by deleting private keys from pastversion of the ratchet tree, as this prevents old group secrets from beingre-derived. Forward secrecywithin an epoch is provided by deleting messageencryption keys once they've been used to encrypt or decrypt a message.¶
Post-compromise security is also provided for new groups by members regularlygenerating new InitKeys and uploading them to the Delivery Service, such thatcompromised key material won't be used when the member is added to a new group.¶
InitKeys are intended to be used only once. That is, once an InitKey has beenused to introduce the corresponding client to a group, it SHOULD be deleted fromthe InitKey publication system. Reuse of InitKeys can lead to replay attacks.¶
An application MAY allow for reuse of a "last resort" InitKey in order toprevent denial of service attacks. Since an InitKey is needed to add a clientto a new group, an attacker could prevent a client being added to new groups byexhausting all available InitKeys.¶
It is possible for a malicious member of a group to "fragment" the group bycrafting an invalid UpdatePath. Recall that an UpdatePath encrypts a sequenceof path secrets to different subtrees of the group's ratchet trees. These pathsecrets should be derived in a sequence as described inSection 5.4, but the UpdatePath syntax allows the sender toencrypt arbitrary, unrelated secrets. The syntax also does not guarantee thatthe encrypted path secret encrypted for a given node corresponds to the publickey provided for that node.¶
Both of these types of corruption will cause processing of a Commit to fail forsome members of the group. If the public key for a node does not match the pathsecret, then the members that decrypt that path secret will reject the commitbased on this mismatch. If the path secret sequence is incorrect at some point,then members that can decrypt nodes before that point will compute a differentpublic key for the mismatched node than the one in the UpdatePath, which alsocauses the Commit to fail. Applications SHOULD provide mechanisms for failedcommits to be reported, so that group members who were not able to recognize theerror themselves can reject the commit and roll back to a previous state ifnecessary.¶
Even with such an error reporting mechanism in place, however, it is stillpossible for members to get locked out of the group by a malformed commit.Since malformed Commits can only be recognized by certain members of the group,in an asynchronous application, it may be the case that all members that coulddetect a fault in a Commit are offline. In such a case, the Commit will beaccepted by the group, and the resulting state possibly used as the basis forfurther Commits. When the affected members come back online, they will rejectthe first commit, and thus be unable to catch up with the group.¶
Applications can address this risk by requiring certain members of the group toacknowledge successful processing of a Commit before the group regards theCommit as accepted. The minimum set of acknowledgements necessary to verifythat a Commit is well-formed comprises an acknowledgement from one member pernode in the UpdatePath, that is, one member from each subtree rooted in thecopath node corresponding to the node in the UpdatePath.¶
This document requests the creation of the following new IANA registries:¶
All of these registries should be under a heading of "Messaging Layer Security",and assignments are made via the Specification Required policy[RFC8126]. SeeSection 16.5 for additional information about the MLS Designated Experts (DEs).¶
RFC EDITOR: Please replace XXXX throughout with the RFC number assigned tothis document¶
A ciphersuite is a combination of a protocol version and the set ofcryptographic algorithms that should be used.¶
Ciphersuite names follow the naming convention:¶
CipherSuite MLS_LVL_KEM_AEAD_HASH_SIG = VALUE;¶
Where VALUE is represented as a sixteen-bit integer:¶
uint16 CipherSuite;¶
| Component | Contents |
|---|---|
| MLS | The string "MLS" followed by the major and minor version, e.g. "MLS10" |
| LVL | The security level |
| KEM | The KEM algorithm used for HPKE in TreeKEM group operations |
| AEAD | The AEAD algorithm used for HPKE and message protection |
| HASH | The hash algorithm used for HPKE and the MLS transcript hash |
| SIG | The Signature algorithm used for message authentication |
The columns in the registry are as follows:¶
Initial contents:¶
| Value | Name | Recommended | Reference |
|---|---|---|---|
| 0x0000 | RESERVED | N/A | RFC XXXX |
| 0x0001 | MLS10_128_DHKEMX25519_AES128GCM_SHA256_Ed25519 | Y | RFC XXXX |
| 0x0002 | MLS10_128_DHKEMP256_AES128GCM_SHA256_P256 | Y | RFC XXXX |
| 0x0003 | MLS10_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519 | Y | RFC XXXX |
| 0x0004 | MLS10_256_DHKEMX448_AES256GCM_SHA512_Ed448 | Y | RFC XXXX |
| 0x0005 | MLS10_256_DHKEMP521_AES256GCM_SHA512_P521 | Y | RFC XXXX |
| 0x0006 | MLS10_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448 | Y | RFC XXXX |
| 0xff00 - 0xffff | Reserved for Private Use | N/A | RFC XXXX |
All of these ciphersuites use HMAC[RFC2104] as their MAC function, withdifferent hashes per ciphersuite. The mapping of ciphersuites to HPKEprimitives, HMAC hash functions, and TLS signature schemes is as follows[I-D.irtf-cfrg-hpke][RFC8446]:¶
| Value | KEM | KDF | AEAD | Hash | Signature |
|---|---|---|---|---|---|
| 0x0001 | 0x0020 | 0x0001 | 0x0001 | SHA256 | ed25519 |
| 0x0002 | 0x0010 | 0x0001 | 0x0001 | SHA256 | ecdsa_secp256r1_sha256 |
| 0x0003 | 0x0020 | 0x0001 | 0x0003 | SHA256 | ed25519 |
| 0x0004 | 0x0021 | 0x0003 | 0x0002 | SHA512 | ed448 |
| 0x0005 | 0x0012 | 0x0003 | 0x0002 | SHA512 | ecdsa_secp521r1_sha512 |
| 0x0006 | 0x0021 | 0x0003 | 0x0003 | SHA512 | ed448 |
The hash used for the MLS transcript hash is the one referenced in theciphersuite name. In the ciphersuites defined above, "SHA256" and "SHA512"refer to the SHA-256 and SHA-512 functions defined in[SHS].¶
It is advisable to keep the number of ciphersuites low to increase the chancesclients can interoperate in a federated environment, therefore the ciphersuitesonly inlcude modern, yet well-established algorithms. Depending on theirrequirements, clients can choose between two security levels (roughly 128-bitand 256-bit). Within the security levels clients can choose between fasterX25519/X448 curves and FIPS 140-2 compliant curves for Diffie-Hellman keynegotiations. Additionally clients that run predominantly on mobile processorscan choose ChaCha20Poly1305 over AES-GCM for performance reasons. SinceChaCha20Poly1305 is not listed by FIPS 140-2 it is not paired with FIPS 140-2compliant curves. The security level of symmetric encryption algorithms and hashfunctions is paired with the security level of the curves.¶
The mandatory-to-implement ciphersuite for MLS 1.0 isMLS10_128_DHKEMX25519_AES128GCM_SHA256_Ed25519 which usesCurve25519 for key exchange, AES-128-GCM for HPKE, HKDF over SHA2-256, andEd25519 for signatures.¶
Values with the first byte 255 (decimal) are reserved for Private Use.¶
New ciphersuite values are assigned by IANA as described inSection 16.¶
This registry lists identifiers for extensions to the MLS protocol. Theextension type field is two bytes wide, so valid extension type values are inthe range 0x0000 to 0xffff.¶
Template:¶
Message(s): The messages in which the extension may appear, drawn from the followinglist:¶
Initial contents:¶
| Value | Name | Message(s) | Recommended | Reference |
|---|---|---|---|---|
| 0x0000 | RESERVED | N/A | N/A | RFC XXXX |
| 0x0001 | capabilities | KP | Y | RFC XXXX |
| 0x0002 | lifetime | KP | Y | RFC XXXX |
| 0x0003 | external_key_id | KP | Y | RFC XXXX |
| 0x0004 | parent_hash | KP | Y | RFC XXXX |
| 0x0005 | ratchet_tree | GI | Y | RFC XXXX |
| 0xff00 - 0xffff | Reserved for Private Use | N/A | N/A | RFC XXXX |
This registry lists identifiers for types of proposals that can be made forchanges to an MLS group. The extension type field is two bytes wide, so validextension type values are in the range 0x0000 to 0xffff.¶
Template:¶
Initial contents:¶
| Value | Name | Recommended | Reference |
|---|---|---|---|
| 0x0000 | RESERVED | N/A | RFC XXXX |
| 0x0001 | add | Y | RFC XXXX |
| 0x0002 | update | Y | RFC XXXX |
| 0x0003 | remove | Y | RFC XXXX |
| 0x0004 | psk | Y | RFC XXXX |
| 0x0005 | reinit | Y | RFC XXXX |
| 0x0006 | external_init | Y | RFC XXXX |
| 0x0007 | app_ack | Y | RFC XXXX |
| 0x0008 | group_context_extensions | Y | RFC XXXX |
| 0xff00 - 0xffff | Reserved for Private Use | N/A | RFC XXXX |
This registry lists identifiers for types of credentials that can be used forauthentication in the MLS protocol. The credential type field is two bytes wide,so valid credential type values are in the range 0x0000 to 0xffff.¶
Template:¶
Initial contents:¶
| Value | Name | Recommended | Reference |
|---|---|---|---|
| 0x0000 | RESERVED | N/A | RFC XXXX |
| 0x0001 | basic | Y | RFC XXXX |
| 0x0002 | x509 | Y | RFC XXXX |
| 0xff00 - 0xffff | Reserved for Private Use | N/A | RFC XXXX |
Specification Required[RFC8126] registry requests are registeredafter a three-week review period on the MLS DEs' mailing list:mls-reg-review@ietf.org, on the advice of one or more of the MLS DEs. However,to allow for the allocation of values prior to publication, the MLSDEs may approve registration once they are satisfied that such aspecification will be published.¶
Registration requests sent to the MLS DEs mailing list for reviewSHOULD use an appropriate subject (e.g., "Request to register valuein MLS Bar registry").¶
Within the review period, the MLS DEs will either approve or denythe registration request, communicating this decision to the MLS DEsmailing list and IANA. Denials SHOULD include an explanation and, ifapplicable, suggestions as to how to make the request successful.Registration requests that are undetermined for a period longer than21 days can be brought to the IESG's attention for resolution usingtheiesg@ietf.org mailing list.¶
Criteria that SHOULD be applied by the MLS DEs includes determiningwhether the proposed registration duplicates existing functionality,whether it is likely to be of general applicability or useful onlyfor a single application, and whether the registration descriptionis clear. For example, the MLS DEs will apply the ciphersuite-relatedadvisory found inSection 6.1.¶
IANA MUST only accept registry updates from the MLS DEs and SHOULDdirect all requests for registration to the MLS DEs' mailing list.¶
It is suggested that multiple MLS DEs be appointed who are able torepresent the perspectives of different applications using thisspecification, in order to enable broadly informed review ofregistration decisions. In cases where a registration decision couldbe perceived as creating a conflict of interest for a particularMLS DE, that MLS DE SHOULD defer to the judgment of the other MLS DEs.¶
One benefit of using left-balanced trees is that they admit a simpleflat array representation. In this representation, leaf nodes areeven-numbered nodes, with the n-th leaf at 2*n. Intermediate nodesare held in odd-numbered nodes. For example, an 11-element tree hasthe following structure:¶
X X X X X X X X X XX X X X X X X X X X X0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20¶
This allows us to compute relationships between tree nodes simply bymanipulating indices, rather than having to maintain complicatedstructures in memory, even for partial trees. The basicrule is that the high-order bits of parent and child nodes have thefollowing relation (wherex is an arbitrary bit string):¶
parent=01x => left=00x, right=10x¶
The following python code demonstrates the tree computationsnecessary for MLS. Test vectors can be derived from the diagramabove.¶
# The exponent of the largest power of 2 less than x. Equivalent to:# int(math.floor(math.log(x, 2)))def log2(x): if x == 0: return 0 k = 0 while (x >> k) > 0: k += 1 return k-1# The level of a node in the tree. Leaves are level 0, their parents are# level 1, etc. If a node's children are at different levels, then its# level is the max level of its children plus one.def level(x): if x & 0x01 == 0: return 0 k = 0 while ((x >> k) & 0x01) == 1: k += 1 return k# The number of nodes needed to represent a tree with n leaves.def node_width(n): if n == 0: return 0 else: return 2*(n - 1) + 1# The index of the root node of a tree with n leaves.def root(n): w = node_width(n) return (1 << log2(w)) - 1# The left child of an intermediate node. Note that because the tree is# left-balanced, there is no dependency on the size of the tree.def left(x): k = level(x) if k == 0: raise Exception('leaf node has no children') return x ^ (0x01 << (k - 1))# The right child of an intermediate node. Depends on the number of# leaves because the straightforward calculation can take you beyond the# edge of the tree.def right(x, n): k = level(x) if k == 0: raise Exception('leaf node has no children') r = x ^ (0x03 << (k - 1)) while r >= node_width(n): r = left(r) return r# The immediate parent of a node. May be beyond the right edge of the# tree.def parent_step(x): k = level(x) b = (x >> (k + 1)) & 0x01 return (x | (1 << k)) ^ (b << (k + 1))# The parent of a node. As with the right child calculation, we have to# walk back until the parent is within the range of the tree.def parent(x, n): if x == root(n): raise Exception('root node has no parent') p = parent_step(x) while p >= node_width(n): p = parent_step(p) return p# The other child of the node's parent.def sibling(x, n): p = parent(x, n) if x < p: return right(p, n) else: return left(p)# The direct path of a node, ordered from leaf to root.def direct_path(x, n): r = root(n) if x == r: return [] d = [] while x != r: x = parent(x, n) d.append(x) return d# The copath of a node, ordered from leaf to root.def copath(x, n): if x == root(n): return [] d = direct_path(x, n) d.insert(0, x) d.pop() return [sibling(y, n) for y in d]# The common ancestor of two nodes is the lowest node that is in the# direct paths of both leaves.def common_ancestor_semantic(x, y, n): dx = set([x]) | set(direct_path(x, n)) dy = set([y]) | set(direct_path(y, n)) dxy = dx & dy if len(dxy) == 0: raise Exception('failed to find common ancestor') return min(dxy, key=level)# The common ancestor of two nodes is the lowest node that is in the# direct paths of both leaves.def common_ancestor_direct(x, y, _): # Handle cases where one is an ancestor of the other lx, ly = level(x)+1, level(y)+1 if (lx <= ly) and (x>>ly == y>>ly): return y elif (ly <= lx) and (x>>lx == y>>lx): return x # Handle other cases xn, yn = x, y k = 0 while xn != yn: xn, yn = xn >> 1, yn >> 1 k += 1 return (xn << k) + (1 << (k-1)) - 1¶ draft-ietf-mls-protocol-12
| Document | Document type | This is an older version of an Internet-Draft that was ultimately published asRFC 9420. | |
|---|---|---|---|
| Select version | |||
| Compare versions | |||
| Authors | Richard Barnes,Benjamin Beurdouche,Raphael Robert,Jon Millican,Emad Omara,Katriel Cohn-Gordon | ||
| Replaces | draft-barnes-mls-protocol | ||
| RFC stream | |||
| Other formats | |||
| Additional resources | Mailing list discussion |