Skip to content

Commit 18457c7

Browse files
authored
OCM/OCM-MLS: Standardize on base64url (#383)
1 parent f04c2c1 commit 18457c7

3 files changed

Lines changed: 49 additions & 31 deletions

File tree

IETF-OCM-MLS.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
137137
[RFC2119] [RFC8174] when, and only when, they appear in all capitals, as
138138
shown here.
139139

140+
Unless stated otherwise, every base64 encoded value this document,
141+
including MLS wire-format messages, KeyPackages, `group_id` values, and
142+
wrapped keys, is encoded using base64url (the URL- and filename-safe
143+
alphabet defined in [RFC4648], Section 5) with padding omitted. A
144+
decoder MUST accept such a value whether or not padding is present.
145+
140146
This document uses terminology from [OCM] and [RFC9420]. Additional
141147
definitions:
142148

@@ -402,8 +408,8 @@ Response:
402408
"keyPackages": [
403409
{
404410
"mediaType": "message/mls",
405-
"encoding": "base64",
406-
"content": "<base64-encoded MLS KeyPackage>"
411+
"encoding": "base64url",
412+
"content": "<base64url-encoded MLS KeyPackage>"
407413
}
408414
]
409415
}
@@ -671,7 +677,7 @@ that requirement: `providerId` is REQUIRED only for notification types
671677
that refer to a Share, and the MLS notification types omit it. All
672678
MLS-specific parameters are carried inside the `notification` object
673679
that [OCM] provides for type-specific parameters. The `mlsGroupId`
674-
field carries the base64-encoded MLS `group_id` as advisory routing
680+
field carries the base64url-encoded MLS `group_id` as advisory routing
675681
information, used to dispatch the message to the right group state
676682
without parsing the MLS message; the authoritative `group_id` is the one
677683
inside the MLS message itself, and a mismatch between the two MUST be
@@ -704,9 +710,9 @@ added user.
704710
{
705711
"notificationType": "MLS_WELCOME",
706712
"notification": {
707-
"mlsGroupId": "<base64 MLS group ID>",
713+
"mlsGroupId": "<base64url MLS group ID>",
708714
"userId": "bob@othercloud.example.org",
709-
"content": "<base64 MLS Welcome wire format>"
715+
"content": "<base64url MLS Welcome wire format>"
710716
}
711717
}
712718
~~~
@@ -744,8 +750,8 @@ act on it.
744750
{
745751
"notificationType": "MLS_PROPOSAL",
746752
"notification": {
747-
"mlsGroupId": "<base64 MLS group ID>",
748-
"content": "<base64 MLS PublicMessage carrying the Proposal>"
753+
"mlsGroupId": "<base64url MLS group ID>",
754+
"content": "<base64url MLS PublicMessage carrying the Proposal>"
749755
}
750756
}
751757
~~~
@@ -772,9 +778,9 @@ data, per [RFC9420] Section 15.2.
772778
{
773779
"notificationType": "MLS_COMMIT",
774780
"notification": {
775-
"mlsGroupId": "<base64 MLS group ID>",
776-
"proposals": ["<base64 MLS PublicMessage carrying a Proposal>"],
777-
"content": "<base64 MLS PublicMessage carrying the Commit>"
781+
"mlsGroupId": "<base64url MLS group ID>",
782+
"proposals": ["<base64url MLS PublicMessage carrying a Proposal>"],
783+
"content": "<base64url MLS PublicMessage carrying the Commit>"
778784
}
779785
}
780786
~~~
@@ -818,8 +824,8 @@ epoch ([RFC9420] Section 15).
818824
{
819825
"notificationType": "MLS_APPLICATION",
820826
"notification": {
821-
"mlsGroupId": "<base64 MLS group ID>",
822-
"content": "<base64 MLS PrivateMessage wire format>"
827+
"mlsGroupId": "<base64url MLS group ID>",
828+
"content": "<base64url MLS PrivateMessage wire format>"
823829
}
824830
}
825831
~~~
@@ -859,13 +865,13 @@ by the KeyPackage endpoint.
859865
{
860866
"notificationType": "MLS_REJOIN",
861867
"notification": {
862-
"mlsGroupId": "<base64 MLS group ID>",
868+
"mlsGroupId": "<base64url MLS group ID>",
863869
"keyPackages": [
864870
{
865871
"userId": "bob@othercloud.example.org",
866872
"mediaType": "message/mls",
867-
"encoding": "base64",
868-
"content": "<base64-encoded MLS KeyPackage>"
873+
"encoding": "base64url",
874+
"content": "<base64url-encoded MLS KeyPackage>"
869875
}
870876
]
871877
}
@@ -1169,7 +1175,7 @@ array, and MAY also carry a `credentials` array ({{credential-update}}):
11691175
{
11701176
"resourceId": "3a02538b-aa54-42f2-8853-a38996e211b1",
11711177
"groupId": "research-group@receiver.example.org",
1172-
"wrappedKey": "<base64 nonce || wrapped_file_key || tag>"
1178+
"wrappedKey": "<base64url nonce || wrapped_file_key || tag>"
11731179
}
11741180
]
11751181
}
@@ -1916,6 +1922,10 @@ Work in Progress, Internet-Draft.
19161922
Requirement Levels](https://datatracker.ietf.org/doc/html/rfc2119)",
19171923
March 1997.
19181924

1925+
[RFC4648] Josefsson, S. "[The Base16, Base32, and Base64 Data
1926+
Encodings](https://datatracker.ietf.org/doc/html/rfc4648)", October
1927+
2006.
1928+
19191929
[RFC7517] Jones, M., "[JSON Web Key
19201930
(JWK)](https://datatracker.ietf.org/doc/html/rfc7517)", May 2015.
19211931

IETF-OCM.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ related concepts from OAuth [RFC6749] and elsewhere:
124124
* __Invite Sender OCM Server__ - The server holding an address book
125125
used by the Invite Sender, to which details of the Invite Receiver are
126126
to be added.
127-
* __Invite String__ - A base64 encoded string containing an Invite Token
128-
and the FQDN of an Invite Sender OCM Server joined by an `@`-sign.
127+
* __Invite String__ - An Invite Token and the FQDN of an Invite Sender
128+
OCM Server joined by an `@`-sign, then encoded using base64url (the
129+
URL- and filename-safe alphabet defined in [RFC4648], Section 5) with
130+
padding omitted.
129131
* __Invite Token__ - A hard-to-guess string used in the Invite Flow,
130132
generated by the Invite Sender OCM Server and linked uniquely to the
131133
Invite Sender's OCM Address.
@@ -472,19 +474,21 @@ To accept an invite, two pieces of information are required: a `token`
472474
and a `provider`. There are two recognized formats:
473475

474476
* **Invite string format:**
475-
A base64-encoded string containing the token and the provider’s FQDN,
476-
joined by an `@` sign. Example:
477+
The token and the provider’s FQDN, joined by an `@` sign and then
478+
encoded using base64url (the URL- and filename-safe alphabet defined
479+
in [RFC4648], Section 5) with padding omitted. Example:
477480

478481
If the `token` is `a55a966e-15c1-4cb9-a39d-4e4c54399baf` and the
479482
`provider` is `cloud.example.org`, the combined string is
480483
`a55a966e-15c1-4cb9-a39d-4e4c54399baf@cloud.example.org`,
481-
which when base64-encoded becomes
482-
`YTU1YTk2NmUtMTVjMS00Y2I5LWEzOWQtNGU0YzU0Mzk5YmFmQG15LWNsb3VkLXN0b
483-
3JhZ2Uub3Jn`.
484+
which when base64url-encoded becomes
485+
`YTU1YTk2NmUtMTVjMS00Y2I5LWEzOWQtNGU0YzU0Mzk5YmFmQGNsb3VkLmV4YW1wbGUu
486+
b3Jn`.
484487

485-
When parsing an invite string, implementors must base64-decode it,
486-
then split on the last `@` sign, taking care to allow multiple `@`
487-
characters in the token part.
488+
When parsing an invite string, implementors MUST base64url-decode it
489+
(accepting the string whether or not padding is present), then split
490+
on the last `@` sign, taking care to allow multiple `@` characters in
491+
the token part.
488492

489493
* **Link format:**
490494
If the inviting OCM Server supports a WAYF page, the invite may be
@@ -1734,6 +1738,10 @@ March 1997.
17341738
"[Uniform Resource Identifier (URI): Generic Syntax
17351739
](https://datatracker.ietf.org/doc/html/rfc3986)", January 2005
17361740

1741+
[RFC4648] Josefsson, S. "[The Base16, Base32, and Base64 Data
1742+
Encodings](https://datatracker.ietf.org/doc/html/rfc4648)", October
1743+
2006.
1744+
17371745
[RFC4918] Dusseault, L. M. "[HTTP Extensions for Web Distributed
17381746
Authoring and Versioning](https://datatracker.ietf.org/html/rfc4918/)",
17391747
June 2007.
@@ -1777,13 +1785,13 @@ https://datatracker.ietf.org/doc/html/rfc9553), May 2024"
17771785

17781786
## Informative References
17791787

1780-
[OCM-IP] Nordin, M., Lo Presti, G., and Baghbani, M. "[Open
1781-
Cloud Mesh Integration
1788+
[OCM-IP] Nordin, M., Lo Presti, G., and Baghbani, M. "[Open Cloud Mesh
1789+
Integration
17821790
Protocol](https://datatracker.ietf.org/doc/draft-nordin-ocm-integration-protocol/)",
17831791
Work in Progress, Internet-Draft.
17841792

1785-
[OCM-MLS] Nordin, M., Lo Presti, G., and Baghbani, M. "[Federated
1786-
Groups in Open Cloud Mesh using Messaging Layer
1793+
[OCM-MLS] Nordin, M., Lo Presti, G., and Baghbani, M. "[Federated Groups
1794+
in Open Cloud Mesh using Messaging Layer
17871795
Security](https://datatracker.ietf.org/doc/draft-nordin-ocm-mls-federated-groups/)",
17881796
Work in Progress, Internet-Draft.
17891797

diagrams/invitation-flow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sequenceDiagram
3131
alt
3232
HTTPA ->> UserB: Send Email with Alice's Server FQDN and Token
3333
else
34-
HTTPA ->> UserA: Raw or Base64 encoded "token@FQDN"
34+
HTTPA ->> UserA: Raw or base64url encoded "token@FQDN"
3535
UserA ->> UserB: Aice passes token to Bob
3636
end
3737

0 commit comments

Comments
 (0)