Commit Graph

934 Commits

Author SHA1 Message Date
Nick Mathewson 95ea804636 Add a NetDirConfig::use_default_cache_path() function. 2021-03-30 12:08:03 -04:00
Nick Mathewson 6890f18094 resolve a clippy issue 2021-03-30 12:05:59 -04:00
Nick Mathewson d7fff75934 Declare a better default for DownloadScheduleConfig. 2021-03-30 11:48:43 -04:00
Nick Mathewson 2cf2287bce Add a missing member documentation 2021-03-30 11:23:10 -04:00
Nick Mathewson e6b7fb5a98 Add a fuzzer for NsConsensus documents 2021-03-30 11:15:58 -04:00
Nick Mathewson 63fc8d6a7c Add a test case for NS consensus parsing. 2021-03-30 11:15:58 -04:00
Nick Mathewson 42fb6015d2 NS consensus documents have signatures on SHA1 hashes, not SHA256. 2021-03-30 11:15:58 -04:00
Nick Mathewson cd31eefeb1 Implement parsing for ns-flavored consensus documents. 2021-03-30 11:15:58 -04:00
Nick Mathewson 80a11fd4f5 Make RouterStatus a trait and Consensus into a generic type.
This breaks surprisingly little.
2021-03-30 10:09:53 -04:00
Nick Mathewson f9f7176d5e Start moving MdConsensus-specific code to a submodule.
This is part of refactoring to handle NsConsensuses.
2021-03-30 08:37:40 -04:00
Nick Mathewson 7aa876cc0a Resolve rustdoc warnings. 2021-03-29 18:18:25 -04:00
Nick Mathewson e9e85dfce8 Resolve two clippy warnings in blind_pubkey. 2021-03-29 18:08:56 -04:00
Nick Mathewson 63a4f37f2e Merge remote-tracking branch 'origin/mr/23' 2021-03-29 17:09:05 -04:00
George Kadianakis 32a117ebc0 v3: Add two new test vectors that test key blinding clamping. 2021-03-30 00:06:26 +03:00
George Kadianakis 294c6b0897 v3: Improve error handling on key blinding. 2021-03-30 00:06:20 +03:00
Nick Mathewson d52ff18b46 Fix a bunch more new clippy lints in Rust 1.51
The major types are:
  * You implemented Into when you should have implemented From.
  * You sliced a slice when you didn't have to.
  * You said Ok(x?) when you could have said x.
  * You said Vec::new(); push(); push(); when you could have said vec![].
2021-03-29 16:45:45 -04:00
Nick Mathewson 3ad503866d Fix Rust-1.51 clippy warnings about acronyms in camel case.
This is painful, but we shouldn't have to do it again.
2021-03-29 16:33:48 -04:00
Nick Mathewson 3800c459f6 Rename Rsa{Identity,Signature} to fix clippy warning. 2021-03-29 16:14:43 -04:00
Nick Mathewson 401d7e9fd1 tor-config: fix a new clipppy warning. 2021-03-29 15:45:50 -04:00
Nick Mathewson 50ba1cb85c DirMgr: cooperative multiprocess support.
A directory manager can now launch or run in read-only or read-write
mode, depending on whether it manages to acquire a lock on the
filesystem.

In read-write mode, it bootstraps and stores data into the database
as usual.

