Commit Graph

1938 Commits

Author SHA1 Message Date
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
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
Nick Mathewson 7ac6870a0d Improve documentation of which config can change.
It no longer makes sense to say "most things can't change", now that
most things can.
2021-12-07 17:41:05 -05:00
Nick Mathewson e8ca0d7742 Make much of DirMgrConfig reconfigurable.
We can't change the authorities while in-flight: that would be pretty
miserable to implement.

Similarly we can't change the cache while in-flight.

Everything else should be fair game, though there are a couple of tricky
bits.  I've tried to document those.
2021-12-07 17:36:16 -05:00
Nick Mathewson 2689d810bf Make TorClient reconfigurable.
This covers ClientAddrConfig and ClientTimeoutConfig.
2021-12-07 16:58:41 -05:00
Nick Mathewson cac4ce759e Minor circuit predictor tweaks and comments.
Most notably, make min_exit_circs_for_port actually get used.

Also add a couple of comments.
2021-12-07 16:48:09 -05:00
Nick Mathewson 0f8d620757 Make preemptive circuits reconfigurable.
This required re-centralizing the configuration object for preemptive
circuits, since previously the settings from it were a bit spread out
over the crate.
2021-12-07 16:42:58 -05:00
Nick Mathewson 8fed1524fa MutCfg: Add map_and_replace.
This will help in the case when a configuration can only partially
change.
2021-12-07 16:40:49 -05:00
Nick Mathewson a406e8e449 Make circuit_timing reconfigurable. 2021-12-07 16:08:52 -05:00
Nick Mathewson 99fb41218d Add new configuration objects to reconfigure.
(These weren't in the codebase when I started the first version of
this branch.)
2021-12-07 15:47:25 -05:00
Nick Mathewson 11210124da Allow on-the-fly changing of path_rules
And now the complexity begins: when the user changes the path_rules,
they not only want new circuits to obey those rules: they want
_all new requests_ to be put onto circuits that obey those rules.

That means that when the path rules become more restrictive, we need
to retire all the circuits, and make sure that currently pending
circuits aren't used for any requests.

If it's any comfort, doing this was even more complicated in C tor. ;)
2021-12-07 15:42:14 -05:00
Nick Mathewson f06d5ae48f MutCfg facility to help with reconfiguration.
It's useful to keep configuration objects inside a RwLock<Arc<>>, so we
can have slightly-stale pointers to the existing configuration structure
without holding locks too long.

This code adds a MutCfg type with basic support for this pattern,
and functions to make it a bit more ergonomic.
2021-12-07 15:42:14 -05:00
Nick Mathewson 606d64eac5 Sketch API for reconfiguration.
This patch doesn't actually make anything reconfigurable, but it
does create an API that will tell you "you can't change the value of
that!"  If the API looks reasonable, I can start making it possible
to change the values of individual items.
2021-12-07 15:42:14 -05:00
eta 333d85a0d8 Merge branch 'dns_config_cleanups' into 'main'
Small cleanups to stream timeout configurations

See merge request tpo/core/arti!179
2021-12-07 20:00:31 +00:00
Nick Mathewson 2337d14ecf Make ClientTimeoutConfig members crate-private.
We shouldn't have pub members in these config objects.
2021-12-07 14:05:41 -05:00
Nick Mathewson 46c917d127 Rename timeout_rules to stream_timeouts.
(There are other timeout rules, after all.)

Also, rename stream_timeout to connect_timeout, to make it more clear
when it applies.
2021-12-07 14:03:14 -05:00
eta 2614fb736e Merge branch 'revised_preemptive_config' into 'main'
Usability: renaming and documentation in preemptive circuit config

See merge request tpo/core/arti!176
2021-12-07 17:51:42 +00:00
eta aec99469c7 Merge branch 'tlsconnector-wrapping' into 'main'
Make TlsConnector wrap TCP connections, not create its own

See merge request tpo/core/arti!166
2021-12-07 17:38:04 +00:00
eta 47c3163ce5 Merge branch 'bug252' into 'main'
Make DNS fields in arti-client/src/client.rs configurable

Closes #252

See merge request tpo/core/arti!171
2021-12-07 17:27:38 +00:00
Nick Mathewson 48f77a93c0 Clarify names and docs for predictive circuits.
Also, use humantime_serde, rather than a number of seconds, to indicate
configuration time.
2021-12-07 12:09:05 -05:00
Nick Mathewson c2e20a242a Rename circuits_preemptive to preemptive_circuits
This obeys a few conventions:
  * adjective before noun
  * config objects end with "config"
2021-12-07 12:06:53 -05:00