Commit Graph

334 Commits

Author SHA1 Message Date
Nick Mathewson 3a730de601 Revert "Use coarsetime to build an incoming traffic timestamp."
This reverts commit f30b22802a.

It turns out (see torspec#57) that there is no need for us to keep
this timestamp -- at least, not for the use we had in mind in
circuit timeouts.
2021-07-13 13:18:10 -04:00
Nick Mathewson f30b22802a Use coarsetime to build an incoming traffic timestamp.
We need this for the circuit timeout estimator (#57).  It needs to
know "how recently have we got some incoming traffic", so that it
can tell whether a circuit has truly timed out, or whether the
entire network is down.

I'm implementing this with coarsetime, since we need to update these
in response to every single incoming cell, and we need the timestamp
operation to be _fast_.
2021-07-13 10:35:46 -04:00
Nick Mathewson 1c21295d19 Merge remote-tracking branch 'origin/mr/34' 2021-06-27 14:30:49 -04:00
Nick Mathewson 38db8cb551 Add version="0.0.0" to dependencies that were missing it 2021-06-24 09:47:48 -04:00
Nick Mathewson b774360755 Remove "publish = false" 2021-06-24 07:04:26 -04:00
YUAN LYU 92dbf20a76 Add clippy warn needless pass by value 2021-06-21 23:27:19 -04:00
YUAN LYU b830e81b7f Add clippy warn needless borrow 2021-06-21 21:34:40 -04:00
Nick Mathewson 36b0a666cb A few tests for circparameters generation. 2021-06-19 17:21:58 -04:00
Nick Mathewson 8f8a2cf4ab Misc tests in tor-proto. 2021-06-19 13:01:35 -04:00
Nick Mathewson e6faeaa1f8 Fix some warnings about needless & from nightly clippy 2021-06-18 07:19:24 -04:00
Nick Mathewson 581ccac9da Try to fix a nightly rustdoc warning 2021-06-17 12:31:55 -04:00
Nick Mathewson 561ca57282 Use FuturesUnordered, not SelectAll<Once<...>>
Closes #124
2021-06-14 12:46:32 -04:00
Nick Mathewson f3574015bc Implement Debug for ClientCirc and Channel. 2021-06-14 09:27:44 -04:00
Nick Mathewson 8e2246b009 Make a few error types implement Clone
To make this work we have to wrap std::io::Error in an Arc.  The
benefit of having these errors implement Clone is that we can
provide the same Error in response to multiple requests when they
are all waiting on the same operation.
2021-06-14 09:24:08 -04:00
Nick Mathewson 39b8dd317b Add a warning comment about truncate-and-reextend. 2021-05-28 08:55:14 -04:00
Nick Mathewson 10ca46160b tor-proto: change internal meta-handler API for error-proofing
The previous API required the caller to check that the meta-cell it
got was coming from the right hop; the new API requires the caller
to say which hop it expects to get a cell from.  With this change,
it's not possible to omit the correct-hop check.
2021-05-28 08:44:37 -04:00
Nick Mathewson 2102d2e2b5 Add noop_method_call warning.
This would have saved ahf and me a lot of confusion in debugging a
situation where we were cloning a reference of a type that didn't
implement Clone.
2021-05-27 14:32:29 -04:00
Nick Mathewson 7f681ac824 Use the "typos" tool to fix some spelling 2021-05-26 19:18:35 -04:00
Nick Mathewson 30ab1dc7bb Update hs_ntor code.
Work with the latest version of the crypto crate, and suppress the
unreachable_pub warning.
2021-05-25 16:10:11 -04:00
Nick Mathewson 745c90e92c Enable cargo_common_metadata warning. 2021-05-25 15:42:47 -04:00
Nick Mathewson cf59e9be77 Add automatically generated README.md files to each crate. 2021-05-25 15:41:23 -04:00
Nick Mathewson 696202217b Add a link tto the tor website to arti blurb. 2021-05-24 08:44:04 -04:00
Nick Mathewson 50aee17871 Add tor-proto docs and tweak docs+apis elsewhere. 2021-05-21 15:40:08 -04:00
Nick Mathewson ce6702a147 Give every Cargo.toml a repository field 2021-05-19 14:56:09 -04:00
Nick Mathewson 411e1b35e0 Add the "unreachable_pub" lint.
This is a somewhat obnoxious change in its scope and requirements,
but it makes it easier to understand what the real public and
private parts of our APIs are.
2021-05-18 13:45:39 -04:00
Nick Mathewson 80535dda01 Check "connection" usage for when stream or channel would be better. 2021-05-18 11:17:28 -04:00
Nick Mathewson 9e7de1a692 Prefer "relay" over "node" in most circumstances. 2021-05-18 11:04:44 -04:00
Nick Mathewson e2139e8afc Prefer "relay" over "router" in docs and APIs. 2021-05-18 10:58:12 -04:00
Nick Mathewson 90e96b32c8 Prefer "relay" to "server" when appropriate. 2021-05-18 10:34:15 -04:00
Nick Mathewson e01f227191 Resolve clippy warnings from Rust 1.52.
Rust 1.52 just came out, and there are new clippy lints to deal
with:

   * It spots more cases when we could use Option::map
   * It spots more cases when we could use Iterator::flatten
   * When we build a struct instance, it wants us to list the fields
     in the same order that the struct declares them.
2021-05-07 15:53:17 -04:00
Nick Mathewson 7c7be3a3f1 Upgrade to latest RustCrypto crates. 2021-05-06 07:57:31 -04:00
Nick Mathewson 760aab7a0a Fix documentation warnings. 2021-05-05 17:34:49 -04:00
Nick Mathewson 8eb36cbfff Add trait_duplication_in_bounds warning. 2021-05-03 16:30:27 -04:00
Nick Mathewson d516298b47 Add unseparated_literal_suffix lint, and fix it. 2021-05-03 16:19:01 -04:00
Nick Mathewson 9737580402 Add a few more clippy warnings 2021-05-03 16:10:39 -04:00
Nick Mathewson c6b54086a8 Make `now` an argument when verifying a channel.
It turns out that we want to take `now` from the Runtime, to make
higher level code testable.
2021-04-30 13:46:54 -04:00
Nick Mathewson d89923ef19 note a small divergence in circuit id probing behavior. 2021-04-29 16:57:06 -04:00
Nick Mathewson 87a03d01e5 Remove pin_project usage in tor-proto.
Turns out we didn't need it.
2021-04-28 11:31:41 -04:00
Nick Mathewson 94c93c9121 Add some more clippy warnings to our list. 2021-04-27 14:51:04 -04:00
Nick Mathewson 2e3780affb Enforce (and obey) clippy lints about exhaustive enums, structs.
These lints force us to declare our exported enums and
exhaustive-looking structs as non-exhaustive (so that we can add to
them in the future without breaking our API) or to explicitly
disable the warning for a given enum/struct (to say that we _intend_
for additions to be a breaking change).
2021-04-27 14:17:49 -04:00
Nick Mathewson 4306a28ddd cargo fix --edition-idioms 2021-04-26 11:11:05 -04:00
Nick Mathewson adefe60f60 upgrade httparse and zeroize 2021-04-25 12:39:35 -04:00
Nick Mathewson 12c45882f0 Refactor and simplify ChanMgr to use AbstractChanMgr. 2021-04-23 12:57:45 -04:00
Nick Mathewson 9f44408bb9 Upgrade rsa, zstd, httpdate. Remove redundant pin-project. 2021-04-05 08:26:29 -04:00
Nick Mathewson 23c672708a Merge branch 'hs3_ntor_squashed' 2021-04-02 08:34:46 -04:00
Nick Mathewson 89cae112b6 hs_ntor: add a disclaimer and put it behind a feature. 2021-04-02 08:34:03 -04:00
George Kadianakis 81fa7d01ad First draft of HS Ntor implementation. 2021-04-02 08:30:45 -04:00
Nick Mathewson e68c27a324 Fix a rust 1.51 warning: remove a semicolon 2021-04-02 08:00:25 -04:00
Nick Mathewson 7aa876cc0a Resolve rustdoc warnings. 2021-03-29 18:18:25 -04: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