Commit Graph

677 Commits

Author SHA1 Message Date
Nick Mathewson e470f641f1 Merge remote-tracking branch 'origin/mr/7' into main 2020-12-17 15:12:08 -05:00
Nick Mathewson 31aa73c022 Download and use consensus diffs.
Had to refactor a few methods for database access, and fix a bug
where we were storing valid_until times with the wrong information.
2020-12-17 15:08:53 -05:00
Nick Mathewson edbd564b09 Add a function to see if a document looks like a diff. 2020-12-17 15:06:49 -05:00
Nick Mathewson 5c92517245 Whoops: add fuzzers code. 2020-12-17 15:05:58 -05:00
Gaba 57fadaf301 Adds issue creation templates for bugs, features, proposals and documentation. 2020-12-17 13:57:06 -03:00
Nick Mathewson 6f62f9c5dc Mention tor-consdiff in list of crates 2020-12-17 10:52:18 -05:00
Nick Mathewson 3c2977c5dc consdiff: disallow usize::MAX as a line number.
This prevents some overflow cases; found by fuzzing.
2020-12-17 10:50:05 -05:00
Nick Mathewson a44a228d1a Add a fuzzer to tor-consdiff
This fuzzer checks both implementations and makes sure they give
the same result.
2020-12-17 10:27:49 -05:00
Nick Mathewson 1dc3b40336 consdiff: move responsibility for checking sort order into iterator 2020-12-17 09:26:36 -05:00
Nick Mathewson c4508f7ae0 More tests for tor-consdiff. 2020-12-17 09:08:42 -05:00
Nick Mathewson 65526fe7f5 tor-consdiff: document everything. 2020-12-17 08:31:58 -05:00
Nick Mathewson 059e9e96d7 consdiff: use real error messages 2020-12-17 07:29:49 -05:00
Nick Mathewson fce00005db consdiff: extract Error type to new module. 2020-12-17 07:12:43 -05:00
Nick Mathewson a9a62b8b76 Make the O(n^2) slow diff-apply algorithm off-by-default. 2020-12-16 17:30:45 -05:00
Nick Mathewson 867c4aac88 Handle the headers on our diff format correctly. 2020-12-16 16:49:50 -05:00
Nick Mathewson 3a92522e7b Implement the O(n) algorithm for applying diffs 2020-12-16 16:33:58 -05:00
Nick Mathewson f3e130c62a Initial work on client-side consensus diff code. 2020-12-16 15:47:00 -05:00
Nick Mathewson 635cdc06d8 Write a few misc unit tests 2020-12-15 15:34:08 -05:00
Nick Mathewson cae16665cb Basic support for IPv6 and begin flags.
We now have a way to tell a circuitmgr whether we require ipv4/ipv6
support for a target address in an exit policy, and we use similar
logic to set begin flags.
2020-12-15 14:41:03 -05:00
Nick Mathewson affe5c5c53 Use a set of named flags for BeginFlags in tor-cell. 2020-12-15 14:08:36 -05:00
Nick Mathewson a8a35c9914 dirmgr: Refactor so it has no unusable state.
With this new API, if you have a DirMgr, it has a NetDir that was
bootstrapped, and was live at least once during your program's
execution.
2020-12-15 11:57:24 -05:00
Nick Mathewson d408cf0f4b Implement a notion of "circuit dirtiness", as in Tor. 2020-12-15 11:37:17 -05:00
Nick Mathewson 6a42ba718f Fix some clippy warnings. 2020-12-15 08:37:23 -05:00
Nick Mathewson a7a3ef5135 circmgr: refactor and bugfix a bit.
Notably, turn the hashmap into its own type.  This will help with
other refactoring and fixes in the future.

