Compare commits

...

3 commits

Author SHA1 Message Date
Richard van der Hoff 126c3f0a49 Define history_not_shared withheld code. 2026-06-23 15:49:20 +01:00
Richard van der Hoff adde146d48 Add more string formats 2026-06-23 15:35:57 +01:00
Richard van der Hoff 141cc8e11c
Apply suggestions from code review
Co-authored-by: Kévin Commaille <76261501+zecakeh@users.noreply.github.com>
2026-06-23 15:31:14 +01:00
5 changed files with 21 additions and 3 deletions

View file

@ -1624,7 +1624,7 @@ Otherwise, before inviting Bob to a room, Alice's client constructs and sends a
containing the sessions she is aware of in the room. Alice MUST include
only [shareable encryption sessions](#shareable-encryption-sessions) in the
`room_keys` section of the structure; other sessions SHOULD be listed in the
with `withheld` section.
`withheld` section.
3. The client serialises the `RoomKeyBundle` as JSON.

View file

@ -41,6 +41,8 @@ properties:
example: "m.megolm.v1.aes-sha2"
room_id:
type: string
format: mx-room-id
pattern: "^!"
description: |-
The room where the session is used.
example: "!Cuyf34gef24t:localhost"
@ -48,6 +50,7 @@ properties:
type: object
additionalProperties:
type: string
format: mx-unpadded-base64
description: |-
A map from algorithm name (`ed25519`) to the Ed25519 signing key of
the device which initiated the session originally, according to the
@ -55,6 +58,7 @@ properties:
example: { "ed25519": "aj40p+aw64yPIdsxoog8jhPu9i7l7NcFRecuOQblE3Y" }
sender_key:
type: string
format: mx-unpadded-base64
description: |-
Unpadded base64-encoded device Curve25519 key, of the device which
initiated the session originally, according to the creator of this
@ -67,9 +71,10 @@ properties:
example: "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ"
session_key:
type: string
format: mx-unpadded-base64
description: |-
Unpadded base64-encoded session key in [session-export
format](https://gitlab.matrix.org/matrix-org/olm/blob/master/docs/megolm.md#session-export-format).
format](/olm-megolm/megolm/#session-export-format).
example: "AgAAAADxKHa9uFxcXzwYoNueL5Xqi69IkD4sni8Llf..."
required:
- algorithm

View file

@ -7,6 +7,8 @@ properties:
The encryption algorithm for the key that this event is about.
room_id:
type: string
format: mx-room-id
pattern: "^!"
description: |-
Required if `code` is not `m.no_olm`. The room for the key that
this event is about.
@ -17,6 +19,7 @@ properties:
that this event is about.
sender_key:
type: string
format: mx-unpadded-base64
description: |-
The unpadded base64-encoded device curve25519 key of the event\'s
sender.
@ -28,6 +31,7 @@ properties:
- m.unauthorised
- m.unavailable
- m.no_olm
- m.history_not_shared
description: |-
A machine-readable code for why the key was not sent. Codes beginning
with `m.` are reserved for codes defined in the Matrix

View file

@ -8,7 +8,7 @@ description: |-
This event type is used to indicate that the sender is not sharing room keys
with the recipient. It is sent as a to-device event.
Possible values for `code` include:
The following values for `code` are defined:
* `m.blacklisted`: the user/device was blacklisted.
* `m.unverified`: the user/device was not verified, and the sender is only
@ -19,6 +19,13 @@ description: |-
* `m.unavailable`: sent in reply to a key request if the device that the
key is requested from does not have the requested key.
* `m.no_olm`: an olm session could not be established.
* **[Added in `v1.19`]** `m.history_not_shared`: when used as part of a
[`RoomKeyBundle` structure](/client-server-api/#definition-roomkeybundle),
indicates to the recipient of the bundle that the corresponding room key
was not marked as
[shareable](/client-server-api/#shareable-encryption-sessions) by the
sender. Clients SHOULD NOT use this `code` in a `m.room_key.withheld`
event.
In most cases, this event refers to a specific room key. The one exception to
this is when the sender is unable to establish an olm session with the

View file

@ -21,6 +21,8 @@ properties:
properties:
room_id:
type: string
format: mx-room-id
pattern: "^!"
description: The room to which the keys in the key bundle relate.
file:
description: |-