Skip to content

Commit 91f51bb

Browse files
committed
use .ready to accept a verification, plus some clarification
1 parent 1590ae2 commit 91f51bb

File tree

1 file changed

+41
-11
lines changed

1 file changed

+41
-11
lines changed

proposals/2241-e2e-verification-in-dms.md

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ verification itself.
8686

8787
#### Accepting a key verification
8888

89-
To accept a key verification, Bob will send an `m.key.verification.start` event
89+
To accept a key verification, Bob will send an `m.key.verification.ready` event
9090
with the following properties in its contents:
9191

9292
TODO: MSC1849 may use `m.relationship` rather than `m.relates_to`, in which
@@ -96,17 +96,38 @@ case this proposal should follow suit.
9696
- `rel_type`: `m.reference`
9797
- `event_id`: the event ID of the key verification request that is being
9898
accepted
99-
- `method`: the key verification method that is being used
99+
- `methods`: an array of verification methods that the device supports
100100
- `from_device`: Bob's device ID. This is required since some verification
101101
methods may use the device IDs as part of the verification process.
102102

103-
Clients should ignore `m.key.verification.start` events that correspond to
103+
Clients should ignore `m.key.verification.ready` events that correspond to
104104
verification requests that they did not send.
105105

106+
After this, either Alice or Bob may start the verification by sending an
107+
`m.key.verification.start` event with the following properties in its contents:
108+
109+
- `m.relates_to`: an object with the properties:
110+
- `rel_type`: `m.reference`
111+
- `event_id`: the event ID of the key verification request that is being
112+
started
113+
- `method`: the key verification method that is being used. This should be a
114+
method that both Alice's and Bob's devices support.
115+
- `from_device`: The user's device ID.
116+
117+
If both Alice and Bob send an `m.key.verification.start` message, and they both
118+
specify the same verification method, then the event sent by the user whose
119+
user ID is the smallest is used, and the other event is ignored. If they both
120+
send an `m.key.verification.start` message and the method is different, then
121+
the verification should be cancelled with a `code` of `m.unexpected_message`.
122+
123+
After the `m.key.verification.start` event is sent, the devices may exchange
124+
messages (if any) according to the verification method in use.
125+
106126
#### Rejecting a key verification
107127

108-
To reject a key verification, Bob will send an `m.key.verification.cancel`
109-
event with the following properties in its contents:
128+
To reject a key verification, Alice or Bob will send an
129+
`m.key.verification.cancel` event with the following properties in its
130+
contents:
110131

111132
- `m.relates_to`: an object with the properties:
112133
- `rel_type`: `m.reference`
@@ -135,7 +156,13 @@ properties in its contents:
135156

136157
This provides a record within the room of the result of the verification.
137158

138-
Any subsequent key verification messages relating to the same request are ignored.
159+
Any subsequent key verification messages relating to the same request are
160+
ignored.
161+
162+
Although a client may have successfully completed its side of the verification,
163+
it may wait until receiving an `m.key.verification.done` (or
164+
`m.key.verification.cancel`) event from the other device before informing the
165+
user that the verification was successful or unsuccessful.
139166

140167
#### Other events
141168

@@ -145,7 +172,7 @@ should have an `m.relates_to` property as defined for
145172
`m.key.verification.accept` or `m.key.verification.cancel` events.
146173

147174
Clients should ignore events with an `m.relates_to` that have a `rel_type` of
148-
`m.reference` that refer to a verification where it is not the requester
175+
`m.reference` that refer to a verification where it is neither the requester
149176
nor the accepter.
150177

151178
Clients should not redact or edit verification messages. A client may ignore
@@ -242,13 +269,16 @@ then the hash commitment will be based on the message contents:
242269

243270
Messages sent by the verification methods, after the initial key verification
244271
request message, could be sent as to-device messages. The
245-
`m.key.verification.start`, `m.key.verification.cancel`, and
272+
`m.key.verification.ready`, `m.key.verification.cancel`, and
246273
`m.key.verification.done` messages must be still be sent in the room, as the
247-
`m.key.verification.start` notifies the sender's other devices that the request
274+
`m.key.verification.ready` notifies the sender's other devices that the request
248275
has been acknowledged, and the `m.key.verification.cancel` and
249276
`m.key.verification.done` provide a record of the status of the key
250277
verification.
251278

279+
However, it seems more natural to have all messages sent via the same
280+
mechanism.
281+
252282
## Potential issues
253283

254284
If a user wants to verify their own device, this will require the creation of a
@@ -262,8 +292,8 @@ decryption keys are sent to all of the target user's devices), or should be
262292
sent unencrypted, so that unverified devices will be able to be verified.
263293

264294
Users might have multiple Direct Messaging rooms with other users. In this
265-
case, clients will need to prompt the user to select the room in which they
266-
want to perform the verification.
295+
case, clients could need to prompt the user to select the room in which they
296+
want to perform the verification, or could select a room.
267297

268298
## Security considerations
269299

0 commit comments

Comments
 (0)