Commit Graph

164 Commits

Author SHA1 Message Date
Brian Warner
ddc6319bf6 protocol docs fixups 2017-04-06 13:52:26 -07:00
Brian Warner
af3bb0095d docs: expand section on close() 2017-04-06 13:22:15 -07:00
Brian Warner
ba36562482 docs: move Dilation up next to Serialization, as both are speculative 2017-04-06 13:02:27 -07:00
Brian Warner
194f0be471 api.md: fix some typos 2017-04-06 12:49:33 -07:00
Brian Warner
d331c51c03 change completion API
* InputHelper returns full words, not just suffixes. I liked the fact that
  suffixes made it impossible to violate the "all matches will start with
  your prefix" invariant, but in practice it was fiddly to work with.
* add ih.when_wordlist_is_available(), so the frontend can block (after
  claiming the nameplate) until it can return a complete wordlist to
  readline. This helps the user experience, because readline wasn't really
  built to work with completions that change over time
* make the Wordlist responsible for appending hyphens to all non-final word
  completions. InputHelper remains responsible for hyphens on nameplates.
  This makes the frontend simpler, but I may change it again in the future if
  it helps non-readline GUI frontends.
* CodeInputter: after claiming, wait for the wordlist rather than returning
  an empty list
* PGPWordList: change to match

This has the unfortunate side-effect that e.g. typing "3-yucatan-tu TAB"
shows you completions that include the entire phrase: "3-yucatan-tumor
3-yucatan-tunnel", rather than only mentioning the final word. I'd like to
fix this eventually.
2017-04-06 12:22:45 -07:00
Brian Warner
bdef446ad4 get mostly-full coverage for rlcompleter, rename, export 2017-04-06 12:22:45 -07:00
Brian Warner
b981b4260d docs: reminder that welcome_handler may be called multiple times 2017-04-06 12:22:45 -07:00
Brian Warner
76f5960517 rewrite welcome handler 2017-04-06 12:22:45 -07:00
Brian Warner
0ed363c894 Key: sort messages to ensure got_code lands before got_pake
Since input_code() sets the nameplate before setting the rest of the code,
and since the sender's PAKE will arrive as soon as the nameplate is set, we
could got_pake before got_code, and Key wasn't prepared to handle that.
2017-04-06 12:22:44 -07:00
Brian Warner
07a49bfaca make progress on rlcompleter, still broken 2017-04-06 12:22:44 -07:00
Brian Warner
bd974f3801 test Nameplate, Mailbox. refactor a little bit 2017-04-06 12:22:44 -07:00
Brian Warner
e66d2df9f1 test and fix wordlist methods 2017-04-06 12:22:44 -07:00
Brian Warner
3873f55d64 make Input tests pass, clarify error cases, cleanups 2017-04-06 12:22:44 -07:00
Brian Warner
175fef2ab4 clean up wordlist handling 2017-04-06 12:22:44 -07:00
Brian Warner
ae95948c17 more tweaks 2017-04-06 12:22:44 -07:00
Brian Warner
4f1b352b2a more work: allocator, input, shift responsibilities 2017-04-06 12:22:44 -07:00
Brian Warner
79d38da497 split Code into Code/Input/Allocator, ostensibly simpler 2017-04-06 12:22:44 -07:00
Brian Warner
0ddc93110b work on new Code state machine design 2017-04-06 12:22:44 -07:00
Brian Warner
299f89c01f new idea on code-input helper API 2017-04-06 12:22:44 -07:00
Brian Warner
4bd9d3579c go back to "input_code" instead of "type_code" 2017-04-06 12:22:44 -07:00
Brian Warner
5f9894ca63 API updates, make most tests pass, disable others
* finally wire up "application versions"
* remove when_verifier (which used to fire after key establishment, but
  before the VERSION message was received or verified)
* fire when_verified and when_version at the same time (after VERSION is
  verified), but with different args
