Skip to content

Commit fcfd5d9

Browse files
committed
add examples for self-verification
1 parent 0b4411e commit fcfd5d9

File tree

1 file changed

+66
-2
lines changed

1 file changed

+66
-2
lines changed

proposals/1543-qr_code_key_verification.md

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ thinks Alice's key is. When Alice scans the QR code, she will ensure that the
2121
keys match what is expected, in which case, she relays this information to Bob,
2222
who can then tell his device that the keys match.
2323

24-
Example flow:
24+
### Example flow
2525

2626
1. Alice and Bob meet in person, and want to verify each other's keys.
2727
2. Alice requests a key verification through her device by sending an
@@ -99,6 +99,64 @@ for her, as this is done over a trusted medium. Bob verifies Alice's key
9999
because Alice can trust the QR code that Bob displays, and Bob can trust Alice
100100
to tell him the result of the verification.
101101

102+
#### Self-verification
103+
104+
QR codes can also be used by a user to verify their own devices. These examples
105+
shows Alice verifying two devices, one of them (Osborne2) having cross-signing
106+
already set up, and the other one (Dynabook) having just logged in.
107+
108+
In the first example, Osborne2 scans Dynabook:
109+
110+
1. Alice logs into her new Dynabook and wants other users to be able to trust
111+
it via cross-signing, and to trust other devices via cross-signing.
112+
2. Dynabook retrieves Alice's public cross-signing key from the server, and
113+
displays a QR code that encodes:
114+
- Alice's user ID,
115+
- Dynabook's device key,
116+
- what it thinks Alice's master key is, as the `other_user_key` parameter, and
117+
- a random shared secret.
118+
119+
Note that in this case, the QR code does not include Alice's master key in a
120+
`key_<key_id>` parameter, since Dynabook does not know whether it is trusted
121+
or not.
122+
3. Osborne2 scans the QR code displayed by Dynabook. At this point, Osborne2
123+
knows Dynabook's device key and can sign it with the self-signing key and
124+
upload the signature, and can trust Dynabook for sending secrets via SSSS.
125+
It also knows that Dynabook has the correct cross-signing key.
126+
4. Osborne2 tells Alice that the scan was successful, and sends the
127+
`reciprocate` message containing the shared secret.
128+
5. Upon receipt of the `reciprocate` message, Dynabook (after checking the
129+
shared secret) confirms with Alice that she successfully scanned the QR
130+
code.
131+
6. Alice confirms.
132+
7. Dynabook now knows that it can trust Alice's cross-signing keys that it
133+
fetched from the server.
134+
135+
In the second example, Dynabook scans Osborne2:
136+
137+
1. Alice logs into her new Dynabook and wants other users to be able to trust
138+
it via cross-signing, and to trust other devices via cross-signing.
139+
2. Osborne2 notices that Dynabook is a new device. Osborne2 fetches Dynabook's
140+
identity key and displays a QR code that encodes:
141+
- Alice's user ID,
142+
- Osborne2's device key (optional),
143+
- what it thinks Dynabook's key is, as `other_device_key`,
144+
- Alice's master key, both as `key_<key_id>` and `other_user_key`
145+
parameters, and
146+
- a random shared secret.
147+
3. Dynabook scans the QR code shown by Osborne2. At this point, Dynabook knows
148+
Alice's cross-signing key, and so it can trust it to sign other devices. It
149+
also knows that Osborne2 as the correct key for it.
150+
4. Dynabook tells Alice that the scan is successful, and sends the
151+
`reciprocate` message containing the shared secret.
152+
5. Upon receipt of the `reciprocate` message, Osborne2 (after checking the
153+
shared secret) confirms with Alice that she successfully scanned the QR
154+
code.
155+
6. Alice confirms.
156+
7. Osborne2 now knows that it has the correct device key for Dynabook, and can
157+
sign it with the self-signing key and upload the signature. Osborne2 can
158+
also trust Dynabook for sending secrets via SSSS.
159+
102160
### Verification methods
103161

104162
This proposal defines three verification methods that can be used in
@@ -129,12 +187,18 @@ the form:
129187
- `request`: is the event ID of the associated verification request event.
130188
- `key_<key_id>`: each key that the user wants verified will have an entry of
131189
this form, where the value is the key in unpadded base64. The QR code should
132-
contain at least the user's master cross-signing key.
190+
contain at least the user's master cross-signing key. In the case where a
191+
device does not have a cross-signing key (as in the case where a user logs in
192+
to a new device, and is verifying against another device), thin the QR code
193+
should contain at least the device's key.
133194
- `secret`: is a random single-use shared secret in unpadded base64. It must be
134195
at least 256-bits long (43 characters when base64-encoded).
135196
- `other_user_key`: the other user's master cross-signing key, in unpadded
136197
base64. In other words, if Alice is displaying the QR code, this would be
137198
the copy of Bob's master cross-signing key that Alice has.
199+
- `other_device_key`: the other device's key, in unpadded base64. This is only
200+
needed when a user is verifying their own devices, where the other device has
201+
not yet been signed with the cross-signing key.
138202

139203
The QR codes to be displayed and scanned, which are not a part of an in-person
140204
verification (for example, for printing on business cards), will encode URLs of

0 commit comments

Comments
 (0)