Commit Graph

7542 Commits

Author SHA1 Message Date
Nick Mathewson b4831da536 A little documentation in tor-dirmgr 2020-11-23 09:23:20 -05:00
Nick Mathewson 8a9654ee90 missing docs in tor-dirclient 2020-11-23 08:51:18 -05:00
Nick Mathewson 5d32d69011 Require (and write) docs in tor-dirclient. 2020-11-20 19:11:28 -05:00
Nick Mathewson 3d4f5f261e Require documentation in tor-rtcompat. 2020-11-20 17:24:16 -05:00
Nick Mathewson 3f89b3db7b Make "storage" module private 2020-11-20 16:29:55 -05:00
Nick Mathewson 99e0b1d9f5 Remove a couple of #[allow]s. 2020-11-20 15:30:32 -05:00
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 7a78bef0d1 Add a better way to get a shared directory out of a DirMgr. 2020-11-20 15:07:38 -05:00
Nick Mathewson 48da54d8c5 Remove needless Arc<> for DirStoreHandle. And DirStoreHandle itself. 2020-11-20 14:52:59 -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 c7ee4997b5 Missing file: whoops 2020-11-20 09:18:12 -05:00
Nick Mathewson 4721e95c06 Use a builder pattern for NetDir. 2020-11-20 09:02:11 -05:00
Nick Mathewson ff821d3f31 Move NetDirConfig into its own module. 2020-11-20 08:53:34 -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 300c9c3fde Remove "dumpdir" example as obsolete 2020-11-20 08:08:32 -05:00
Nick Mathewson 7ecfa4c863 Remove a couple of stray dbg!() calls. 2020-11-19 19:23:34 -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 35040534ba downgrade an ok_or_else to ok_or. 2020-11-19 12:00:14 -05:00
Nick Mathewson 87fe434875 Refactor AuthCertKeyIds::cmp(). 2020-11-19 11:38:06 -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 0945808e9b Add a notion of a one-hop fallback path.
These have a FallbackDirectory as target, rather than a Relay.
2020-11-17 16:58:26 -05:00
Nick Mathewson 5188263429 Refactor first-hop handling types a bit
This lets us have the notion of "get the first hop of a path as some
kind of a chantarget", which will make it easier to write other path
types.
2020-11-17 16:46:23 -05:00
Nick Mathewson 658996dae9 Netdir: improve representation
Now a netdir no longer holds unwanted microdescs, and it always
holds a weight function.
2020-11-17 14:14:17 -05:00
Nick Mathewson 9d49988c66 Netdir: add functions to add mds, and list missing mds 2020-11-17 13:40:00 -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 0d06dedd17 Include a list of fallback directories in tor-netdir 2020-11-16 16:46:08 -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 168def3c28 Make AuthCertKeyIds sortable. 2020-11-16 15:08:12 -05:00
Nick Mathewson 1148b2d79a Note an unpleasantness in the circmgr api. 2020-11-16 15:07:19 -05:00
Nick Mathewson 6f68f99f4e Checkpoint work on a sqlite backend.
Among other stuff, revert parts of previous commit that introduced a
ReadableStore abstraction: there isn't a good abstraction hat covers
both Tor legacy stores and sqlite stores-- or if there is, I'll have
to find it organizally.

This isn't a final version: it probably has bugs, and it needs
documentation and more tests.  But before I do those, I want to
sanity-check the API by drafting the next layer up on the stack.
2020-11-16 09:22:27 -05:00
Nick Mathewson 29afe2869f Type and functions for key ID inspection of AuthCert. 2020-11-16 08:55:31 -05:00
Nick Mathewson 4512d7e9ed Have the consensus-parsing code expose the signed piece of the consensus. 2020-11-16 08:55:31 -05:00
Nick Mathewson 7336eeeb61 Checkpoint work on making storage backend generic
Also uses mmap for loading stuff.
2020-11-14 10:32:17 -05:00
Nick Mathewson cc59658fea Add accessors for consensus lifetimes. 2020-11-14 10:32:17 -05:00
Nick Mathewson 0d1489be4e Remember the position of authcert and microdescs
We'll need this to save them to disk after parsing them from an
upstream source.
2020-11-14 10:32:17 -05:00
Nick Mathewson 38070d6ec9 netdoc: Add a bogus "Extent()" facility to remember where things were.
Also add the missing str.rs file (oops)
2020-11-14 10:32:17 -05:00
Nick Mathewson 8569af82dd netdoc: split off string utils 2020-11-14 10:32:17 -05:00
Nick Mathewson cb59ae3933 Move closed-check for circuits into an atomicbool. 2020-11-13 09:08:15 -05:00
Nick Mathewson 4a83f21ae9 Light refactoring on remaining ChannelImpl functions 2020-11-13 08:39:01 -05:00
Nick Mathewson 4b1ed6c39c Turn the channel "closed" method into an AtomicBool
This lets us make the test for closed channels non-async.
2020-11-13 08:34:30 -05:00
Nick Mathewson 11b257e1ae Move a few immutable fields from ChannelImpl outside the lock.
Since these don't change while the channel is alive, we don't need
the lock to protect them.
2020-11-13 08:17:36 -05:00
Nick Mathewson 6e5db3a0e7 Make Arc<>-ness of ClientCirc explicit. 2020-11-12 12:58:33 -05:00
Nick Mathewson ac174c7666 Make the Arc-ness of channels more explicit.
Previously every channel was a secret Arc<>, which I think is bad
style, and which stopped us from using weak references in other
places.
2020-11-12 12:34:50 -05:00
Nick Mathewson fabd6840ff tor-circmgr: timeout and retry support. 2020-11-11 17:40:32 -05:00
Nick Mathewson 5b2e18e358 tor-chanmgr: timeout support. 2020-11-11 17:34:54 -05:00
Nick Mathewson 6ae2713763 Document tor-rtcompat crate a little 2020-11-11 14:40:01 -05:00
Nick Mathewson 9504086793 Remove a couple of unused dependencies 2020-11-11 13:48:38 -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