Commit Graph

3096 Commits

Author SHA1 Message Date
Nick Mathewson 6f3f351140 Increase our MSRV to 1.56.
Our support policy says that we can update to any Rust released at
least 6 months ago; 1.56 came out on 21 October 2021.

This doesn't yet change any code: it just increases the version
we say we need in our README, and the version we test against in
CI.

Our main justification for this change is to be able to upgrade to
newer versions of our dependencies, including `async_executors` >=
0.5, `aes` >= 0.8, and `cipher` >= 0.4.
2022-04-25 13:03:31 -04:00
Ian Jackson 144f886e72 Merge branch 'integers' into 'main'
Better handling of integer overflows

See merge request tpo/core/arti!466
2022-04-25 09:50:12 +00:00
Ian Jackson 0d4c53bb2d Merge branch 'experimental-v3ident-public' into 'main'
Authority: make v3ident public under experimental-api

See merge request tpo/core/arti!463
2022-04-25 09:31:05 +00:00
Ian Jackson 174883ee6d Merge branch 'fix-typos' into 'main'
Fix typos bothering rust-nightly pipeline

See merge request tpo/core/arti!464
2022-04-25 09:27:50 +00:00
Ian Jackson 96fdaa7934 Merge branch 'test' into 'main'
tor-basic-utils: Add RetryDelay::reset test

See merge request tpo/core/arti!467
2022-04-25 09:25:23 +00:00
Ian Jackson 28c9be1283 Merge branch 'type-skewestimate' into 'main'
fix typo in doc

See merge request tpo/core/arti!469
2022-04-25 09:23:52 +00:00
trinity-1686a b9dd23de91 fix typo in doc 2022-04-25 00:27:29 +02:00
Samanta Navarro 77653608d6 tor-error: Handle integer overflows
If duration addition overflows, then continue with Never.

Caching the AbsRetryTime constructed with duration from supplied
function also reduces the overhead of earliest_absolute.
2022-04-23 13:33:00 +00:00
Samanta Navarro f0bc1b6649 retry-error: Handle integer overflow
In theory n_errors could overflow, which is an error in Rust.
The check is cheap and I have added a test for it.
2022-04-23 13:32:27 +00:00
Samanta Navarro d3b1a93474 tor-basic-utils: Add RetryDelay::reset test 2022-04-23 12:04:15 +00:00
Christian Grigis 349b5497a5
Fix typos bothering rust-nightly pipeline 2022-04-22 19:53:31 +02:00
Christian Grigis 08bce9b6db
Authority: make v3ident public under experimental-api 2022-04-22 19:33:36 +02:00
eta a566f82d40 Merge branch 'config-sub' into 'main'
Replace much handwritten config code with use of derive_builder

See merge request tpo/core/arti!462
2022-04-22 17:15:27 +00:00
Ian Jackson 89824fc7ea arti-client: TorClientConfig: derive TorClientConfigBuilder
Replace handwritten builder struct, accessors, and builder function.
2022-04-22 17:48:03 +01:00
Ian Jackson 6da5c9af5e arti: ArtiConfig: derive ArtiConfigBuilder
Replace handwritten builder struct, accessors, and builder function.
2022-04-22 17:48:03 +01:00
Ian Jackson 79decd4ac8 logfiles: Introduce LogfileListConfigBuilder
In
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
we decided not to do this.

However, having looked again at the way the FallbackList works, I
think there is a lot of value in making these two things (and anything
else like them[1]) as similar as possible.

[1] At least PreemptiveCircuitConfig.initial_predicted_ports and
NetworkConfig.authorities need the same treatment, and perhaps also
GuardUsage.restrictions (although there is no
GuardRestrictionBuilder).

In the irc discussion I imagined `LogfilesConfigBuilder` as opposed to
`LogfileConfigBuilder` (differing only in the `s`) which would be bad,
but we can use `List` instead.

We do *not* need to abstract away the validated version of the config.
Providing a type alias helps the derive_builder sub_builder DTRT
without needing special overrides.