2017-04-06 12:22:44 -07:00
Brian Warner
9571fcd388 docs: write up "journaled mode" 2017-04-06 12:22:44 -07:00
Brian Warner
20ec911b6c add API list, and speculative sections on serialization and dilation 2017-04-06 12:22:44 -07:00
Brian Warner
b4fdcfe53b update api.md 2017-04-06 12:22:44 -07:00
Brian Warner
51a73d6962 client-protocol docs: improve 2017-04-06 12:21:00 -07:00
Brian Warner
dd6e139c19 document file-transfer protocol and Transit 2017-04-06 12:21:00 -07:00
Brian Warner
187e14862d document client-to-client protocol 2017-04-06 12:21:00 -07:00
Brian Warner
9314c6918f start documenting the protocols 2017-04-06 12:21:00 -07:00
Brian Warner
6ada8252b7 Code: handle being connected before being told what to do 2017-04-06 12:21:00 -07:00
Brian Warner
e9f3107127 deliver app-versions up to Wormhole 2017-04-06 12:21:00 -07:00
Brian Warner
60a61c995b implement w.derive_key() 2017-04-06 12:21:00 -07:00
Brian Warner
b7b8df17be rename NameplateLister to Lister (unique prefix L) 2017-04-06 12:21:00 -07:00
Brian Warner
9a2d992815 reminder how ConnectionService should fail if first attempt fails 2017-04-06 12:21:00 -07:00
Brian Warner
fcdcf30ba8 docs: move state machine diagrams into separate directory 2017-04-06 12:21:00 -07:00
Brian Warner
610db612ba improve error handling
errors raised while processing a received message will cause the Wormhole to
close-with-error, and any pending Deferreds will be errbacked
2017-04-06 12:21:00 -07:00
Brian Warner
26adaabe18 implement new split nameplate/mailbox/terminator
fails even worse than before, of course
2017-04-06 12:21:00 -07:00
Brian Warner
02bea00366 dot: split Mailbox and Nameplate into separate machines
add Terminator for shutdown
2017-04-06 12:21:00 -07:00
Brian Warner
97d1ff859b logic bug: M.S4B.close() must not re-send RELEASE 2017-04-06 12:21:00 -07:00
Brian Warner
41b7bcfed5 working on fixes 2017-04-06 12:21:00 -07:00
Brian Warner
b7df5e21eb more tests, still failing 2017-04-06 12:21:00 -07:00
Brian Warner
8a2810ba70 test basic code allocation 2017-04-06 12:21:00 -07:00
Brian Warner
ef1904bc52 get null test working (open and immediate close) 2017-04-06 12:21:00 -07:00
Brian Warner
c95b6d402c Code: don't sent tx_allocate until we're connected
So Code needs connected/lost from the RendezvousConnector
2017-04-06 12:21:00 -07:00
Brian Warner
d4bedeafbf general fixes 2017-04-06 12:21:00 -07:00
Brian Warner
20814a65f4 rename Wormhole (machine) to Boss, leave room for higher-level thing 2017-04-06 12:21:00 -07:00
Brian Warner
a2ed35ceb8 remove old files, lots of type work 2017-04-06 12:21:00 -07:00
Brian Warner
80661392b6 build out all state machines
still early: automat is happy (they're syntactically valid), but the Outputs
are not implemented, and there are plenty of type mismatches
2017-04-06 12:21:00 -07:00
Brian Warner
a3ec344eb8 clean up machine names/initials
C: Code
RC: Rendezvous Connector
R: Receive
2017-04-06 12:21:00 -07:00
Brian Warner
f3b1e847e9 fix everything: should now be consistent and correct
Start with machines.dot, which gives the override. Then traverse downwards
from wormhole.dot .
2017-04-06 12:21:00 -07:00
Brian Warner
e85309a784 split out receive/send machines 2017-04-06 12:21:00 -07:00
Brian Warner
a675648335 code.dot: better names 2017-04-06 12:21:00 -07:00
Brian Warner
c050d06753 update code.dot 2017-04-06 12:21:00 -07:00
Brian Warner
50050dc140 finish wormhole.dot 2017-04-06 12:21:00 -07:00
Brian Warner
2fc5af7bd0 nameplates.dot: done 2017-04-06 12:21:00 -07:00
Brian Warner
44cc1399c4 make mailbox/mailbox_close/machines consistent
finally get mailbox.png layout good enough
2017-04-06 12:21:00 -07:00
Brian Warner
c9f3abe703 rename .dot files, remove obsolete ones 2017-04-06 12:21:00 -07:00
Brian Warner
40e0d6b663 more work, feels better now 2017-04-06 12:21:00 -07:00
Brian Warner
16c477424c more demo work 2017-04-06 12:21:00 -07:00
Brian Warner
7f3e86acca more fussing, split out M_S0 2017-04-06 12:21:00 -07:00
Brian Warner
f6930a9bfc more thoughts 2017-04-06 12:21:00 -07:00
Brian Warner
cf981222c5 think about "checkpointing" as a state
with async exit when the checkpoint is finally written. Not sure this is the
best idea.
2017-04-06 12:21:00 -07:00
Brian Warner
20b80be342 remove stale machines 2017-04-06 12:21:00 -07:00
Brian Warner
3af375b173 finish Mailbox state machine, including close 2017-04-06 12:21:00 -07:00
Brian Warner
b934192f20 work on Mailbox machine 2017-04-06 12:21:00 -07:00
Brian Warner
11a80f0018 moving to separate machine class 2017-04-06 12:21:00 -07:00
Brian Warner
a9a0bc43c7 w4.dot: redraw Connection Machine to match 2017-04-06 12:21:00 -07:00
Brian Warner
0b28137948 w3.dot: figure out close() pathways
d=M_close() will always do the verbose clean shutdown thing, and the Deferred
won't fire (e.g. we won't move to state "Ss") until we've deallocated our
server resources (nameplates and mailboxes), and we've finished shutting down
our websocket connection. So integration tests should wait on the Deferred to
make sure everything has stopped moving and the reactor is clean.

CLI applications that are following the success path can use M_close() and
wait on the Deferred before terminating.

