Skip to content

Commit be9c37e

Browse files
committed
more clarifications, add comparison with SAS
1 parent a8c7fda commit be9c37e

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed

proposals/1543-qr_code_key_verification.md

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,32 @@ Example flow:
5555
indicating that the code is incorrect, and sends a
5656
`m.key.verification.cancel` message to Bob's device.
5757

58-
Otherwise, at this point, Alice's device has now verified Bob's key, and her
59-
device will display a message saying that all is well.
60-
7. Alice's device sends a `m.key.verification.start` message with `method` set
58+
Otherwise, at this point:
59+
- Alice's device has now verified Bob's key, and
60+
- Alice's device knows that Bob has the correct key for her.
61+
62+
Thus for Bob to verify Alice's key, Alice needs to tell Bob that he has the
63+
right key.
64+
7. Alice's device displays a message saying that all is well. This message
65+
tells Alice that she has the right key for Bob, and tells Bob that he has
66+
the right key for Alice.
67+
8. Alice's device sends a `m.key.verification.start` message with `method` set
6168
to `m.reciprocate.v1` to Bob (see below). The message includes the shared
62-
secret from the QR code.
63-
8. Upon receipt of the `m.key.verification.start` message, Bob's device ensures
64-
that the shared secret matches, and if so, presents a button for him to press
65-
/after/ he has checked that Alice's device says that things match, and a
66-
button for him to press if Alice's device indicates that the QR code is
67-
invalid or if Alice has not yet scanned. If the shared secret does not
68-
match, it should display an error message indicating that an attack was
69-
attempted. (This does not affect Alice's verification of Bob's keys.)
70-
9. Bob sees Alice's device confirm that the key matches, and presses the button
71-
on his device to indicate that Alice's key is verified.
72-
10. Both devices send an `m.key.verification.done` message.
69+
secret from the QR code. This signals to Bob's device that Alice has
70+
scanned Bob's QR code. (This message is merely a signal for Bob's device to
71+
proceed to the next step, and is not used in the actual verification.)
72+
9. Upon receipt of the `m.key.verification.start` message, Bob's device ensures
73+
that the shared secret matches.
74+
75+
If the shared secret does not match, it should display an error message
76+
indicating that an attack was attempted. (This does not affect Alice's
77+
verification of Bob's keys.)
78+
79+
If the shared secret does match, it asks Bob to confirm that Alice
80+
has scanned the QR code.
81+
10. Bob sees Alice's device confirm that the key matches, and presses the button
82+
on his device to indicate that Alice's key is verified.
83+
11. Both devices send an `m.key.verification.done` message.
7384

7485
### Verification methods
7586

@@ -119,8 +130,7 @@ user whose QR code was scanned; bi-directional verification is not possible.
119130

120131
#### `m.key.verification.start`
121132

122-
Alice's device tells Bob's device that the keys are verified. The request is
123-
MAC'ed using the verification algorithm and verification key from the QR code.
133+
Alice's device tells Bob's device that the QR code has been scanned.
124134

125135
message contents:
126136

@@ -167,6 +177,14 @@ Other methods of verifying keys, which do not require scanning QR codes, are
167177
needed for devices that are unable to scan QR codes. One such method is
168178
[MSC1267](https://github.com/matrix-org/matrix-doc/issues/1267).
169179

180+
Rather than embedding the keys in the QR codes directly, the two clients could
181+
perform an exchange similar to
182+
[MSC1267](https://github.com/matrix-org/matrix-doc/issues/1267), and encoding
183+
the Short Authentication String code in the QR code. However, this means that
184+
the clients must exchange several messages before they can verify each other,
185+
which would delay showing the QR codes. This proposal is also simpler to
186+
implement.
187+
170188
Security Considerations
171189
-----------------------
172190

@@ -176,7 +194,7 @@ able to trick Alice into verifying a key under his control, and evesdropping on
176194
Alice's communications with Carol.
177195

178196
The security of verifying Alice's key depends on Bob not hitting the "Verified"
179-
button (step 9 in the example flow) until after Alice's device indicates
197+
button (step 10 in the example flow) until after Alice's device indicates
180198
success or failure. Users have a tendency to click on buttons without reading
181199
what the screen says, but this is partially mitigated by the fact that it is
182200
unlikely that Bob will be interacting with the device while Alice is scanning

0 commit comments

Comments
 (0)