Commit Graph

2207 Commits

Author SHA1 Message Date
Neel Chauhan 043b97fecf In reactor, use enums on whether to destroy circuits 2021-12-14 14:36:30 -08:00
Neel Chauhan b601d8b147 Methodize the destroy circuit reason 2021-12-14 14:26:45 -08:00
Nick Mathewson c75fc76c38 Merge branch 'happy-eyeballs-comment' into 'main'
tor-chanmgr: Fix happy eyeballs comment grammar in builder.rs

See merge request tpo/core/arti!197
2021-12-14 19:18:23 +00:00
Nick Mathewson 7f4578bec1 Refactor directory events to use a FlagPublisher mechanism.
This approach tries to preserve the current interface, but uses a
counter-based event backend to implement a coalescing stream of
events that can be represented as small integers.  The advantage
here is that publishing events no longer needs to be a blocking
operation, since there is no queue to fill up.
2021-12-14 14:05:02 -05:00
Neel Chauhan e67d4e0821 tor-chanmgr: Fix happy eyeballs comment grammar in builder.rs 2021-12-14 10:45:19 -08:00
Neel Chauhan ee16c69075 Remove unused started_at PendingRequest 2021-12-14 10:33:47 -08:00
Nick Mathewson d5c2361d3f Always check whether stream-level SENDMEs are expected.
(It's a protocol violation to get a SENDME when our send window is
already full.)

This patch makes SendWindow::put return a Result, so that it's
easier to do the right thing with it.

Closes #261.
2021-12-14 17:11:48 +00:00
Nick Mathewson f1acd8f99c Merge branch '260' into 'main'
Actually decrement the stream-level SENDME window

Closes #260

See merge request tpo/core/arti!194
2021-12-14 17:00:46 +00:00
eta 8d660cbcf1 Actually decrement the stream-level SENDME window
arti!126 overhauled the `tor-proto` circuit reactor, but left out one
very important thing: actually decrementing the SENDME window for
streams (not circuits) when we send cells along them.

Since the circuit-level SENDME window would often prevent us from
running into a problem, this wasn't caught until my benchmarking efforts
noticed it (in the form of Tor nodes aborting the circuit for a protocol
violation).

fixes arti#260
2021-12-14 16:37:56 +00:00
Nick Mathewson 5e63afe597 Merge remote-tracking branch 'origin/mr/189' 2021-12-14 09:11:23 -05:00
Nick Mathewson eadada1941 Merge remote-tracking branch 'origin/mr/186' 2021-12-14 09:04:10 -05:00
Neel Chauhan d621166c80 s/hidden/onion/g in code comments 2021-12-13 13:18:53 -08:00
Neel Chauhan 2595f3f8c1 Handle TRUNCATED cells 2021-12-13 12:21:25 -08:00
Neel Chauhan b6ef659311 Log on TRUNCATED cell 2021-12-13 12:21:19 -08:00
eta 8040f7afb2 Merge branch 'reconfigure' into 'main'
Make most arti-client fields reconfigurable.

See merge request tpo/core/arti!181
2021-12-13 14:49:23 +00:00
eta 214764de43 Merge branch 'bug89' into 'main'
Don't create circuits if the consensus is stale by over 72 hours

Closes #89

See merge request tpo/core/arti!190
2021-12-13 14:24:07 +00:00
Neel Chauhan 52cae03621 Don't create circuits if the consensus is stale by over 72 hours 2021-12-12 20:29:53 -08:00
Muhammad Falak R Wani c3df9cd735
proxy: send SOCKS5 reply on failure cases
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
2021-12-11 13:05:33 +05:30
Daniel Eades 88aba9e007 don't deny 'println' in examples in CI 2021-12-09 15:42:36 +00:00
Daniel Eades fe788aad5e update CI to test all targets 2021-12-09 14:30:41 +00:00
Daniel Eades e7bbe9e7a1 address lint warnings 2021-12-09 13:51:42 +00:00
Daniel Eades 47554556ec address lint warnings 2021-12-09 13:47:59 +00:00
Daniel Eades 2bcd7b6d78 address lint warnings
[Edited by nickm: This applies one of Daniel's fixes in place of one
 of Trinity's: Trinity says it's a bit cleaner, and I agree.]
2021-12-09 08:06:32 -05:00
Trinity Pointard 2339370a85 drop arcs before awaiting 2021-12-09 13:11:09 +01:00
Trinity Pointard 9753a7ee06 fix nightly clippy errors 2021-12-09 12:16:23 +01:00
Trinity Pointard 7dd1a20d42 update rusqlite and revert minimal version change 2021-12-09 11:51:39 +01:00
Nick Mathewson d0b217d1a5 Beautify some Vec->array code in tor-proto.
[T;N] supports TryFrom<Vec<T>>, and has since Rust 1.48: we can just
use that.