In read-only mode, it assumes that another process will be updating
the database, and so it only loads it periodically, looking for new
information.  However, it also tries to acquire the lock itself, so
it can enter read-write mode.
2021-03-29 15:37:43 -04:00
Nick Mathewson 87d191c4b8 Create a DirMgr::load_or_bootstrap_from_config. 2021-03-29 14:12:59 -04:00
Nick Mathewson 1bd110bf11 Add support for a lockfile to control concurrent access to a dirmgr. 2021-03-29 13:58:49 -04:00
George Kadianakis ea10259be2 Implement basic ed25519 key blinding for v3 onion services. 2021-03-29 20:29:12 +03:00
Nick Mathewson 278ee1fcb3 Add an intern.rs module that I forgot. 2021-03-29 12:32:35 -04:00
Nick Mathewson 83ebd56f64 Add DirMgr::load_once.
This function loads a current bootstrapped directory from disk, if
it can.
2021-03-29 12:23:47 -04:00
Nick Mathewson e226a57869 Use the CircMgr in the DirMgr for all our downloading needs. 2021-03-29 12:13:31 -04:00
Nick Mathewson efe99633a5 Make CircMgr an optional element of DirMgr. Not yet used. 2021-03-29 12:00:33 -04:00
Nick Mathewson 80e9785fa3 Use interned PortPolicy objects in RouterDescs too. 2021-03-29 11:11:01 -04:00
Nick Mathewson 9e0e2475b5 Netdoc: Add support for interned PortPolicy objects in MicroDescs
In C tor, this saved a whole lot of RAM.
2021-03-29 11:07:27 -04:00
Nick Mathewson 9155ac5155 Allow HS* protover names, since these are from our standard. 2021-03-29 09:58:11 -04:00
Nick Mathewson 6e5c056c6c Use Arc::clone() explicitly with port policies 2021-03-29 09:43:28 -04:00
George Kadianakis 508f4c4f39 Don't copy exit policies around; instead use Arc. 2021-03-29 09:41:18 -04:00
Nick Mathewson 2dce8fda0b Check for channel match in create_firsthop_ntor().
This way we won't even try sending the CREATE2 cell unless the
Ed25519 identity we know for the channel matches the provided
CircTarget.
2021-03-24 15:29:52 -04:00
Nick Mathewson 570840c7e1 Refactor errors in tor-decompress and tor-dirclient.
This lets us reinstate the code in dirclient that retired circuits
depending on the error type.
2021-03-24 15:14:44 -04:00
Nick Mathewson d235971ef7 dirclient: add a function to download over a stream.
Also, remove references to DataStream, and comment on the future of
the module.
2021-03-24 13:55:12 -04:00
Nick Mathewson 3a8fccf94f Add a "this crate has no timeouts" comment to tor-proto. 2021-03-24 11:18:27 -04:00
Nick Mathewson 3833ca2665 Move stream timeout logic into tor-client.
This is consistent with the other pieces of tor-proto, which do not
handle timeouts on their own.  It also lets us remove tor-rtcompat
as a dependency from tor-proto, and simplify some of the test cases
to use async_test.

This commit unindents a lot of test code; use git's "-b" flag to
read the parts that matter.
2021-03-24 11:14:07 -04:00
Nick Mathewson 06d5988cdc upgrade to newer version of config crate. 2021-03-24 09:44:31 -04:00
Nick Mathewson d073f24138 Move responsibility for knowing about TLS into tor_rtcompat.
Now we don't need runtime-specific stuff in tor-chanmgr.
2021-03-23 15:59:39 -04:00
Nick Mathewson 68f18d4fe3 Refactor tokio implpementation in tor-rtcompat.
Now other crates don't need any 'ifdef tokio' code, since there
are wrappers that implement 'futures' right.

Technically, the 'futures' traits are in some ways less good than
the tokio ones, but we need a consistent API if we want to support
WASM someday and keep support for async_std.  I'd rather hold out
hope for a future version of futures::io working like tokio than to
fix ourselves into the tokioverse forever.
2021-03-23 11:00:09 -04:00
Nick Mathewson 886788860a Add tests for correct incoming sendme handling.
At this point I'm going to pause writing tor-proto tests for a
little while and think about refactoring that could make these tests
simpler.  I'm doing way too much copy-paste here.
2021-03-22 11:50:41 -04:00
Nick Mathewson ffb4723986 Extend the begindir test to exchange data on the stream. 2021-03-19 15:12:50 -04:00
Nick Mathewson 3587809944 Introduce a helper to tor_proto::circuit tests 2021-03-19 14:47:57 -04:00
Nick Mathewson 603b0436e0 Add a compatibility layer so we can upgrade rand_core.
dalek-crypto is stuck on rand_core 0.5.1, so we've been stuck too.
This commit introduces a compatibility module so that we can wrap
new rand_core instances to make them backward compatible.
2021-03-18 13:16:32 -04:00
Nick Mathewson c2db961424 Move our command-line interface into a new crate called "arti".
Closes #106
2021-03-17 15:14:32 -04:00
Nick Mathewson a4e0dde4da Add appropriate categories to some Cargo.toml files. 2021-03-17 14:51:18 -04:00
Nick Mathewson 6daf57957d Add the tor project as an author. 2021-03-17 14:43:40 -04:00
Nick Mathewson ba14d43be4 Add keywords to each Cargo.toml 2021-03-17 14:41:02 -04:00
Nick Mathewson c8481a9354 Add a description field to all our Cargo.toml files 2021-03-17 14:31:59 -04:00
Nick Mathewson 58d8472ea0 Give it a homepage everyplace. 2021-03-17 14:13:26 -04:00