Commit Graph

3763 Commits

Author SHA1 Message Date
Nick Mathewson c3da82fc2d tor-cell: error usefulness and style fixes 2022-06-22 10:02:42 -04:00
Nick Mathewson e3e922d03f Improve error messages in tor-checkable. 2022-06-22 09:48:42 -04:00
Nick Mathewson 5577163387 tor-socksproto: Style and info fixes in errors.
(The use of Cow<> in the error message isn't strictly necessary
here, but it's a pattern I want to encourage.)
2022-06-22 09:16:44 -04:00
Nick Mathewson 3120f1092a Style fixes to tor-bytes errors.
Also note an issue with the design of tor-bytes::Error that should
probably go in a separate MR.
2022-06-22 09:00:59 -04:00
Nick Mathewson 7163b7dcc0 Style fixes to tor-protover errors. 2022-06-22 08:50:44 -04:00
Nick Mathewson f6d6ac7fe9 tor-llcrypto: style fixes on BlindingError 2022-06-22 08:47:18 -04:00
Nick Mathewson 9ba7750dfe Style fixes to tor-units errors. 2022-06-22 08:42:13 -04:00
Nick Mathewson bf2336e547 Style fixes to tor-events errors. 2022-06-22 08:39:44 -04:00
Nick Mathewson c39631af27 tor-config: style fixes on CfgPathError. 2022-06-22 08:36:13 -04:00
Nick Mathewson 37cbd38abc tor-config: Don't format source error as part of error message
This is one I missed earlier.
2022-06-22 08:23:33 -04:00
Nick Mathewson 48653df68f Style fixes to retry-error error messages. 2022-06-22 08:11:44 -04:00
Nick Mathewson 9102948045 Style fixes to safelog errors. 2022-06-22 08:07:37 -04:00
Nick Mathewson 326ab1a7ae Editorial improvements on fs-mistrust errors
These changes make sure that the errors conform to our preferred
style, and include a description of what exactly we were doing when
something went wrong.
2022-06-22 08:03:15 -04:00
Nick Mathewson 08d9bbf33b Do not include error source() in display() format.
According to doc/Errors.md, and in keeping with current best
practices, we should not include display an error's `source()` as
part of that error's display method.  Instead, we should let the
caller decide to call source() and display that error in turn.

Part of #323.
2022-06-21 14:14:14 -04:00
Nick Mathewson d95f597323 Run cargo update in preparation for release on Friday 2022-06-21 08:54:12 -04:00
eta 073b64b155 Merge branch 'main' into 'main'
Updated the warning message providing additional information about the type of the proxy port.

See merge request tpo/core/arti!596
2022-06-21 12:47:46 +00:00
0x4ndy 3175d96236 Updated the warning message providing additional information about the type of the proxy port. 2022-06-21 12:47:46 +00:00
Ian Jackson a3d8a425c4 Merge branch 'ring_out_the_old' into 'main'
Enforce no-ring-in-arti/full (and make it true)

See merge request tpo/core/arti!592
2022-06-17 13:42:38 +00:00
Nick Mathewson 9ae57e8bc4 Merge branch 'reachable_addrs_v2' into 'main'
Implement support for reachable_addrs

Closes #491 and #93

See merge request tpo/core/arti!583
2022-06-17 13:16:16 +00:00
Nick Mathewson f4c9b9cc1e Rename guardset-selection function.
Also, improve its documentation.
2022-06-17 08:47:57 -04:00
Nick Mathewson 03568cd4a5 Rename pick_guard, pick_guard_ext.
Now the primary exposed function is `pick_guard` again.

This commit is just function renaming.
2022-06-17 08:47:57 -04:00
Nick Mathewson 1be44891c9 Refactor and document issues with modify_hop.
At the site of modify_hop, we now have a comment explaining the
internal-error issue.

To make the internal error less likely, we lower the modify_hop call
in lib.rs into GuardSet, where it can make sure it's looking at the
same filter as was used to select the guard.

The function name "pick_guard_ext" is not permanent; I'm going to
rename it in the next commit.
2022-06-17 08:47:57 -04:00
Nick Mathewson 96dfa97473 API-fix for extend_sample_as_needed.
Previously, the API said "you need to call this in a loop till it
returns false".  We did that in one place, but not another.

With the introduction of filters, forgetting to loop here becomes a
bug: so instead, change the behavior of extend_sample_as_needed so
it handles looping itself.
2022-06-17 08:47:57 -04:00
Nick Mathewson a92dfa0b2a Remove some outdated comments.
These all say, in one form or another, "there is no guard filtering;
there is only one selection".  That's now false.
2022-06-17 08:47:57 -04:00
Nick Mathewson 89f9e1decb Tweak parameters in guardmgr tests to improve testnet behavior.
The fake network we construct for these tests is small in ways that
can sometimes cause weird behavior with guard filters.  We fix this
by adjusting the parameters of the guard selection algorithm
accordingly in the tests.

With these new parameters, #491 no longer occurs.

This commit also adds comments to explain why the parameters are set
as they are.

Closes #491.
2022-06-17 08:47:57 -04:00
Nick Mathewson 34e8e208cc CircMgr: Enable reachable_addrs filter. 2022-06-17 08:47:57 -04:00
Nick Mathewson 1c5f540dc8 Add a configuration option for reachable_addrs
(This doesn't do anything yet.)
2022-06-17 08:47:57 -04:00
Nick Mathewson fb672dc688 NetDoc: Make AddrPortPattern implement serde traits
I'm using serde_with here to just re-use the Display and FromStr
implementations, since those are what has proven easier to type in
the past.
2022-06-17 08:47:57 -04:00
Nick Mathewson 48a86506be GuardMgr: Support for multiple guard sets
guard-spec.txt specifies that we have multiple separate samples of
guards that we can use depending on whether the filter is
restrictive or not.  Here we implement the rules for switching
between samples.
2022-06-17 08:47:57 -04:00
Nick Mathewson e098a5a303 Move set_filter into GuardMgrInner.
Convert its argument type to Option<&NetDir> to better match the
rest of the API.
2022-06-17 08:47:57 -04:00
Nick Mathewson a720f4f667 GuardMgr: Function to tell how permissive a filter is.
When we're filtering guards, we have to check whether the filter is
"restrictive": if it forbids most of the guards (by bandwidth), we
keep its guards separated from the main set.  If it is
super-restrictive, we also warn.

This functionality is specified in guard-spec.txt.
2022-06-17 08:47:57 -04:00
Nick Mathewson 19fa946fc7 Make AddrPortPattern and friends implement Eq and PartialEq 2022-06-17 08:46:16 -04:00
Nick Mathewson e3c2a86195 GuardMgr: Also apply filters to fallback directories. 2022-06-17 08:46:16 -04:00
Nick Mathewson a189aaf1fb GuardMgr: remove disallowed addresses from returned FirstHops.
Since a guard can have a bunch of addresses, and the guard is
permitted if any one of those addresses is permitted, then we might
decide to use a guard with some non-permitted addresses.  Thus, we
need to filter those addresses before returning the view of the
guard as a FirstHop.
2022-06-17 08:46:16 -04:00
Nick Mathewson 23218fe037 GuardMgr: Remove old testing filter variant.
We don't need to restrict based on bits in the key id any longer,
since we have a real filter.
2022-06-17 08:46:16 -04:00
Nick Mathewson 9c4f31edc1 GuardMgr: Add a new filter type based on reachable addresses. 2022-06-17 08:46:16 -04:00
Nick Mathewson 801b6bec5f Guardmgr: Change the GuardFilter API.
The guard filter is now a set of restrictions that can be placed on
allowable guards.
2022-06-17 08:46:16 -04:00
Nick Mathewson bf15abbb97 Avoid matching crate names by prefix. 2022-06-17 08:41:38 -04:00
Nick Mathewson 5509bd0269 Merge branch 'config-fix2' into 'main'
Use impl_standard_builder more and remove manual Default/builder impls

See merge request tpo/core/arti!594
2022-06-16 20:30:34 +00:00
Nick Mathewson 677f1b8af0 Update check_tree to better detect errors in cargo-tree. 2022-06-16 16:13:11 -04:00
Nick Mathewson 349f9d5000 Don't install cargo-tree: It's built-in. 2022-06-16 15:54:21 -04:00
Ian Jackson 44659ebb8b tor-proto: channel: Tell clippy it's ok to print in tests 2022-06-16 19:33:32 +01:00
Ian Jackson 61bd8b810a Merge branch 'upgrade_float_eq' into 'main'
Upgrade to float_eq 1.0.0

See merge request tpo/core/arti!591
2022-06-16 17:26:04 +00:00
Ian Jackson db51bdcbc1 Merge branch 'config-fix' into 'main'
Config handling and logging fixes

Closes #480

See merge request tpo/core/arti!589
2022-06-16 15:46:18 +00:00
Ian Jackson ed62a575d3 arti: cfg: Remove another needless borrow 2022-06-16 16:08:10 +01:00
Ian Jackson 2ca2c03059 impl_standard_builder: Use for tor_dirmgr::Authority 2022-06-16 15:42:06 +01:00
Ian Jackson e004316942 impl_standard_builder: Use for tor_guardmgr::FallbackDir 2022-06-16 15:42:06 +01:00
Ian Jackson 17caebd284 impl_standard_builder: Use for tor_dirmgr::DownloadSchedule 2022-06-16 15:42:06 +01:00
Ian Jackson c466f13ce3 impl_standard_builder: Use for arti::logging::LogfileConfig 2022-06-16 15:42:06 +01:00
Ian Jackson 90ba8b15de impl_standard_builder: Allow for !Default 2022-06-16 15:42:06 +01:00