CLI applications that wind up on some error path can either use M_close(), or
just SIGINT and leave the server to GC stuff later.

GUI applications can use M_close() but ignore the Deferred, and assume that
the program will keep running long enough to get the deallocation messages
through.

GUI+DB applications can use M_close() and then stop recording state changes,
and if the program remains running long enough, everything will be
deallocated, but if it terminates too soon, the server will have to GC.
2017-04-06 12:21:00 -07:00
Brian Warner
86f246dbdb just might work. close() mapped out.
Starting to draw a distinction between clean-close and abrupt-halt. At least,
if we're in the connected state, wormhole.close() should take its time and
free up server-side resources (nameplate/mailbox) right away, rather than
relying on GC/timeouts to release them.

It might be useful to make separate "clean" wormhole.close() and "abrupt"
wormhole.halt() API calls, except that really when would you ever call halt?
To be realistic, only one of two things will happen:

* connection happens normally, app finishes, calls "clean" close()
* app terminates suddenly, via exception or SIGINT

The problem with defining .close() is that I have to make it work sensibly
from any state, not just the one plausible "connected" state. Providing
.halt() requires defining its behavior from everywhere else.
2017-04-06 12:21:00 -07:00
Brian Warner
2cfc990d5e more 2017-04-06 12:21:00 -07:00
Brian Warner
5b82b424a0 w.dot: comment out things that seem superceded by w2.dot 2017-04-06 12:21:00 -07:00
Brian Warner
fa76b57976 w2.dot: add M_ prefix 2017-04-06 12:21:00 -07:00
Brian Warner
e7b2a7bbf9 fixing 118 is the key 2017-04-06 12:21:00 -07:00
Brian Warner
f85e2ec68a more 2017-04-06 12:21:00 -07:00
Brian Warner
f27e601e41 more 2017-04-06 12:21:00 -07:00
Brian Warner
78fcb6b809 new approach, thinking about connections up front 2017-04-06 12:21:00 -07:00
Brian Warner
6c77f33cdf start on connection machine 2017-04-06 12:21:00 -07:00
Brian Warner
3ec7747b1e more 2017-04-06 12:21:00 -07:00
Brian Warner
b1f313b116 more diagram work 2017-04-06 12:21:00 -07:00
Brian Warner
8a9b50b320 adding high-level state diagram
Automat doesn't let me combine flowcharts with state machines in a way that's
useful for documenting my thoughts.
2017-04-06 12:21:00 -07:00
Brian Warner
94b1ed8739 starting to draw new state machines 2017-04-06 12:21:00 -07:00
Brian Warner
98e3df1e4d api.md: mark argument slightly better 2017-04-06 12:12:42 -07:00
Shirley Kotian
abec2d2680 typos 2017-03-18 18:39:54 +05:30
Brian Warner
775a35d337 update Tor docs, mention py2-only 2017-01-16 18:21:42 -05:00
Brian Warner
c6ac04433f add docs/tor.md 2017-01-16 11:14:23 -05:00
Brian Warner
7f2edeeb11 document some attacks
closes #107
2017-01-01 14:29:48 -05:00
Antoine Beaupré
d7441cfe8a remove out of date version numbers 2016-12-15 10:36:32 -05:00
Antoine Beaupré
7bade97bc2 add cross-refs and authors 2016-12-15 10:36:16 -05:00
Antoine Beaupré
cdc25e533a move wormhole-server to section 8
this is where admin commands and daemons belong, according to intro(8)
2016-12-15 10:35:49 -05:00
Antoine Beaupré
cc890aa6fa import manpages from Debian project 2016-12-15 10:25:28 -05:00
Brian Warner
06d2a0be68 update docs 2016-05-25 20:58:53 -07:00
Brian Warner
edebf4d787 update events.dot with check-verifier logic 2016-05-25 18:06:08 -07:00
Brian Warner
f6a5581f92 move events diagram (.dot) into docs/ 2016-05-24 16:15:19 -07:00
Brian Warner
104ef44d53 provide wormhole() as a function, rather than a class constructor
You must always provide a reactor= argument. In the future, omitting the
reactor= argument is how you ask for a blocking Wormhole.
2016-05-12 16:45:54 -07:00
Brian Warner
4dfa569769 docs: remove named phases, Wormhole is now a record pipe 2016-05-12 16:45:54 -07:00
Brian Warner
a1c4ef7279 document Transit protocol 2016-02-14 17:48:17 -08:00
Brian Warner
cc369d6b1e api.md: fix typo 2015-11-12 09:30:48 -08:00
Brian Warner
80beb20631 make blocking.Wormhole into a context manager 2015-11-11 21:59:16 -08:00
Brian Warner
bf43dae2ad add multiple phases, change key-derivation strings
Because of the key-derivation change, clients will not be compatible
across this commit.
2015-10-06 20:39:20 -07:00
Brian Warner
35768d6738 wormhole/invitation code is now unicode 2015-10-06 19:42:10 -07:00
Brian Warner
7f6410812c transit URL, transit hints are now unicode 2015-10-06 19:29:59 -07:00