Commit Graph

58 Commits

Author SHA1 Message Date
Nick Mathewson 61593e1c59 Teach DirMgr to use its own NetDir, if present, to bootstrap itself. 2020-11-20 15:11:20 -05:00
Nick Mathewson 999706ee8f Move a few more responsibilities into NetDirConfig.
Also start a DirMgr type.
2020-11-20 14:46:22 -05:00
Nick Mathewson 7e50c4ad3a Move storage and config logic from netdir to dirmgr. 2020-11-20 12:20:43 -05:00
Nick Mathewson 21ebb5caf3 NetDirConfig: Learn fallback directories from chutney configurations too 2020-11-20 09:48:57 -05:00
Nick Mathewson 4721e95c06 Use a builder pattern for NetDir. 2020-11-20 09:02:11 -05:00
Nick Mathewson d3f94f48f4 Move some netdir code into submodules.
The Authority type gets its own module; so does the ability to load
from legacy storage.
2020-11-20 08:44:26 -05:00
Nick Mathewson 9f4230fb1b Initial pass on directory-manager code.
This code can now bootstrap from the network, cache the results, and
reload from cache.

There's lots more work to do here, including a big pile of tidying
and refactoring and testing and documentation.
2020-11-19 19:11:10 -05:00
Nick Mathewson 02bac5f04e Add support for using fallback directories in path construction
This is mainly a refactoring commit, with a little new code.

It also adds #[derive(Copy,Clone)] for a few types.
2020-11-19 10:06:48 -05:00
Nick Mathewson 3668f65c9e Netdir: only expose a netdir object if we have enough directory info
The calculation isn't completely right here, but it's a fair
stopgap.
2020-11-17 13:26:46 -05:00
Nick Mathewson 33f070e7b5 Start a directory client implementation
It can send a GET request on a circuit, get an answer, and
decompress it with zlib.

It will need documentation and tests eventually, as well as serious
refactoring.
2020-11-16 16:39:16 -05:00
Nick Mathewson 6e5db3a0e7 Make Arc<>-ness of ClientCirc explicit. 2020-11-12 12:58:33 -05:00
Nick Mathewson 59e4b5631a Isolate async_std usage in a new tor_rtcompat crate.
Like tor_llcrypto, this crate is meant to expose only the part of
other crates (in this case, a async runtime crate) that we use.
2020-11-11 13:46:39 -05:00
Nick Mathewson ede252c1d3 Use anyhow for error management in client-demo. 2020-11-11 10:06:47 -05:00
Nick Mathewson af16ec18a3 update some dependencies 2020-11-11 09:14:26 -05:00
Nick Mathewson 4d24fff9c0 Upgrade dependencies 2020-11-10 12:27:10 -05:00
Nick Mathewson 9c7ed1fdde upgrade a few packages. 2020-11-05 16:56:29 -05:00
Nick Mathewson 2e1f510225 rename tor_socks -> tor_socksproto. 2020-11-04 15:01:25 -05:00
Nick Mathewson c0f9d94b34 Refactor DataStream to be splittable, and have internal locking.
This lets me fix the deadlock in the proxy code.
2020-11-04 12:10:09 -05:00
Nick Mathewson 954108e0ee stream: Update to enable more fine-grained locking
Not sure this is quite right, or quite deadlock free, but it lets
us read/write cells on a stream we haven't locked.
2020-11-04 11:50:23 -05:00
Nick Mathewson 3289f2d44c Add a (broken) SOCKS proxy to client-demo.
This is broken because it hits a deadlock when two tasks at once
want to use a DataStream for reading and writing.
2020-11-04 11:34:48 -05:00
Nick Mathewson 7128c14f49 Make 'netdir' no longer a field in circmgr. 2020-11-02 14:25:49 -05:00
Nick Mathewson 7d2b2391ab Implement rudimentary circuit-manager functionality
This code is meant to "get or launch a circuit as appropriate."
It's super dodgy, but it is probably good enough for a first pass.
2020-11-02 11:54:02 -05:00
Nick Mathewson d9dafa0a28 Add a new circuit-manager crate and move path selection there. 2020-11-02 10:44:31 -05:00
Nick Mathewson d0a18a65c5 Use chanmgr in client-demo 2020-10-30 09:51:52 -04:00
Nick Mathewson 67e39450fb Remove duplication of ipaddr argument in handshake. 2020-10-29 17:03:12 -04:00
Nick Mathewson 4cf972d69b tor-proto API: Use new_ref, not clone.
Semantically, cloning a Channel or Circuit is actually increasing an
internal reference count.  We should name the functions to reflect
that, to be more explicit about what we're doing.
2020-10-29 12:11:36 -04:00
Nick Mathewson 425ee8376b Add new `terminate()` method to circuits and channels.
These aren't called "close" because they're more destructive than
that: they can be called even if other parties are using the circuit
or channel.

