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
Ian Jackson
d2bd71c5f0
dirmgr: DirBootstrapStatus: Refactor mut_status_for using entries_mut
...
IMO this is rather less confusing.
2022-06-22 10:53:02 +01:00
Ian Jackson
d36c433b36
dirmgr: Use new statuses() helper method
...
The two call sites become clearer, IMO.
2022-06-22 10:53:02 +01:00
Ian Jackson
24d43f83fd
dirmgr: DirBootstrapStatus: Provide statuses and entries_mut
...
We're going to use these in a moment.
One returns entries and the other statuses simply because that's
what's actually going to be wanted.
2022-06-22 10:53:02 +01:00
Ian Jackson
5c51d03efb
dirmgr: Remove a TODO comment
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/587#note_2815945
2022-06-22 10:53:02 +01:00
Arturo Marquez
2d92e9e218
Remove unused `base64` crate
2022-06-21 20:28:58 -05:00
Arturo Marquez
6536ca0f61
Replace `base64` crate with `base64ct` crate
...
Note: the `base64ct` crate rejects invalid characters when the
decoding is done on padded strings. However, the `FromStr` impl
for `B64` can have both padded **and** unpadded inputs, so all
inputs are now padded first, before decoding.
2022-06-21 20:02:33 -05:00
eta
4e3537746f
Merge branch 'display_source_cleanup' into 'main'
...
Do not include error source() in display() format.
See merge request tpo/core/arti!598
2022-06-21 19:34:27 +00:00
Ian Jackson
9b4ba4893e
Merge branch 'stalled_directory' into 'main'
...
Detect and report stalled directory downloads
Closes #468
See merge request tpo/core/arti!587
2022-06-21 19:13:40 +00:00
Ian Jackson
0bd375cb34
Merge branch 'channel' into 'main'
...
Plumb channel padding timing parameters from netdir to tor-proto
See merge request tpo/core/arti!586
2022-06-21 18:37:27 +00:00
Ian Jackson
da2e53bf76
tor-chanmgr: Change to use unwrap_void
...
As per discussion in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813573
2022-06-21 19:19:28 +01:00
Ian Jackson
a2614729a4
channel padding: Rename ChannelsParams from ChannelsConfig (rustfmt)
...
Consequential ordering changes.
2022-06-21 19:19:28 +01:00
Ian Jackson
7d676cde02
channel padding: Rename ChannelsParams from ChannelsConfig
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2814276
Change names and comments and docs everywhere.
2022-06-21 19:19:28 +01:00
Ian Jackson
ff228e5d9c
channel padding: chanmgr: Clarify a comment
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813574
2022-06-21 19:19:28 +01:00
Ian Jackson
65e6683b0b
tor-proto: Have Channel::reconfigure throw ChannelClosed
...
Addresses
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813567
2022-06-21 19:19:28 +01:00
Ian Jackson
13ca24ba3a
tor-proto: err: Provide ChannelClosed as a separate unit error
2022-06-21 19:19:28 +01:00
Ian Jackson
19c52ff8e4
channel padding: Use IntegerMilliseconds in netdir
2022-06-21 19:19:28 +01:00
Ian Jackson
db71018021
tor-netdir: Make CHANNEL_PADDING_TIMEOUT_UPPER_BOUND pub
...
We need this because it is a type parameter for the types of nf_ito_*.
2022-06-21 19:19:28 +01:00
Ian Jackson
9779e5a2e2
channel padding: Use IntegerMilliseconds in padding::Parameters
2022-06-21 19:19:28 +01:00
Ian Jackson
b1b840c7c6
tor-units: IntegerTimeUnit: Provide try_map
...
This lets a caller map the inner value, eg to convert the type.
I don't provide `map` as well as `try_map` now, since I don't need it;
we could add it later if it is desirable (although try_map can always
be used instead).
I was hoping to provide a `TryFrom` instead, but that necesasrily
overlaps with the std conversion impl from IntegerMilliseconds<T> to
IntegerMilliseconds<U> where T == U.
2022-06-21 19:19:22 +01:00
Ian Jackson
0ea34e3280
tor-units: IntegerTimeUnit: Relax condition on T
...
It is semantically quite meaningful for these to contain something
that isn't `TryInto<u64>`. (Of course the `Duration` conversion won't
work without that.)
Indeed, this condition was only applied to two out of the three types.
Prompted by being near this code, but not actually necessary for
anything I'm doing here.
2022-06-21 19:19:22 +01:00
Ian Jackson
ec756c79e7
tor-units: IntegerTimeUnit: Provide as_time_unit deconstructor
...
We're going to need this to use this in the padding timer parameters.
2022-06-21 19:19:22 +01:00
Ian Jackson
db4e5aba97
channel padding parameters update: Drop a redundant clone
2022-06-21 19:19:22 +01:00
Ian Jackson
a5aaa56c3c
channel padding: Change timeout to match C Tor
...
Pending an official value from the spec.
2022-06-21 19:19:22 +01:00
Ian Jackson
2d97ab3677
Fix docs for `CtrlMsg::ConfigUpdate`
...
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813565
2022-06-21 19:19:22 +01:00
eta
54c7070b30
Fix typos
2022-06-21 19:19:22 +01:00
Ian Jackson
d2b783641d
channel padding: Test timeout updates
2022-06-21 19:19:22 +01:00
Ian Jackson
e0040701d0
tor-chanmgr tests: Add config_update tracking to FakeChannel
2022-06-21 19:19:22 +01:00
Ian Jackson
6e07401e6b
channel padding: Honour NetDir for timeouts
...
But padding is still not enabled by default.
2022-06-21 19:19:22 +01:00
Ian Jackson
e53555f418
channel padding: Add the parameters from the spec to NetDir
2022-06-21 19:19:22 +01:00
Ian Jackson
7f3f426738
channel padding: Plumb settings from chanmgr
2022-06-21 19:19:22 +01:00
Ian Jackson
b5218a0c0e
channel padding: Introduce ChannelsConfig and reconfigure facility
...
Nothing geenrates config updates yet.
2022-06-21 19:19:22 +01:00
Ian Jackson
33ef338fe2
chanmgr: inner (map): Reorganise to prepare for having more state
...
The main copy of the (global) configuration for the client's channels
is going to have to live here, inside this mutex. So this really
needs to become a struct with names fields.
2022-06-21 19:19:22 +01:00
Ian Jackson
09b40d7d81
channel padding timer: Support reconfiguration
...
Nothing calls this yet.
2022-06-21 19:19:22 +01:00
Ian Jackson
e5f3215b95
channel padding timer: Allow creation without providing parameters yet
...
It turns out that we are going to want this.
2022-06-21 19:19:22 +01:00
Ian Jackson
f9414a29b2
channel padding: Test creation in disabled state
...
We're about to split the main new() function off so write a separate
test for new_disabled().
2022-06-21 19:19:22 +01:00
Ian Jackson
7135b7c4c7
channel padding: Make Parameters a pub struct with builder
...
chanmgr is going to want to make one of these from a NetDir.
2022-06-21 19:19:22 +01:00
Ian Jackson
db4ea619f5
tor-chanmgr: tests: Have unwrap_open return a (mut) reference
...
This avoids confusing bugs where you try to modify the result and
nothing happens!
2022-06-21 19:19:22 +01: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
9b7849a293
Refactor DirStatus data structures.
...
AttemptId is now linked to DirStatus in StatusEntry.
DirBootstrapStatus now has an inner enum to make invalid status
unrepresentable.
2022-06-21 10:26:53 -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