mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-08-05 07:27:52 +02:00
Compare commits
1 commit
5bb777284e
...
1420a341f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1420a341f7 |
|
|
@ -1 +0,0 @@
|
||||||
Add further normative language in mutual rooms server behaviour.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Use MXC URI type for all user `avatar_url` fields. Contributed by @networkException.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Fix typesetting of some symbols in the Olm/Megolm spec.
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
#### Server behaviour
|
#### Server behaviour
|
||||||
|
|
||||||
The server MAY decide that the response to this endpoint is too large, and only return a
|
The server may decide that the response to this endpoint is too large, and only return a
|
||||||
subset of the results. In this case, the server populates the optional field `next_batch`
|
subset of the results. In this case, the server should populate the optional field `next_batch`
|
||||||
with an [opaque identifier](/appendices/#opaque-identifiers). The client can then supply
|
with an [opaque identifier](/appendices/#opaque-identifiers). The client may then supply
|
||||||
the identifier as the `from` query parameter in a subsequent request, along with the original
|
the identifier as the `from` query parameter in a subsequent request, along with the original
|
||||||
`user_id`, to fetch the next batch of responses. This will continue until the server no longer
|
`user_id`, to fetch the next batch of responses. This will continue until the server no longer
|
||||||
inserts `next_batch`, meaning there are no further results.
|
inserts `next_batch`, meaning there are no further results.
|
||||||
|
|
|
||||||
|
|
@ -257,8 +257,8 @@ consists of the following key-value pairs:
|
||||||
|
|
||||||
**Name**|**Tag**|**Type**|**Meaning**
|
**Name**|**Tag**|**Type**|**Meaning**
|
||||||
:-----:|:-----:|:-----:|:-----:
|
:-----:|:-----:|:-----:|:-----:
|
||||||
Message-Index|0x08|Integer|The index of the ratchet, \(i\).
|
Message-Index|0x08|Integer|The index of the ratchet, i
|
||||||
Cipher-Text|0x12|String|The cipher-text of the message, \(X_i\).
|
Cipher-Text|0x12|String|The cipher-text, Xi, of the message
|
||||||
|
|
||||||
Within the payload, integers are encoded using a variable length encoding. Each
|
Within the payload, integers are encoded using a variable length encoding. Each
|
||||||
integer is encoded as a sequence of bytes with the high bit set followed by a
|
integer is encoded as a sequence of bytes with the high bit set followed by a
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,12 @@ side of an \(=\) it means that the output is split.
|
||||||
When this document uses \(\operatorname{ECDH}\left(K_A,K_B\right)\) it means
|
When this document uses \(\operatorname{ECDH}\left(K_A,K_B\right)\) it means
|
||||||
that each party computes a Diffie-Hellman agreement using their private key
|
that each party computes a Diffie-Hellman agreement using their private key
|
||||||
and the remote party's public key.
|
and the remote party's public key.
|
||||||
So party \(A\) computes \(\operatorname{ECDH}\left(K_B^{\mathit{public}},K_A^{\mathit{private}}\right)\)
|
So party \(A\) computes \(\operatorname{ECDH}\left(K_B^{public},K_A^{private}\right)\)
|
||||||
and party \(B\) computes \(\operatorname{ECDH}\left(K_A^{\mathit{public}},K_B^{\mathit{private}}\right)\).
|
and party \(B\) computes \(\operatorname{ECDH}\left(K_A^{public},K_B^{private}\right)\).
|
||||||
|
|
||||||
Where this document uses \(\operatorname{HKDF}\left(\mathit{salt},\mathit{IKM},\mathit{info},L\right)\) it
|
Where this document uses \(\operatorname{HKDF}\left(salt,IKM,info,L\right)\) it
|
||||||
refers to the [HMAC-based key derivation function][] with a salt value of
|
refers to the [HMAC-based key derivation function][] with a salt value of
|
||||||
\(\mathit{salt}\), input key material of \(\mathit{IKM}\), context string \(\mathit{info}\),
|
\(salt\), input key material of \(IKM\), context string \(info\),
|
||||||
and output keying material length of \(L\) bytes.
|
and output keying material length of \(L\) bytes.
|
||||||
|
|
||||||
## The Olm Algorithm
|
## The Olm Algorithm
|
||||||
|
|
@ -226,9 +226,9 @@ significant bits are stored in the first byte.
|
||||||
|
|
||||||
**Name**|**Tag**|**Type**|**Meaning**
|
**Name**|**Tag**|**Type**|**Meaning**
|
||||||
:-----:|:-----:|:-----:|:-----:
|
:-----:|:-----:|:-----:|:-----:
|
||||||
Ratchet-Key|0x0A|String|The public part of the ratchet key of the message, \(T_i\).
|
Ratchet-Key|0x0A|String|The public part of the ratchet key, Ti, of the message
|
||||||
Chain-Index|0x10|Integer|The chain index of the message, \(j\).
|
Chain-Index|0x10|Integer|The chain index, j, of the message
|
||||||
Cipher-Text|0x22|String|The cipher-text of the message, \(X_{i,j}\).
|
Cipher-Text|0x22|String|The cipher-text, Xi, j, of the message
|
||||||
|
|
||||||
The length of the MAC is determined by the authenticated encryption algorithm
|
The length of the MAC is determined by the authenticated encryption algorithm
|
||||||
being used. (Olm version 1 uses [HMAC-SHA-256][], truncated to 8 bytes). The
|
being used. (Olm version 1 uses [HMAC-SHA-256][], truncated to 8 bytes). The
|
||||||
|
|
@ -251,9 +251,9 @@ The payload uses the same key-value format as for normal messages.
|
||||||
|
|
||||||
**Name**|**Tag**|**Type**|**Meaning**
|
**Name**|**Tag**|**Type**|**Meaning**
|
||||||
:-----:|:-----:|:-----:|:-----:
|
:-----:|:-----:|:-----:|:-----:
|
||||||
One-Time-Key|0x0A|String|The public part of Bob's single-use key, \(E_B\).
|
One-Time-Key|0x0A|String|The public part of Bob's single-use key, Eb.
|
||||||
Base-Key|0x12|String|The public part of Alice's single-use key, \(E_A\).
|
Base-Key|0x12|String|The public part of Alice's single-use key, Ea.
|
||||||
Identity-Key|0x1A|String|The public part of Alice's identity key, \(I_A\).
|
Identity-Key|0x1A|String|The public part of Alice's identity key, Ia.
|
||||||
Message|0x22|String|An embedded Olm message with its own version and MAC.
|
Message|0x22|String|An embedded Olm message with its own version and MAC.
|
||||||
|
|
||||||
## Olm Authenticated Encryption
|
## Olm Authenticated Encryption
|
||||||
|
|
@ -268,13 +268,13 @@ message key using [HKDF-SHA-256][] using the default salt and an info of
|
||||||
|
|
||||||
\[
|
\[
|
||||||
\begin{aligned}
|
\begin{aligned}
|
||||||
\mathit{AES\_KEY}_{i,j}\;\parallel\;\mathit{HMAC\_KEY}_{i,j}\;\parallel\;\mathit{AES\_IV}_{i,j}
|
AES\_KEY_{i,j}\;\parallel\;HMAC\_KEY_{i,j}\;\parallel\;AES\_IV_{i,j}
|
||||||
&= \operatorname{HKDF}\left(0,M_{i,j},\text{``OLM\_KEYS"},80\right)
|
&= \operatorname{HKDF}\left(0,M_{i,j},\text{``OLM\_KEYS"},80\right)
|
||||||
\end{aligned}
|
\end{aligned}
|
||||||
\]
|
\]
|
||||||
|
|
||||||
The plain-text is encrypted with AES-256, using the key \(\mathit{AES\_KEY}_{i,j}\)
|
The plain-text is encrypted with AES-256, using the key \(AES\_KEY_{i,j}\)
|
||||||
and the IV \(\mathit{AES\_IV}_{i,j}\) to give the cipher-text, \(X_{i,j}\).
|
and the IV \(AES\_IV_{i,j}\) to give the cipher-text, \(X_{i,j}\).
|
||||||
|
|
||||||
Then the entire message (including the Version Byte and all Payload Bytes) are
|
Then the entire message (including the Version Byte and all Payload Bytes) are
|
||||||
passed through [HMAC-SHA-256][]. The first 8 bytes of the MAC are appended to the message.
|
passed through [HMAC-SHA-256][]. The first 8 bytes of the MAC are appended to the message.
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,7 @@ properties:
|
||||||
example: true
|
example: true
|
||||||
avatar_url:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
format: mx-mxc-uri
|
format: uri
|
||||||
pattern: "^mxc:\\/\\/"
|
|
||||||
description: The URL for the room's avatar, if one is set.
|
description: The URL for the room's avatar, if one is set.
|
||||||
example: "mxc://example.org/abcdef"
|
example: "mxc://example.org/abcdef"
|
||||||
join_rule:
|
join_rule:
|
||||||
|
|
|
||||||
|
|
@ -335,8 +335,7 @@ paths:
|
||||||
description: The display name of the user this object is representing.
|
description: The display name of the user this object is representing.
|
||||||
avatar_url:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
format: mx-mxc-uri
|
format: uri
|
||||||
pattern: "^mxc:\\/\\/"
|
|
||||||
description: The avatar of the user this object is representing, as an [`mxc://`
|
description: The avatar of the user this object is representing, as an [`mxc://`
|
||||||
URI](/client-server-api/#matrix-content-mxc-uris).
|
URI](/client-server-api/#matrix-content-mxc-uris).
|
||||||
description: A map from user ID to a RoomMember object.
|
description: A map from user ID to a RoomMember object.
|
||||||
|
|
|
||||||
|
|
@ -237,8 +237,7 @@ paths:
|
||||||
title: Display name
|
title: Display name
|
||||||
avatar_url:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
format: mx-mxc-uri
|
format: uri
|
||||||
pattern: "^mxc:\\/\\/"
|
|
||||||
title: Avatar Url
|
title: Avatar Url
|
||||||
events_before:
|
events_before:
|
||||||
type: array
|
type: array
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,7 @@ paths:
|
||||||
description: The display name of the user, if one exists.
|
description: The display name of the user, if one exists.
|
||||||
avatar_url:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
format: mx-mxc-uri
|
format: uri
|
||||||
pattern: "^mxc:\\/\\/"
|
|
||||||
example: mxc://bar.com/foo
|
example: mxc://bar.com/foo
|
||||||
description: The avatar url, as an [`mxc://`
|
description: The avatar url, as an [`mxc://`
|
||||||
URI](/client-server-api/#matrix-content-mxc-uris),
|
URI](/client-server-api/#matrix-content-mxc-uris),
|
||||||
|
|
|
||||||
|
|
@ -172,8 +172,6 @@ paths:
|
||||||
example: John Doe
|
example: John Doe
|
||||||
avatar_url:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
format: mx-mxc-uri
|
|
||||||
pattern: "^mxc:\\/\\/"
|
|
||||||
description: |-
|
description: |-
|
||||||
The avatar URL for the user's avatar. MUST either be omitted or set to
|
The avatar URL for the user's avatar. MUST either be omitted or set to
|
||||||
`null` if the user does not have an avatar set.
|
`null` if the user does not have an avatar set.
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"avatar_url": {
|
"avatar_url": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "mx-mxc-uri",
|
|
||||||
"pattern": "^mxc:\\/\\/",
|
|
||||||
"description": "The current avatar URL for this user, if any."
|
"description": "The current avatar URL for this user, if any."
|
||||||
},
|
},
|
||||||
"displayname": {
|
"displayname": {
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,7 @@ properties:
|
||||||
avatar_url:
|
avatar_url:
|
||||||
description: 'The avatar URL for this user, if any.'
|
description: 'The avatar URL for this user, if any.'
|
||||||
type: string
|
type: string
|
||||||
format: mx-mxc-uri
|
format: uri
|
||||||
pattern: "^mxc:\\/\\/"
|
|
||||||
displayname:
|
displayname:
|
||||||
description: 'The display name for this user, if any.'
|
description: 'The display name for this user, if any.'
|
||||||
type:
|
type:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue