Commit Graph

1213 Commits

Author SHA1 Message Date
Nick Mathewson 37fe255fda Try refactoring build.rs for testability.
I'm adding a local "Buildable" trait here so I can swap out Circuits
for something else.  This also lets me refactor Builder<> to be
parameterized on TimeoutEstimator again, and lets us get rid of the
first_hop() accessor on paths.
2021-07-19 12:25:26 -04:00
Nick Mathewson 1821532dd8 Add a test for double_timeout.
There is something wrong here, though.  I had to rewrite wait_for() a
lot back in the main branch to get this test working right.  See
arti#149 for details on that issue.
2021-07-19 12:25:26 -04:00
Nick Mathewson 61d8e5175c tor-circbuild: use SleepProvider::now() instead of Instant::now()
This should make time mockable for testing purposes.
2021-07-19 12:25:26 -04:00
Nick Mathewson 94db617682 Add the ability to reconfigure a running ParetoEstimator 2021-07-19 12:25:26 -04:00
Nick Mathewson 2bc762a3ca Monomorphize: just use the pareto timeout implementation. 2021-07-19 12:25:26 -04:00
Nick Mathewson f341e493ea Allow the pareto estimator to be disabled. 2021-07-19 12:25:26 -04:00
Nick Mathewson 3e894218aa Connect the timeout estimator code to our circuit builder.
This currently leaves a bit to be desired, since the logic is kind
of gnarly.  I'm not sure I want to be using so many Arc<>s.
2021-07-19 12:25:26 -04:00
Nick Mathewson cd51d8bb8b Implement a circuit timeout estimator backend.
This backend uses the kludged-up^W heuristic-enhanced Pareto
estimator from path-spec.txt section 2.4.  See path-spec.txt for
full details on the algorithm.  I've tried to note with TODO-SPEC
comments all the things that the spec currently leaves out.

Nothing actually uses this code yet.  By the time it's in use, I'd
expect that many of these functions will need to have new
visibilities.
2021-07-19 12:25:26 -04:00
Nick Mathewson 379c28b2a8 Implement consensus parameters related to circuit timeout inference. 2021-07-19 12:25:26 -04:00
Nick Mathewson e5e46e75fd Implement TryInto<u64> for BoundedInt32 2021-07-19 12:25:26 -04:00
Eugene Lomov 88521287b4
derives for TorVersion and AuthKeyIds
Closes tpo/core/arti#147
2021-07-18 13:04:44 +03:00
Nick Mathewson 50691f2a00 Spelling fix. 2021-07-15 13:34:14 -04:00
Nick Mathewson 6838e26307 Merge remote-tracking branch 'origin/mr/38' 2021-07-15 12:36:40 -04:00
Nick Mathewson 438f61f790 Try to re-enable simple_tls test on osx.
On #111, trinity-1686a points me towards a post on the apple dev
forum, suggesting that the problem here is that OSX's
SecureTransport API doesn't support PKCS12 files with empty passwords.
2021-07-15 12:00:35 -04:00
Nick Mathewson 257ab1f665 Refactor MockSleepProvider::wait_for to work better.
This is necessary for some tests I'm doing on circuit timeout code.

