Skip to content

Commit d47c099

Browse files
epoberezkinspaced4ndydpwiz
authored
docs: update protocol specifications (#1204)
* docs: update protocol specifications * update SMP protocol (WIP) * add proxy protocol commands and responses, amend envelope sizes in SMP protocol * docs: update XFTP protocol (#1205) * docs: update XFTP protocol * commands * fix table of contents, move sections * add about ids * download encryption * qualities * diagram * crypto * sending file diagram * fix svg * receiving file diagram * update commands * update handshake * Add updated XRCP (#1207) * add XRCP protocol * add ToC * update * update --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * add XFTP handshake description * update agent protocol * fast duplex connection in agent protocol * update agent protocol * update overview * typos * queue rotation, agent API, updates * push notifications specification * add XRCP threat model * XFTP threat model * update PQDR * agent protocol end-to-end encryption * versions * remove TOC details * update --------- Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Co-authored-by: Alexander Bondarenko <486682+dpwiz@users.noreply.github.com>
1 parent 8a3b724 commit d47c099

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2971
-663
lines changed

protocol/agent-protocol.md

Lines changed: 316 additions & 259 deletions
Large diffs are not rendered by default.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
sequenceDiagram
2+
participant A as Alice
3+
participant AA as Alice's<br>agent
4+
participant AS as Alice's<br>server
5+
participant BS as Bob's<br>server
6+
participant BA as Bob's<br>agent
7+
participant B as Bob
8+
9+
note over AA, BA: status (receive/send): NONE/NONE
10+
11+
note over A, AA: 1. request connection<br>from agent
12+
A ->> AA: createConnection
13+
14+
note over AA, AS: 2. create Alice's SMP queue
15+
AA ->> AS: NEW: create SMP queue<br>allow sender to secure
16+
AS ->> AA: IDS: SMP queue IDs
17+
note over AA: status: NEW/NONE
18+
19+
AA ->> A: INV: invitation<br>to connect
20+
21+
note over A, B: 3. out-of-band invitation
22+
A ->> B: OOB: invitation to connect
23+
24+
note over BA, B: 4. accept connection
25+
B ->> BA: joinConnection:<br>via invitation info
26+
note over BA: status: NONE/NEW
27+
28+
note over BA, AS: 5. secure Alice's SMP queue
29+
BA ->> AS: SKEY: secure queue (this command needs to be proxied)
30+
note over BA: status: NONE/SECURED
31+
32+
note over BA, BS: 6. create Bob's SMP queue
33+
BA ->> BS: NEW: create SMP queue<br>allow sender to secure
34+
BS ->> BA: IDS: SMP queue IDs
35+
note over BA: status: NEW/SECURED
36+
37+
note over BA, AA: 7. confirm Alice's SMP queue
38+
BA ->> AS: SEND: Bob's info without sender's key (SMP confirmation with reply queues)
39+
note over BA: status: NEW/CONFIRMED
40+
41+
AS ->> AA: MSG: Bob's info without<br>sender server key
42+
note over AA: status: CONFIRMED/NEW
43+
AA ->> AS: ACK: confirm message
44+
AA ->> A: CONF: connection request ID<br>and Bob's info
45+
A -> AA: allowConnection: accept connection request,<br>send Alice's info
46+
47+
note over AA, BS: 8. secure Bob's SMP queue
48+
AA ->> BS: SKEY: secure queue (this command needs to be proxied)
49+
note over BA: status: CONFIRMED/SECURED
50+
51+
AA ->> BS: SEND: Alice's info without sender's server key (SMP confirmation without reply queues)
52+
note over AA: status: CONFIRMED/CONFIRMED
53+
54+
note over AA, A: 9. notify Alice<br>about connection success<br>(no HELLO needed in v6)
55+
AA ->> A: CON: connected
56+
note over AA: status: ACTIVE/ACTIVE
57+
58+
note over BA, B: 10. notify Bob<br>about connection success
59+
BS ->> BA: MSG: Alice's info without<br>sender's server key
60+
note over BA: status: CONFIRMED/CONFIRMED
61+
BA ->> B: INFO: Alice's info
62+
BA ->> BS: ACK: confirm message
63+
64+
BA ->> B: CON: connected
65+
note over BA: status: ACTIVE/ACTIVE

protocol/diagrams/duplex-messaging/duplex-creating-fast.svg

Lines changed: 3 additions & 0 deletions
Loading

protocol/diagrams/duplex-messaging/duplex-creating-v2.mmd

Lines changed: 0 additions & 71 deletions
This file was deleted.

protocol/diagrams/duplex-messaging/duplex-creating.mmd

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,72 +8,67 @@ sequenceDiagram
88

99
note over AA, BA: status (receive/send): NONE/NONE
1010

11-
note over A, AA: 1. request connection from agent
12-
A ->> AA: NEW: create<br>duplex connection
11+
note over A, AA: 1. request connection<br>from agent
12+
A ->> AA: createConnection
1313

1414
note over AA, AS: 2. create Alice's SMP queue
1515
AA ->> AS: NEW: create SMP queue
1616
AS ->> AA: IDS: SMP queue IDs
1717
note over AA: status: NEW/NONE
1818

1919
AA ->> A: INV: invitation<br>to connect
20-
note over AA: status: PENDING/NONE
2120

2221
note over A, B: 3. out-of-band invitation
2322
A ->> B: OOB: invitation to connect
2423

2524
note over BA, B: 4. accept connection
26-
B ->> BA: JOIN:<br>via invitation info
25+
B ->> BA: joinConnection:<br>via invitation info
2726
note over BA: status: NONE/NEW
2827

29-
note over BA, AA: 5. establish Alice's SMP queue
30-
BA ->> AS: SEND: Bob's info and sender server key (SMP confirmation)
31-
note over BA: status: NONE/CONFIRMED
32-
activate BA
28+
note over BA, BS: 5. create Bob's SMP queue
29+
BA ->> BS: NEW: create SMP queue
30+
BS ->> BA: IDS: SMP queue IDs
31+
note over BA: status: NEW/NEW
32+
33+
note over BA, AA: 6. confirm Alice's SMP queue
34+
BA ->> AS: SEND: Bob's info and sender server key (SMP confirmation with reply queues)
35+
note over BA: status: NEW/CONFIRMED
36+
3337
AS ->> AA: MSG: Bob's info and<br>sender server key
3438
note over AA: status: CONFIRMED/NONE
3539
AA ->> AS: ACK: confirm message
3640
AA ->> A: CONF: connection request ID<br>and Bob's info
37-
A ->> AA: LET: accept connection request,<br>send Alice's info
41+
A ->> AA: allowConnection: accept connection request,<br>send Alice's info
3842
AA ->> AS: KEY: secure queue
3943
note over AA: status: SECURED/NONE
4044

41-
BA ->> AS: SEND: HELLO: try sending until successful
42-
deactivate BA
43-
note over BA: status: NONE/ACTIVE
44-
AS ->> AA: MSG: HELLO: Alice's agent<br>knows Bob can send
45-
note over AA: status: ACTIVE/NONE
46-
AA ->> AS: ACK: confirm message
47-
48-
note over BA, BS: 6. create Bob's SMP queue
49-
BA ->> BS: NEW: create SMP queue
50-
BS ->> BA: IDS: SMP queue IDs
51-
note over BA: status: NEW/ACTIVE
45+
AA ->> BS: SEND: Alice's info and sender's server key (SMP confirmation without reply queues)
46+
note over AA: status: SECURED/CONFIRMED
5247

53-
note over AA, BA: 7. establish Bob's SMP queue
54-
BA ->> AS: SEND: REPLY: invitation to the connect
55-
note over BA: status: PENDING/ACTIVE
56-
AS ->> AA: MSG: REPLY: invitation<br>to connect
57-
note over AA: status: ACTIVE/NEW
58-
AA ->> AS: ACK: confirm message
59-
60-
AA ->> BS: SEND: Alice's info and sender's server key
61-
note over AA: status: ACTIVE/CONFIRMED
62-
activate AA
48+
note over BA, AA: 7. confirm Bob's SMP queue
6349
BS ->> BA: MSG: Alice's info and<br>sender's server key
64-
note over BA: status: CONFIRMED/ACTIVE
50+
note over BA: status: CONFIRMED/CONFIRMED
6551
BA ->> B: INFO: Alice's info
6652
BA ->> BS: ACK: confirm message
6753
BA ->> BS: KEY: secure queue
54+
note over BA: status: SECURED/CONFIRMED
55+
56+
BA ->> AS: SEND: HELLO message
57+
6858
note over BA: status: SECURED/ACTIVE
6959

70-
AA ->> BS: SEND: HELLO: try sending until successful
71-
deactivate AA
60+
AS ->> AA: MSG: HELLO: Alice's agent<br>knows Bob can send
61+
note over AA: status: SECURED/ACTIVE
62+
AA ->> AS: ACK: confirm message
63+
AA ->> BS: SEND: HELLO
64+
65+
note over A, AA: 8. notify Alice<br>about connection success
66+
AA ->> A: CON: connected
7267
note over AA: status: ACTIVE/ACTIVE
68+
7369
BS ->> BA: MSG: HELLO: Bob's agent<br>knows Alice can send
7470
note over BA: status: ACTIVE/ACTIVE
7571
BA ->> BS: ACK: confirm message
7672

77-
note over A, B: 8. notify users about connection success
78-
AA ->> A: CON: connected
73+
note over BA, B: 9. notify Bob<br>about connection success
7974
BA ->> B: CON: connected

protocol/diagrams/duplex-messaging/duplex-creating.svg

Lines changed: 3 additions & 1 deletion
Loading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
sequenceDiagram
2+
participant A as Alice
3+
participant R as Current server<br>that has A's<br>receive queue
4+
participant R' as New server<br>that has the new A's<br>receive queue
5+
participant S as Server<br>that has A's send queue<br>(B's receive queue)
6+
participant B as Bob
7+
8+
A ->> R': NEW: create new queue<br>(allow SKEY)
9+
A ->> S: SEND: QADD (R'): send address<br>of the new queue(s)
10+
S ->> B: MSG: QADD (R')
11+
B ->> R': SKEY: secure new queue
12+
B ->> R': SEND: QTEST
13+
R' ->> A: MSG: QTEST
14+
A ->> R: DEL: delete the old queue
15+
B ->> R': SEND: send messages to the new queue
16+
R' ->> A: MSG: receive messages from the new queue
17+

protocol/diagrams/duplex-messaging/queue-rotation-fast.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
sequenceDiagram
2+
participant A as Alice
3+
participant R as Current server<br>that has A's<br>receive queue
4+
participant R' as New server<br>that has the new A's<br>receive queue
5+
participant S as Server<br>that has A's send queue<br>(B's receive queue)
6+
participant B as Bob
7+
8+
A ->> R': NEW: create new queue
9+
A ->> S: SEND: QADD (R'): send address<br>of the new queue(s)
10+
S ->> B: MSG: QADD (R')
11+
B ->> R: SEND: QKEY (R'): sender's key<br>for the new queue(s)
12+
R ->> A: MSG: QKEY(R')
13+
A ->> R': KEY: secure new queue
14+
A ->> S: SEND: QUSE (R'): instruction to use new queue(s)
15+
S ->> B: MSG: QUSE (R')
16+
B ->> R': SEND: QTEST
17+
R' ->> A: MSG: QTEST
18+
A ->> R: DEL: delete the old queue
19+
B ->> R': SEND: send messages to the new queue
20+
R' ->> A: MSG: receive messages from the new queue
21+

protocol/diagrams/duplex-messaging/queue-rotation.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)