Commit Graph

4916 Commits

Author SHA1 Message Date
Nick Mathewson 2c13a78c57 Upgrade to tinystr 0.7. Closes #591. 2022-11-10 10:57:33 -05:00
Nick Mathewson 9ca19ea7f9 Use rust 1.60 in minimal-versions.
Closes #621
2022-11-10 10:57:33 -05:00
Nick Mathewson 936920b26e bump rust-version to 1.60 in every crate. 2022-11-10 10:57:33 -05:00
Nick Mathewson d9788c16b3 Merge branch 'bridge-error' into 'main'
Use ErrorKind::TorAccessFailed for misbehaving bridges

See merge request tpo/core/arti!842
2022-11-10 13:50:47 +00:00
Nick Mathewson 3c29dfd99d Merge branch 'bdm-process-doc-test' into 'main'
bridge descs: Add tests for process_document

See merge request tpo/core/arti!841
2022-11-10 13:50:23 +00:00
Nick Mathewson 6454896d95 Merge branch 'bdm-params' into 'main'
Remove TODO re BridgeDescDownloadConfig defaults

See merge request tpo/core/arti!839
2022-11-10 13:49:54 +00:00
Ian Jackson d0d40a1ca4 Merge branch 'check-more-targets' into 'main'
Check more targets

See merge request tpo/core/arti!844
2022-11-10 13:34:17 +00:00
trinity-1686a 614cf34284 Check more targets 2022-11-10 13:34:17 +00:00
Nick Mathewson e3c3bc797b Merge branch 'drop-todos' into 'main'
bridge desc: Deal with two TODOs

See merge request tpo/core/arti!843
2022-11-08 21:53:57 +00:00
Ian Jackson 42dd5d7746 bridge desc: Drop a done TODO
We have a separate BridgeDescMgr, rather than reusing DirMgr, so we
will not be implementing BridgeDescProvider for DirMgr.
2022-11-08 18:54:31 +00:00
Ian Jackson 8fbff3a27f Use ErrorKind::TorAccessFailed for misbehaving bridges
(Use semantic linefeed for the doc comment.)
2022-11-08 18:52:57 +00:00
Ian Jackson d808f70a13 bridge descs: Add tests for process_document 2022-11-08 18:42:34 +00:00
Ian Jackson f1f4ca56a8 Remove TODO re BridgeDescDownloadConfig defaults 2022-11-08 17:34:25 +00:00
Ian Jackson 05cad7c0eb bridge desc: todo re config: weaken and reference a new ticket 2022-11-08 17:34:13 +00:00
Ian Jackson 4f893648b8 Merge branch 'clap-v3' into 'main'
Upgrade to clap 3

Closes #616

See merge request tpo/core/arti!830
2022-11-08 17:11:04 +00:00
Ian Jackson 8efcfb64af Merge branch 'misc-todo-ptclient' into 'main'
Downgrade and/or remove a few misc "TODO pt-client" comments

See merge request tpo/core/arti!838
2022-11-08 16:21:30 +00:00
Nick Mathewson ec9e9c86e7 Merge branch 'store' into 'main'
Persistently cache bridge descriptors

Closes #619

See merge request tpo/core/arti!831
2022-11-08 15:10:21 +00:00
Ian Jackson 46286dddd4 Merge branch 'todo-ptclient-linkspec-1' into 'main'
Resolve `TODO pt-client` entries in linkspec

See merge request tpo/core/arti!836
2022-11-08 15:01:02 +00:00
Ian Jackson ea369e8385 bridge descs: Rename BridgeDescMgr from BridgeDescManager
This is more consistent with our naming elsewhere.

Suggested-by: Nick Mathewson <nickm@torproject.org>
2022-11-08 14:40:28 +00:00
eta 53f62eb8be Merge branch 'store-yak-misc' into 'main'
Small misc yaks for bridge descriptor persistence

See merge request tpo/core/arti!828
2022-11-08 14:28:14 +00:00
Nick Mathewson 3bcb85bd59 Merge branch 'guards_as_bridges_part4' into 'main'
GuardMgr: Almost finish wiring Bridges in as a guard substitute

See merge request tpo/core/arti!832
2022-11-08 13:48:27 +00:00
Nick Mathewson 6b422b1c4d circmgr: downgrade TODO pt-client comments
These are structure-internal things we can solve later, if ever.
2022-11-08 08:31:59 -05:00
Nick Mathewson c99976fabc ChanMgr: downgrade and remove a few TODO-ptclient comments
renamings are now #623.  Code movement can happen later.
2022-11-08 08:27:19 -05:00
Ian Jackson d9d9cdeac9 bridge descs: Apply sensitive() to bridge identity in error log msg 2022-11-08 13:19:42 +00:00
Nick Mathewson ada3acf6b8 Try to explain exactly what lookup_bridge_circ_target does 2022-11-08 08:10:15 -05:00
Nick Mathewson 0fd41a7faf GuardMgr: Try to explain what is going on with update()
This explanation is slightly complicated by the fact that I think
that one of the calls to update_guardset_internal() is possibly
unnecessary, and that one of the calls that it makes is potentially
ill-advised.

I'm not going to make those changes right now, however, because they
are potentially a little destabilizing.
2022-11-08 08:10:15 -05:00
Nick Mathewson 6591842458 Refactor configured_bridges
Now it is an Option, and is set to None if bridges aren't enabled.