I have split this commit so that we can drop it, if we conclude it's
not wanted.
2022-04-22 17:48:03 +01:00
Ian Jackson 33565ea618 logfiles: Adjust LoggingConfigBuilder::file and impl Deserialize
Change LoggingConfigBuilder to contain Vec<LogfileConfigBuilder>,
not Option<Vec<LogfileConfig>>.  That makes it sane to Deserialize.

Replace LoggingConfigBuilder's file(Vec<>) setter with the methods
discussed in
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
2022-04-22 17:48:03 +01:00
Ian Jackson 211cb1958e logfiles Rename LogfileConfig::file to files
It's a plural, and that fact is going to be exposed via serde, if it
isn't already.
2022-04-22 17:48:03 +01:00
Ian Jackson 962b6c32e1 fallback list: Introduce and use FallbackListBuilder
Now the network fallbacks configuration wants to Deserialize
a Vec<FallbackDirBuilder>, rather than validated Vec<FallbackDir>.

Methods on FallbackListBuilder are as per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
mutatis mutandi for the fact that this struct has only fallbacks in it.
2022-04-22 17:48:03 +01:00
Ian Jackson 61425a96bd fallback list: Move default list into tor-guardmgr
This is where the FallbackList type is.  We are going to want to
provide a builder too, which ought to impl Default.

This means that the default value for the type must be next to the
type.  In any case, it was anomalous that it wasn't.

This commit is pure code motion.
2022-04-22 17:39:58 +01:00
Ian Jackson 91a8bc0c11 impl From<SubfieldBuildError> for ConfigBuildError
We are going to be using sub-field builders.
2022-04-22 16:46:32 +01:00
Ian Jackson 6da7a2e3e2 Use git source for derive_builder for now, for sub_builder feature
This commitid is the current head of my MR branch
  https://github.com/colin-kiegel/rust-derive-builder/pull/253
  https://github.com/ijackson/rust-derive-builder/tree/field-builder
Using the commitid prevents surprises if that branch is updated.

We will require this newer version of derive_builder.  The version
will need to be bumped again later, assuming the upstream MR is merged
and upstream do a release containing the needed changes.

We will need the new version of not only `derive_builder_core` (the
main macro implementation) but also`derive_builder` for a new error
type.
2022-04-21 14:07:28 +01:00
eta 225accd67e Merge branch 'typos' into 'main'
Fix typos

See merge request tpo/core/arti!461
2022-04-20 15:37:33 +00:00
Samanta Navarro ee78bd7f84 Use https instead of http
Keep http in license text.
2022-04-20 11:48:55 +00:00
Samanta Navarro d3031b437b Fix wording in FAQ 2022-04-20 11:48:45 +00:00
Samanta Navarro 142e57b03a Fix typos
Typos found with codespell.
2022-04-20 11:48:43 +00:00
Nick Mathewson ac8d444aa3 Merge branch 'ticket_282' into 'main'
Remove obsolete files from our state directory.

Closes #282

See merge request tpo/core/arti!457
2022-04-14 12:18:30 +00:00
Nick Mathewson 2847a57a1e Fix build with Rust 1.53; we can't use map_while 2022-04-14 07:32:05 -04:00
Ian Jackson b1d375c785 tor-persist::fs::clean: Log warnings for directory read failures 2022-04-14 10:14:03 +01:00
Nick Mathewson 93cd0bc383 tor-persist::fs::clean: Tweaks based on review.
Rename "deletable" to "obsolete".

Simplify function structure.

Report errors from `metadata()` and `modified()`.

Don't claim that we're going to delete something unless we are.

Comment about making CUTOFF configurable.
2022-04-13 19:44:52 -04:00
eta 41dd682552 Merge branch 'report-skew' into 'main'
Report skew estimates from arti-client

See merge request tpo/core/arti!455
2022-04-13 12:51:23 +00:00
Nick Mathewson 64699a2b99 Remove obsolete files from our state directory.
This patch removes files created by older versions of arti, if they
are at least 4 weeks old.

