magic-wormhole/docs/state-machines
Brian Warner 83e55f1f3e 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-06 18:27:41 -07:00
..
_connection.dot reminder how ConnectionService should fail if first attempt fails 2017-04-06 12:21:00 -07:00
allocator.dot clean up wordlist handling 2017-04-06 12:22:44 -07:00
boss.dot add w.when_key(), fix w.when_verified() to fire later 2017-04-06 18:27:41 -07:00
code.dot clean up wordlist handling 2017-04-06 12:22:44 -07:00
input.dot make Input tests pass, clarify error cases, cleanups 2017-04-06 12:22:44 -07:00
key.dot add w.when_key(), fix w.when_verified() to fire later 2017-04-06 18:27:41 -07:00
lister.dot more work: allocator, input, shift responsibilities 2017-04-06 12:22:44 -07:00
machines.dot add w.when_key(), fix w.when_verified() to fire later 2017-04-06 18:27:41 -07:00
mailbox.dot test Nameplate, Mailbox. refactor a little bit 2017-04-06 12:22:44 -07:00
Makefile rename NameplateLister to Lister (unique prefix L) 2017-04-06 12:21:00 -07:00
nameplate.dot clean up wordlist handling 2017-04-06 12:22:44 -07:00
order.dot docs: move state machine diagrams into separate directory 2017-04-06 12:21:00 -07:00
receive.dot add w.when_key(), fix w.when_verified() to fire later 2017-04-06 18:27:41 -07:00
send.dot docs: move state machine diagrams into separate directory 2017-04-06 12:21:00 -07:00
terminator.dot docs: move state machine diagrams into separate directory 2017-04-06 12:21:00 -07:00