This simplifies `replace_bridge_config` a bit, and forces us to
check for `None` in a few more places.
2022-11-08 08:10:15 -05:00
Nick Mathewson 2a5b4d21e3 GuardMgr: Document that providers should only be installed once.
Enforce this with assert!() and a documented panics section.
2022-11-08 08:10:15 -05:00
Nick Mathewson 9fda8d17c4 GuardMgr: Fix build with bridge-client disabled. 2022-11-08 08:10:15 -05:00
Nick Mathewson 6bcce19655 GuardMgr: Remove no-longer-relevant `TODO pt-client` comments
Also remove a bunch of now-unnecessary `allow(dead_code)`
annotations.
2022-11-08 08:10:15 -05:00
Nick Mathewson 1418ec13a8 GuardMgr: Rename an error variant 2022-11-08 08:10:15 -05:00
Nick Mathewson 3943c6cd1e GuardMgr: Spelling fixes and normalizations. 2022-11-08 08:10:15 -05:00
Nick Mathewson 3f3d82ee48 GuardMgr: do not use fallbacks when in bridge mode. 2022-11-08 08:10:15 -05:00
Nick Mathewson 5c3bb3d7e1 GuardMgr: When possible, return a FirstHop that can be a CircTarget
We do this by checking the FirstHops we're about to return, and when
they correspond to bridges, looking up an appropriate BridgeRelay
in the current BridgeSet (if we can).
2022-11-08 08:10:15 -05:00
Nick Mathewson 25d7924832 GuardMgr: Refactor UniverseRef to contains Arcs.
We already _have_ these Arc<>s whenever we construct a UniverseRef,
so there's no real point in using &refs and making these so
hard to construct.
2022-11-08 08:10:15 -05:00
Nick Mathewson 7fa08140cf GuardMgr: Remove an outdated "Limitations" comment.
Found while grepping for NetDir.
2022-11-08 08:10:15 -05:00
Nick Mathewson e1ef939ebd GuardMgr: do not block netdir if we are using bridges
The `GuardMgr` code has functionality to tell the DirMgr "Hey,
don't switch to the new NetDir yet: we still need more guard
information!"  But we never want to do that if we're selecting
bridges, since they don't come from the NetDir.
2022-11-08 08:10:15 -05:00
Nick Mathewson 1a4fbb2c3f GuardMgr: Add UniverseType to make code more explicit.
Instead of duplicating the logic about which guard sample uses which
universe, we explicitly ask it, and then use that universe.  This
will avoid trouble if/when we introduce more samples.
2022-11-08 08:10:15 -05:00
Nick Mathewson d395ae75a5 GuardMgr: Launch a background task to keep the list of bridge
descriptors updated as appropriate.
2022-11-08 08:10:15 -05:00
Nick Mathewson e93ee14270 GuardMgr: Exit keep-netdir-updated task early if GuardMgr disappears. 2022-11-08 08:10:15 -05:00
Nick Mathewson 697a355a21 GuardMgr: Pass correct universe to "Bridges" `GuardSet`.
This can probably be done in a simpler way, but for the moment I
would prefer to try to minimize the amount of code I'm changing
here.
2022-11-08 08:10:15 -05:00
Nick Mathewson f4149cd133 GuardMgr: Change BridgeSet, BridgeRelay to use more references
This will match our needs better and help avoid some `Arc<>`s.

It will be especially helpful for avoiding `Arc`s we don't
actually have.
2022-11-08 08:10:15 -05:00
Nick Mathewson 51a98883c8 GuardMgr: Store bridge configuration.
I'm using an Arc<[]> here though I think that there's a chance
that a simple Vec<> would suffice. Since it's an internal type,
nothing will break if we change it later.

Also, we now switch into and out of the Bridges guard sample
as needed.  However, that selection is not (yet) built from the
list of bridges.  That will come soon.
2022-11-08 08:10:15 -05:00
Nick Mathewson 188b9c0f86 GuardMgr: Remove duplicate code in set_filter 2022-11-08 08:10:15 -05:00
Nick Mathewson 04bcf69749 GuardMgr: Clarify intent with update_active_set.
Also fix its behavior when using bridges.
2022-11-08 08:10:15 -05:00
Nick Mathewson ad47b28f2f GuardMgr: Split `update_internal` into two functions.
The first part changes which guard set is active based on based on
the parameters, which always come from a NetDir; the second changes
the contents of the active guard set, based on a Universe.
2022-11-08 08:10:15 -05:00
Nick Mathewson 95a95076a7 Refactor external guardmgr APIs: Stop taking NetDir arguments.
These arguments were used only for legacy (testing) purposes; the
tests now use `TestNetDirProvider`.  This lets us simplify our
internal logic for passing a `NetDir` to our samples, and prepare
for having a `BridgeSet` to pass there instead.

This is a breaking change to `guardmgr` and `circmgr`.
2022-11-08 08:10:15 -05:00
Nick Mathewson 339bd8bde0 Mock implementation of a NetDirProvider for testing.
I'm about to remove the old testing APIs from GurdMgr that took in a
NetDir in each function: adding this will make that possible.
2022-11-08 08:10:15 -05:00
Nick Mathewson 6b94bc5e4c Add an accessor for the latest BridgeDescList. 2022-11-08 08:10:15 -05:00
Nick Mathewson faf51702ac Implement GuardMgr::install_bridge_desc_provider 2022-11-08 08:10:15 -05:00