It doesn't solve the wait_for issues completely; I've opened #149
for those.
2021-07-15 10:15:34 -04:00
Nick Mathewson 20bc4278d9 time mocking: only insert each Sleeping future once. 2021-07-15 10:15:34 -04:00
Nick Mathewson 70bcda78d7 Move wait_for into MockSleepProvider.
This function is generally useful for testing functions where we
want time to advance bit by bit.
2021-07-15 10:15:28 -04:00
Trinity Pointard 93347ec80e remove now invalid doc-comment 2021-07-15 00:08:47 +02:00
Trinity Pointard 74ad265ecb reexport IsolationToken in tor-client 2021-07-14 19:31:37 +02:00
Trinity Pointard 7eeecf8df5 create new type for isolation_map
and make it garbage-collected
2021-07-14 18:30:16 +02:00
Trinity Pointard 402662f09c make isolation_group optional in SupportedCircUsage 2021-07-14 17:45:01 +02:00
Trinity Pointard 52fab4e3c6 move IsolationToken to circmgr
document the behavior of IsolationToken::default
remove From and Into impls between IsolationToken and u64
2021-07-14 16:21:00 +02:00
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
Trinity Pointard 9e71e2267a fix clippy lints 2021-07-13 17:54:23 +02:00
Trinity Pointard dfd8adbb25 implement isolation in arti
rules are not configurable, but similar to default rules for Tor
(isolate by client addr, by listening port and by authentication if any)
2021-07-13 17:34:20 +02:00
Trinity Pointard 59434d0ae1 implement stream isolation 2021-07-13 16:47:57 +02: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 202420099f Update WANT_FROM_OTHER_CRATES again. 2021-07-13 10:35:07 -04:00
Nick Mathewson 4678fc0a37 Changes to WANT_FROM_OTHER_CRATES based on discussion on #146 2021-07-12 09:21:58 -04:00
Trinity Pointard ed0b51b557 cleanliness 2021-07-10 03:10:19 +02:00
Trinity Pointard 676577c184 make ipv[46]_policy take into account BadExit
they now report an empty policy for BadExit relays
2021-07-10 02:38:41 +02:00
Nick Mathewson 7d39ab29db Move responsibility for circuit construction into CircuitBuilder.
Previously this was done in functions associated with Path and
OwnedPath, but this caused their method signatures to get more and
more complicated.

This change will also allow us to make timeout handling part of the
circuit-building process.
2021-07-08 08:23:00 -04:00
Nick Mathewson 99e0c1789b Add a shell script to verify that every package has an okay license.
We implement this by giving a list of permitted licenses, and then
using cargo-license to dump everything's actual license.  Since
packages list their licenses as "x OR y OR z", we permit any package
that is available under at least one license on the allow-list.
2021-07-06 15:03:44 -04:00
Nick Mathewson 3a38d4ff7b Rename "send_me_*" to "sendme_*" 2021-07-06 12:34:02 -04:00
Nick Mathewson 49fed45631 Fix an unused variable warning when fuzzing tor-netdoc 2021-07-02 08:41:51 -04:00
Nick Mathewson 57537cf565 Fix some code-rot in tor-netdoc fuzz targets 2021-07-02 08:41:30 -04:00
Nick Mathewson e0797aa1a1 Revert "clippy: remove unneeded dependencies."
This sort of reverts 37b978ae1b.

It appears that on nightly, these imports are necessary. Was there a
change in the import resolver?
2021-07-02 08:40:44 -04:00
Nick Mathewson b0167eec44 Allow tor-rtcompat to build with no runtimes.
Thanks to cargo's version-2 feature resolver, we can require a
runtime for tests only.

I'm also making it so that the functions that create or fetch
Runtimes only exist when one of the runtime features is enabled.
For now that seems like a better solution than having those
functions exist but panic.

Closes #129.
2021-07-01 09:47:55 -04:00
Nick Mathewson 37b978ae1b clippy: remove unneeded dependencies. 2021-06-27 14:32:46 -04:00
Nick Mathewson 1c21295d19 Merge remote-tracking branch 'origin/mr/34' 2021-06-27 14:30:49 -04:00
Nick Mathewson 1d16bcf16b Toposort the workspace members list. 2021-06-24 11:44:54 -04:00
Nick Mathewson e1d53cecf8 Rename tor-client to arti-tor-client for now. 2021-06-24 11:17:14 -04:00
Nick Mathewson 8947e54d7e Remove "default-features=false" thing on tor-rtcompat for now. 2021-06-24 10:53:11 -04:00
Nick Mathewson adc611dc72 Fix category in tor-config/Cargo.toml 2021-06-24 10:45:43 -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 2df9b0e921 Bump version dependencies to 0.0.0 2021-06-24 09:27:17 -04:00
Nick Mathewson e5b6dea6fd Remove version=* in tor-rtmock 2021-06-24 09:24:19 -04:00
Nick Mathewson b3cc087acc List version 0.0.0 for tor-llcrypto dependency in tor-bytes 2021-06-24 09:20:04 -04:00
Nick Mathewson 920539bb05 Missing fields in tor-units/Cargo.toml. 2021-06-24 07:20:40 -04:00
Nick Mathewson b774360755 Remove "publish = false" 2021-06-24 07:04:26 -04:00