Also notably, fix the code we use when a pending circuit is
complete.  There's still a design flaw there though.
2020-12-14 14:57:29 -05:00
Nick Mathewson c4d3f34e47 tor-circmgr: update documentation 2020-12-14 14:33:21 -05:00
Nick Mathewson 20751f9993 Give more information if we fail to create a pending circuit. 2020-12-14 14:18:36 -05:00
Nick Mathewson 07c08cdf6c Remove now-unused busted From<TargetCircUsage> for CircUsage 2020-12-14 14:08:58 -05:00
Nick Mathewson 6f800ad271 tor-circmgr: always remove closed circuits from the list. 2020-12-14 14:07:58 -05:00
Nick Mathewson 57499d5cf5 tor-circmgr: Use a better key type for our circuit map.
We now use the unique id of each non-pending circuit as its key in
the map.  I wish I could do this without copying, but I don't see a
great way to do that while keeping the pending entries in the same
map for now.
2020-12-14 14:00:53 -05:00
Nick Mathewson d92c1aac04 Remember the actual usable ports for an exit after we've built a circuit
Previously we'd just remember the port that we _wanted_ a circuit
for, and forget all the ports that it _could_ support.

This is part of a bigger circmgr revision/refactoring pass; there
should be cleanups before I merge this.
2020-12-14 12:29:51 -05:00
Nick Mathewson 863f459389 Add a "RetryError" to capture the idea of multiple failed attempts.
When we try to do something a few times and it fails each time, it
can be a good idea to remember why the individual failures
happened.
2020-12-12 12:54:00 -05:00
Nick Mathewson 566b7a165d Use anyhow::Context in tor-chanmgr. 2020-12-11 13:23:07 -05:00
Nick Mathewson 66a304a0bd Add more anyhow Contexts in client-main 2020-12-11 13:18:10 -05:00
Nick Mathewson 9a68054c4b Do not keep a NetDir alive just because we have a stream. 2020-12-10 16:50:18 -05:00
Nick Mathewson 9ea02c066a Merge remote-tracking branch 'origin/mr/5' into main 2020-12-10 12:14:46 -05:00
George Kadianakis cc91b3ce2b Use anyhow crate to add extra context for various dirclient errors. 2020-12-10 17:36:18 +02:00
Nick Mathewson 381530aa84 Add a couple of anyhow contexts in main.rs 2020-12-10 09:53:48 -05:00
Nick Mathewson 90fc798646 Fix some rustdoc warnings. 2020-12-09 09:46:39 -05:00
Nick Mathewson cfdedb995f upgrade rusqlite 2020-12-08 17:26:49 -05:00
Nick Mathewson 17c84fd59e upgrade to require latest anyhow. 2020-12-08 17:26:19 -05:00
Nick Mathewson b095f3325e It is an internal error if we do a TLS connection and get no cert. 2020-12-08 17:21:04 -05:00
Nick Mathewson 26a0654b05 Make RSAIdentity implement Copy. 2020-12-08 17:07:30 -05:00
Nick Mathewson 0caee4718f Document a problem on network transition 2020-12-08 16:59:16 -05:00
Nick Mathewson 8d6087426e De-parameterize ChanMgr and everything that wraps it.
This makes a whole lot of our code simpler, and makes it so that
CircMgr and DirMgr no longer need to have anything parameterized
over transports, either.

Instead of boxing Transport inside of ChanMgr, I've made a new
Connection trait that goes from a ChanTarget* straight to a Channel.
This lets us avoid having to box the intermediate TLS object.

[*] Actually, a copy of the information from a ChanTarget. Ick, but
I had to make a copy to avoid parameterizing
Connecter::build_channel.
2020-12-08 16:29:18 -05:00
Nick Mathewson 5fc116ad7a Tolerate attempt to write a non-UTF-8 HTTP header.
previously, we would panic.
2020-12-07 21:22:12 -05:00
Nick Mathewson 9419f6d699 Use uniform weight all measured weights are zero. 2020-12-07 21:07:41 -05:00
Nick Mathewson bdc7908c7f Fix a logic bug in the --chutney-dir option.
It was recording the dirport for each chutney authority as though it
were an orport.  That obviously won't work.

Closes arti#45.
2020-12-07 16:54:18 -05:00
Nick Mathewson 8301ae699b gitlab-ci.yml -- on rust-latest, turn all clippy warnings into errors. 2020-12-07 16:18:21 -05:00
Nick Mathewson a1f1dac4eb Resolve a few nightly-only clippy issues 2020-12-07 16:14:36 -05:00
Nick Mathewson 6f7d48eb1c Merge branch 'moar_gitlab_ci' into main 2020-12-07 16:08:03 -05:00