Closes #282
2022-04-12 17:15:05 -04:00
Nick Mathewson 526b00c9b2 Re-indent tor-persist/Cargo.toml. 2022-04-12 13:39:32 -04:00
eta 9689468a3a Merge branch 'typo' into 'main'
Fix typos

See merge request tpo/core/arti!453
2022-04-12 17:34:10 +00:00
eta bd28cd5bb7 Merge branch 'backoff_on_preemptive_circs' into 'main'
circmgr: back off on preemptive circuits if they fail consistently

Closes #437

See merge request tpo/core/arti!456
2022-04-12 17:33:45 +00:00
Nick Mathewson 4582dddca8 circmgr: back off on preemptive circuits if they fail consistently
Rather than running preemptive circuit construction every 10
seconds, we change it to back off when it is "failing".  (We define
"failing" as creating no new circuits, and as giving at least one
error.)

This change means that we'll have one less reason to hammer the
network when our connectivity is failed for some reason.

Closes #437.
Part of #329.
2022-04-12 09:19:10 -04:00
Nick Mathewson 482c022e23 circmgr: Remove now-unused scheduled entry points.
Now that we have TaskSchedule, we don't need to expose these any
longer.
2022-04-12 09:04:10 -04:00
Nick Mathewson 3d5276a9cc circmgr: Report CircProvenance from AbstractCircMgr.
This feature is similar to ChanProvenance from ChanMgr, except that
we don't yet need to report it outside the crate.  I'm going to use
it to distinguish newly created circuits from existing circuits in
the preemptive circuit builder.
2022-04-12 08:41:32 -04:00
Nick Mathewson 11a9091602 arti-client: Report clock skew when it is noteworthy
(Also, blame clock skew when it is an explanation of why we cannot
finish a connection.)
2022-04-12 08:03:49 -04:00
Nick Mathewson 5f946b8d45 chanmgr: expose whether we are failing because of expired certs. 2022-04-12 08:03:49 -04:00
Nick Mathewson 72f00daf12 circmgr: re-export clock skew estimates. 2022-04-12 08:03:49 -04:00
Nick Mathewson 5f5cbdc08e GuardMgr: publish skew estimates.
Instead of just having a function that recalculates the latest clock
skew, instead recalculate the clock skew when it may have changed,
and notify other processes via a postage::watch.
2022-04-12 08:03:49 -04:00
eta 5c1e7db01e Merge branch 'guardmgr_test_fix' into 'main'
guardmgr: fix a unit test panic.

See merge request tpo/core/arti!454
2022-04-11 18:40:14 +00:00
Dimitris Apostolou ea283584f5
Fix typos 2022-04-11 21:21:17 +03:00
Nick Mathewson 61080dcaec guardmgr: fix a unit test panic.
Apparently on OSX you are not allowed to construct an Instant that is a
long time before the time when the test is running.

Also, fix the length of a year in this test.
2022-04-11 14:13:17 -04:00
Nick Mathewson 9f7a80b5f2 Merge branch 'record-skew-v3' into 'main'
Collect and analyze clock skew information

See merge request tpo/core/arti!450
2022-04-11 17:27:14 +00:00
Nick Mathewson 4efe45ce6e handshake.rs: Document the time for clock skew authentication. 2022-04-11 12:34:16 -04:00
Nick Mathewson c909926302 Fold FallbackStatus into Entry.
This simplifies the code a lot.
2022-04-11 12:34:16 -04:00
Nick Mathewson 452e1c0935 Add a couple of TODO items to clock-skew estimator. 2022-04-11 12:34:16 -04:00
Nick Mathewson cf362fac9f Implement a better clock skew estimator.
This time, our estimator discards outliers, takes the mean of what's
left, and uses the standard deviation to try to figure out how
seriously to take our report of skew/not-skew.

These estimates are still not actually used.
2022-04-11 12:34:16 -04:00