2017-02-15 20:19:39 +00:00
|
|
|
digraph {
|
|
|
|
|
|
|
|
/* could shave a RTT by committing to the nameplate early, before
|
|
|
|
finishing the rest of the code input. While the user is still
|
|
|
|
typing/completing the code, we claim the nameplate, open the mailbox,
|
|
|
|
and retrieve the peer's PAKE message. Then as soon as the user
|
|
|
|
finishes entering the code, we build our own PAKE message, send PAKE,
|
|
|
|
compute the key, send VERSION. Starting from the Return, this saves
|
|
|
|
two round trips. OTOH it adds consequences to hitting Tab. */
|
|
|
|
|
2017-02-22 21:45:18 +00:00
|
|
|
start [label="Boss\n(manager)" style="dotted"]
|
2017-02-16 01:46:28 +00:00
|
|
|
|
2017-02-22 01:56:32 +00:00
|
|
|
{rank=same; P0_code S0}
|
|
|
|
P0_code [shape="box" style="dashed"
|
2017-03-12 17:38:48 +00:00
|
|
|
label="C.input_code\n or C.allocate_code\n or C.set_code"]
|
2017-02-22 01:56:32 +00:00
|
|
|
P0_code -> S0
|
|
|
|
S0 [label="S0: empty"]
|
2017-03-15 07:43:25 +00:00
|
|
|
S0 -> P0_build [label="got_code"]
|
2017-02-16 01:46:28 +00:00
|
|
|
|
2017-02-25 02:30:00 +00:00
|
|
|
S0 -> P_close_error [label="rx_error"]
|
2017-02-26 11:57:58 +00:00
|
|
|
P_close_error [shape="box" label="T.close(errory)"]
|
2017-02-25 02:30:00 +00:00
|
|
|
P_close_error -> S_closing
|
2017-02-24 01:29:56 +00:00
|
|
|
S0 -> P_close_lonely [label="close"]
|
|
|
|
|
2017-04-03 21:23:03 +00:00
|
|
|
S0 -> P_close_unwelcome [label="rx_unwelcome"]
|
|
|
|
P_close_unwelcome [shape="box" label="T.close(unwelcome)"]
|
|
|
|
P_close_unwelcome -> S_closing
|
|
|
|
|
2017-03-12 17:38:48 +00:00
|
|
|
P0_build [shape="box" label="W.got_code"]
|
2017-02-16 01:46:28 +00:00
|
|
|
P0_build -> S1
|
2017-02-22 01:56:32 +00:00
|
|
|
S1 [label="S1: lonely" color="orange"]
|
2017-02-16 01:46:28 +00:00
|
|
|
|
2017-02-22 01:56:32 +00:00
|
|
|
S1 -> S2 [label="happy"]
|
2017-02-16 01:46:28 +00:00
|
|
|
|
2017-02-25 02:30:00 +00:00
|
|
|
S1 -> P_close_error [label="rx_error"]
|
2017-02-22 01:56:32 +00:00
|
|
|
S1 -> P_close_scary [label="scared" color="red"]
|
2017-04-03 21:23:03 +00:00
|
|
|
S1 -> P_close_unwelcome [label="rx_unwelcome"]
|
2017-02-22 01:56:32 +00:00
|
|
|
S1 -> P_close_lonely [label="close"]
|
2017-02-26 11:57:58 +00:00
|
|
|
P_close_lonely [shape="box" label="T.close(lonely)"]
|
2017-02-22 01:56:32 +00:00
|
|
|
P_close_lonely -> S_closing
|
2017-02-16 01:46:28 +00:00
|
|
|
|
2017-02-26 11:57:58 +00:00
|
|
|
P_close_scary [shape="box" label="T.close(scary)" color="red"]
|
2017-02-22 01:56:32 +00:00
|
|
|
P_close_scary -> S_closing [color="red"]
|
2017-02-16 01:46:28 +00:00
|
|
|
|
2017-02-22 01:56:32 +00:00
|
|
|
S2 [label="S2: happy" color="green"]
|
|
|
|
S2 -> P2_close [label="close"]
|
2017-02-26 11:57:58 +00:00
|
|
|
P2_close [shape="box" label="T.close(happy)"]
|
2017-02-22 01:56:32 +00:00
|
|
|
P2_close -> S_closing
|
2017-02-16 01:46:28 +00:00
|
|
|
|
2017-03-04 10:36:19 +00:00
|
|
|
S2 -> P2_got_phase [label="got_phase"]
|
|
|
|
P2_got_phase [shape="box" label="W.received"]
|
|
|
|
P2_got_phase -> S2
|
|
|
|
|
|
|
|
S2 -> P2_got_version [label="got_version"]
|
|
|
|
P2_got_version [shape="box" label="W.got_version"]
|
|
|
|
P2_got_version -> S2
|
2017-02-16 01:46:28 +00:00
|
|
|
|
2017-02-25 02:30:00 +00:00
|
|
|
S2 -> P_close_error [label="rx_error"]
|
2017-02-22 19:26:11 +00:00
|
|
|
S2 -> P_close_scary [label="scared" color="red"]
|
2017-04-03 21:23:03 +00:00
|
|
|
S2 -> P_close_unwelcome [label="rx_unwelcome"]
|
2017-02-22 19:26:11 +00:00
|
|
|
|
2017-02-16 01:46:28 +00:00
|
|
|
S_closing [label="closing"]
|
2017-03-03 07:55:59 +00:00
|
|
|
S_closing -> P_closed [label="closed\nerror"]
|
2017-03-04 10:36:19 +00:00
|
|
|
S_closing -> S_closing [label="got_version\ngot_phase\nhappy\nscared\nclose"]
|
2017-02-16 01:46:28 +00:00
|
|
|
|
2017-02-25 02:30:00 +00:00
|
|
|
P_closed [shape="box" label="W.closed(reason)"]
|
2017-02-16 01:46:28 +00:00
|
|
|
P_closed -> S_closed
|
|
|
|
S_closed [label="closed"]
|
2017-02-22 01:56:32 +00:00
|
|
|
|
2017-03-03 07:55:59 +00:00
|
|
|
S0 -> P_closed [label="error"]
|
|
|
|
S1 -> P_closed [label="error"]
|
|
|
|
S2 -> P_closed [label="error"]
|
|
|
|
|
2017-02-22 01:56:32 +00:00
|
|
|
{rank=same; Other S_closed}
|
|
|
|
Other [shape="box" style="dashed"
|
add w.when_key(), fix w.when_verified() to fire later
Previously, w.when_verified() was documented to fire only after a valid
encrypted message was received, but in fact it fired as soon as the shared
key was derived (before any encrypted messages are seen, so no actual
"verification" could occur yet).
This fixes that, and also adds a new w.when_key() API call which fires at the
earlier point. Having something which fires early is useful for the CLI
commands that want to print a pacifier message when the peer is responding
slowly. In particular it helps detect the case where 'wormhole send' has quit
early (after depositing the PAKE message on the server, but before the
receiver has started). In this case, the receiver will compute the shared
key, but then wait forever hoping for a VERSION that will never come. By
starting a timer when w.when_key() fires, and cancelling it when
w.when_verified() fires, we have a good place to tell the user that something
is taking longer than it should have.
This shifts responsibility for notifying Boss.got_verifier, out of Key and
into Receive, since Receive is what notices the first valid encrypted
message. It also shifts the Boss's ordering expectations: it now receives
B.happy() before B.got_verifier(), and consequently got_verifier ought to
arrive in the S2_happy state rather than S1_lonely.
2017-04-07 01:27:41 +00:00
|
|
|
label="rx_welcome -> process (maybe rx_unwelcome)\nsend -> S.send\ngot_message -> got_version or got_phase\ngot_key -> W.got_key\ngot_verifier -> W.got_verifier\nallocate_code -> C.allocate_code\ninput_code -> C.input_code\nset_code -> C.set_code"
|
2017-02-22 01:56:32 +00:00
|
|
|
]
|
|
|
|
|
2017-02-15 20:19:39 +00:00
|
|
|
}
|