This is for arti#21.
2020-10-20 14:28:44 -04:00
Nick Mathewson b0cdd025a1 Add some helpful logs in circuit code. 2020-10-20 12:40:08 -04:00
Nick Mathewson 31cde26138 main.rs: Add a flag for trace-level logs 2020-10-20 11:49:23 -04:00
Nick Mathewson 7ce158ed1e Add reasonable logging (I hope!) to channel 2020-10-20 11:45:53 -04:00
Nick Mathewson 3408c9ad26 Run "cargo upgrade". 2020-10-15 13:32:02 -04:00
Nick Mathewson 2247664abe Remove a couple of allow(unused) notations 2020-10-09 16:47:59 -04:00
Nick Mathewson 68b969773a client-main: Add an option to run a test more than once 2020-10-09 13:10:31 -04:00
Nick Mathewson dfa5e08a33 client-demo:Be louder on reactor failure. 2020-10-09 11:27:52 -04:00
Nick Mathewson f2ec2c68e0 Expose --flood and --dl switches on client-demo
These are for testing sendmes.
2020-10-09 09:37:46 -04:00
Nick Mathewson beee7a7f2a cargo upgrade 2020-09-29 16:43:16 -04:00
Nick Mathewson d0bed5e647 Throw a rudimentary CLI onto client-demo. 2020-09-29 16:42:27 -04:00
Nick Mathewson 05da5a7f73 Rename some identifiers in tor-linkspec.
By convention, rust accessor functions don't start with 'get'.
2020-09-28 15:29:39 -04:00
Nick Mathewson 37aab00d12 Add new (disabled) demo pieces to client-demo 2020-09-25 18:49:23 -04:00
Nick Mathewson 18b13e8cae Migrate ClientMain to byte-oriented API. 2020-09-24 18:56:54 -04:00
Nick Mathewson 0c131dc080 Run cargo upgrade 2020-09-21 13:45:36 -04:00
Nick Mathewson bc00417f01 Start implementing streams and circuit-level reactors.
Also, revise nearly all of the circuit/channel interaction to
actually send relay cells to the right place and do sensible things
with them.
2020-09-21 10:42:36 -04:00
Nick Mathewson 0075b784a1 De-parameterize channel and circuit
By putting the cell-sink in a box, we can get rid of the need for
having everything that uses a channel or a circuit know what kind
of underlying TLS implementation it has.
2020-09-19 22:29:18 -04:00
Nick Mathewson ee9b871bc5 Make client-demo launch a request to www.torproject.org:80 2020-09-12 21:32:00 -04:00
Nick Mathewson 02fc8b2528 Implement extend2/extended2 handshake.
This is not a production-ready implementation: it will break if a
circuit is used for anything while an extend is pending.

Client-demo can now build 3-hop circuits.
2020-09-12 20:48:07 -04:00
Nick Mathewson 74798337dd Ntor handshake (first hop) is go. 2020-09-11 20:00:26 -04:00
Nick Mathewson a4697e4528 For circuits: Implement first hop create via create_fast. 2020-09-11 19:00:55 -04:00
Nick Mathewson a62717690b proto: add minimal (raw) circuit support.
This is about enough to make a circuit, send a create_fast cell, and
get a created_fast cell back.
2020-09-11 15:10:34 -04:00
Nick Mathewson f20eb2f43f proto::channel: add piping to move cells around.
There's a "reactor" task to move cells to the appropriate circuit,
and a "send_cell" to send a cell directly.

This is client-only for now.
2020-09-11 13:58:05 -04:00
Nick Mathewson 812056d663 Move channel handshake into its own module. 2020-09-10 12:43:55 -04:00