@@ -18,6 +18,30 @@ per key algorithm. If the user had previously uploaded a fallback key for a
1818given algorithm, it is replaced -- the server will only keep one fallback key
1919per algorithm for each user.
2020
21+ When uploading fallback keys for algorithms whose key format is a signed JSON
22+ object, client should include a property named ` fallback ` with a value of
23+ ` true ` .
24+
25+ Example:
26+
27+ ` POST /keys/upload `
28+
29+ ``` json
30+ {
31+ "fallback_keys" : {
32+ "signed_curve25519:AAAAAA" : {
33+ "key" : " base64+public+key" ,
34+ "fallback" : true ,
35+ "signatures" : {
36+ "@alice:example.org" : {
37+ "ed25519:DEVICEID" : " base64+signature"
38+ }
39+ }
40+ }
41+ }
42+ }
43+ ```
44+
2145When Bob calls ` /keys/claim ` to claim one of Alice's one-time keys, but Alice
2246has no one-time keys left, the homeserver will return the fallback key instead,
2347if Alice had previously uploaded one. Unlike with one-time keys, fallback keys
@@ -30,6 +54,24 @@ fallback key for the user. If the client wants the server to have a fallback
3054key for a given key algorithm, but that algorithm is not listed in
3155` device_unused_fallback_keys ` , the client will upload a new key as above.
3256
57+ The ` device_unused_fallback_keys ` parameter must be present if the server
58+ supports fallback keys. Clients can thus treat this field as an indication
59+ that the server supports fallback keys, and so only upload fallback keys to
60+ servers that support them.
61+
62+ Example:
63+
64+ ` GET /sync `
65+
66+ Response:
67+
68+ ``` json
69+ {
70+ // other fields...
71+ "device_unused_fallback_keys" : [" signed_curve25519" ]
72+ }
73+ ```
74+
3375## Security considerations
3476
3577Using a fallback key rather than a one-time key has security implications. An
@@ -51,4 +93,5 @@ to detect replays.
5193
5294## Unstable prefix
5395
54- TODO: ...
96+ The ` fallback_key ` request parameter and the ` device_unused_fallback_keys `
97+ response parameter will be prefixed by ` org.matrix.msc2732. ` .
0 commit comments