This resolves an XXXX comment.
2021-12-08 14:01:06 -05:00
Nick Mathewson 91ab3a7eda proxy: report an error if all listeners fail. 2021-12-08 13:52:14 -05:00
Nick Mathewson be47ac8e12 Resolve XXXXs in proxy.rs
These issues all have tickets, so can become TODOs.
2021-12-08 13:41:44 -05:00
Nick Mathewson a49c1c1f1e Treat unrecognized SENDME versions as an error.
We should never get one of these unless we have opted in to get it.

(This behavior is the same as C tor.)
2021-12-08 13:03:20 -05:00
Nick Mathewson 6f916db0ee tor-bytes: Enable `subtle` and `mac` features in digest.
These features are necessary for digest to expose its CtOutput type;
without them, the tor-bytes crate doesn't build independently.
2021-12-08 12:56:12 -05:00
Nick Mathewson 80f04a445d Merge remote-tracking branch 'origin/mr/183' 2021-12-08 12:40:34 -05:00
Nick Mathewson 9a8c91bdf8 Merge remote-tracking branch 'origin/mr/180' 2021-12-08 12:39:02 -05:00
Nick Mathewson a25960b44c tor-netdir: Resolve an XXXX about type ugliness
We had no function to infallibly convert BoundedInt32<{0 or 1},H>
into a u32, even though we could have.  Because of that, we were
treating weight_scale as an i32 when logically it's a u32 or a
NonZeroU32.

Moreover, it turns out we were using an incorrect minimum for the
bwweightscale param, which would in theory have allowed the
authorities to make us divide by zero.

This patch introduces the necessary From<> implementation and uses
it.  It corrects the binimum bwweightscale, and prevents a
division-by-zero issue in case weight_scale is zero.
2021-12-08 12:32:44 -05:00
Nick Mathewson 854b854764 Temporarily change minimal-versions CI to use Rust 1.56
Because of arti#257, compatibility with earlier versions of rust are
broken: we hope this is temporary, but fixing it will probably
require a new version of rusqlite.
2021-12-08 12:07:46 -05:00
Neel Chauhan 2d915ed684 In CryptInit, return a Result in initialize() 2021-12-08 08:38:56 -08:00
Nick Mathewson a596797660 Remove a XXXX comment in tor-llcrypto.
This comment was about an unspecified string; the issue of
specifying the string is now torspec!55.
2021-12-08 11:32:28 -05:00
Nick Mathewson 6f52b81ce8 Remove a couple of spec-related XXXXs in tor-netdir.
I've opened torspec!54 to fill in the missing parts of the spec
about these issues.
2021-12-08 11:12:33 -05:00
Nick Mathewson 940ab11b80 Use a safer histogram rebuild algorithm.
Our old algorithm could, on some inputs, exhaust RAM.  That's not great,
since we try to be robust againt corruption to the state file.
2021-12-08 10:59:36 -05:00
Nick Mathewson 8f200223f7 Change an XXX in pareto.rs: a ticket is now open. 2021-12-08 10:29:44 -05:00
Nick Mathewson a359b84318 Resolve an XXXX: timeout scaling _is_ documented 2021-12-08 10:19:11 -05:00
Nick Mathewson 9c3aa00030 Update semver_status.md with recent changes. 2021-12-08 10:08:14 -05:00
Nick Mathewson 9767a1d063 Fix Rustdoc errors. 2021-12-08 10:06:22 -05:00
eta e86ebf5569 Merge branch 'new_digest_crate' into 'main'
Upgrade to digest v0.10.0

See merge request tpo/core/arti!182
2021-12-08 13:43:01 +00:00
Nick Mathewson 4536c2ac87 Upgrade to digest v0.10.0
We generally try to track the latest rust-crypto traits when we can:
fortunately, this upgrade didn't break much, considering.
2021-12-07 20:33:46 -05:00
Nick Mathewson 327d485b17 Test FsStateMgr::path(), and fix a bug in it.
We join "state" to the directory name, so we must call parent() to get
the original.
2021-12-07 20:11:54 -05:00
Nick Mathewson b3b6a92145 Add a few tests to tor-config. 2021-12-07 19:52:49 -05:00
Nick Mathewson 42ae8c7a2a Make override_net_params take effect sooner.
This is still not as soon as I'd like: a real change here will require
refactoring DirMgr::notify().
2021-12-07 19:26:01 -05:00
Nick Mathewson 1ff5a513ae Oops: MutCfg shouldn't implement Clone.
We don't want MutCfg to be automatially coneable, or we'll wind up with
surprises like the one that this patch fixes in TorClient.

(The "surprise" is that reconfigure() would only apply its
client-specific options  to one client instance.)
2021-12-07 17:54:24 -05:00
Nick Mathewson 953ee93533 Sequence reconfiguration requests.
If we allow overlapping reconfiguration requests, we introduce all
kinds of "fun" bugs.  For example, we could wind up with a configuration
made up of parts of one reconfiguration attempt, and parts of another.
2021-12-07 17:49:03 -05:00