summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* circmgr: drop a receiver more explicitly.Nick Mathewson2023-01-271-1/+4
| | | | | | | | | Clippy now complains about `let _ = (expr_producing_a_future);`, which is probably smart, since maybe you wanted to await that future and ignore the result. So it seems that the right way to get rid of an unwanted Receiver is now to drop it explicitly. Closes #749
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-2711-0/+11
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* CircMgr: Draft API to construct targeted multihop circuits.Nick Mathewson2023-01-241-1/+24
| | | | | Onion services and onion clients need these to make connections to HsDirs, Introduction points, and Rendezvous points.
* CircMgr: Draft APIs used to implement onion service clients.Nick Mathewson2023-01-242-0/+74
|
* Merge branch 'test-lints' into 'main'eta2023-01-0610-1/+81
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-1210-1/+81
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | tor-circmgr: Use ErrorReport on a logged errorIan Jackson2022-12-121-1/+2
|/ | | | To demonstrate what the use looks like.
* tor-cirmgr: Replace OwnedChanTarget with LoggedChanTarget in errorsIan Jackson2022-11-232-9/+9
| | | | | | | | | This 1. Makes the errors smaller 2. Redacts (currently, scrubs) the chantarget when safe logging is enabled The other error variants in tor-circmgr::Error don't seem to contain information that should become sensitive as part of bridge support.
* Even more comments explaining circuit cancellation.Nick Mathewson2022-11-221-3/+37
|
* Improve notes surrounding circuit cancellation.Nick Mathewson2022-11-222-6/+18
| | | | | | | It turns out that bug #656 is not a real bug, but it was easy to overlook the code that prevented it. Closes #656.
* CircMgr: retire all circuits if bridge configuration changes.Nick Mathewson2022-11-221-5/+9
| | | | Closes #650.
* Merge branch 'refactor_into_ownedchantarget' into 'main'Nick Mathewson2022-11-181-3/+3
|\ | | | | | | | | CircMgr: Refactor DirSpecificTarget constructor See merge request tpo/core/arti!866
| * CircMgr: Refactor DirSpecificTarget constructorNick Mathewson2022-11-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | This commit replaces the `impl From<&T> for OwnedChanTarget where T:ChanTarget` with a new `IntoOwnedChanTarget` trait. This lets us be explicit that we're constructing an owned object, and not just converting something. No semver change needed, since these APIs haven't been released. ----------- (new description)
* | circmgr: make some imports conditionalNick Mathewson2022-11-181-2/+1
|/ | | | | This resolves an "unused import" warning when bridges are not enabled.
* Remove a spurious log that I committed by mistake. Whoops.Nick Mathewson2022-11-151-1/+0
|
* Implement more cases for `DirSpecificTarget`.Nick Mathewson2022-11-151-1/+22
| | | | | | Without this fix, any attempt to actually use a circuit for a `DirSpecificTarget` will fail, since supports() will say false, and `restrict_mut()` will say `NotSupported`.
* Move GuardMgr::new call to arti_client::TorClientIan Jackson2022-11-141-1/+1
| | | | | | | Having this done within circmgr was irregular - most of our other key buildup functions are done in TorClient::create_inner. It is also inconvenient, as it buries the guardmgr within the circmgr.
* Document Clone semantics of GuardMgr and DirMgrIan Jackson2022-11-111-0/+2
|
* Merge branch 'misc-todo-ptclient' into 'main'Ian Jackson2022-11-081-3/+3
|\ | | | | | | | | Downgrade and/or remove a few misc "TODO pt-client" comments See merge request tpo/core/arti!838
| * circmgr: downgrade TODO pt-client commentsNick Mathewson2022-11-081-3/+3
| | | | | | | | These are structure-internal things we can solve later, if ever.
* | Refactor external guardmgr APIs: Stop taking NetDir arguments.Nick Mathewson2022-11-083-25/+7
|/ | | | | | | | | 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`.
* guardmgr config: Introduce and require new GuardMgrConfig traitIan Jackson2022-11-034-16/+11
| | | | | It doesn't seem to me like it makes sense to provide the backward compatibility here.
* guardmgr config: Pass fallback list from config by referenceIan Jackson2022-11-031-1/+1
| | | | | This does involve additional cloning. However, soon it will mean that we can pass the whole `TorClientConfig` by reference.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* Merge branch 'guards_as_bridges_part1' into 'main'Nick Mathewson2022-10-242-34/+163
|\ | | | | | | | | Allow GuardMgr to expose bridges as guards (part 1) See merge request tpo/core/arti!785
| * circmgr: More NOTEs and TODO pt-clients.Nick Mathewson2022-10-241-3/+9
| |
| * Circmgr: construct paths using either Relay or OwnedCircTargetNick Mathewson2022-10-242-34/+157
| | | | | | | | | | | | | | | | | | | | | | Previously we could only use Relay for this case, which won't work any more: a Bridge is not a `tor_netdir::Relay`. Instead we allow the GuardMgr to give us something that knows how to convert itself into an OwnedCircTarget. This change required a far amount of follow-on revisions and refactoring, but it should all be internal to the path-building logic.
* | tor-circmgr: Make get_or_launch_dir_specific feature-specificIan Jackson2022-10-212-3/+15
| |
* | tor-circmgr: Rename get_or_launch_dir_specific from _bridgeIan Jackson2022-10-211-1/+1
|/ | | | | DirSpecificTarget in the usage was renamed apropos an MR comment but this function name was overlooked.
* circmgr: Plumbing for direct to target directory circuitsIan Jackson2022-10-202-2/+29
| | | | | The target is identified by Into<OwnedChanTarget>. We introduce corresponding TargetCircUsage and SupportedCircUsage.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-21/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* Allow "clippy::single_char_pattern" in tests.Ian Jackson2022-10-121-0/+1
| | | | | | | This lint exists for perf reasons, and this is rarely relevant in tests. Using double quoted str is generally cognitively less burdensome.
* tor-linkspec: Remove the old OwnedFoo::new() functionsNick Mathewson2022-10-061-2/+15
| | | | These are now builders.
* Add the necessary APIs for bridge-based circuit construction.Nick Mathewson2022-09-261-0/+1
|
* CircMgr: Add an accessor for the CircuitBuilder.Nick Mathewson2022-09-221-0/+8
| | | | | | | Without this, actually building circuits manually is a pain. This API is behind the `experimental-api` feature, and so it does not require a semver.md entry.
* Shorten the duration needed in preemptive::test::does_not_predict_old_ports.Alexander Færøy2022-08-311-2/+3
| | | | | | | | | | | This patch shortens the duration of the `does_not_predict_old_ports` test in the preemptive module. AppVeyor spawns its VMs/containers per build, so the `Instant::now()` call returns a value smaller than `60 * 60 + 1` which causes the subtraction to overflow and thus panic. Thanks to @trinity-1686a for the help here. See: tpo/core/arti#563.
* circmgr: treat usage as sensitive.Nick Mathewson2022-08-251-1/+6
|
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* Merge branch 'channel' into 'main'Ian Jackson2022-08-174-16/+75
|\ | | | | | | | | Channel padding See merge request tpo/core/arti!657
| * channel usage: Rename CU::UserTraffic from CU::ExitIan Jackson2022-08-173-6/+6
| | | | | | | | | | As suggested in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827246
| * Move ChannelUsage from tor_proto to tor_chanmgrIan Jackson2022-08-173-6/+5
| | | | | | | | | | | | | | | | | | | | | | Replace Channel::note_usage with Channel::engage_padding_activities, which unconditionally causes the channel to (start to) do netflow padding things. The condition now lives in chanmgr. Addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826094
| * chanmgr: Use NetDirProvider::params and Arc<dyn..Netparameters>Ian Jackson2022-08-171-0/+1
| | | | | | | | | | | | | | | | | | This gets rid of many Result(). Many parameters are renamed. Test cases of the now-impossible branch are removed. Deleting the match from padding_parameters will come in a moment. I've split off that commit since it has much whitespace noise. for now, change the error type to Void.
| * Introduce ChannelConfigIan Jackson2022-08-161-1/+6
| | | | | | | | | | This commit is just the necessary plumbing. The config is currently empty. We'll add something to it, for padding control, later.
| * Provide ChannelUsage and plumb it all the way downIan Jackson2022-08-164-14/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | Channel padding depends on what the channel is being used for. We therefore need to let the channel code know this information. The implementation of the per-channel padding control logic will be in the new note_usage function, which for now is simply a stub. A future commit will introduce a `PaddingControlState` which lives in the channel frontend; consult the doc comment for that type to see why the plumbing through the channel manager terminates in the channel frontend.
| * dormancy: Plumb through to chanmgr reconfigure_generalIan Jackson2022-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The chanmgr remembers the last dormancy state it was told. We invent a chanmgr-specific Dormancy which the arti-client code knows how to convert from the richer top-level dormant status. This avoids having to have everyone know all the variants of the top-level state. To call reconfigure_general, we must also obtain and plumb through a netdir. Right now we must return an internal error if there is in fact no netdir, because reconfigure_general does not yet cope with a missing netdir. Nothing actually *uses* the dormancy yet.
* | Additionally, mark the LostUsablityRace error as a "reset".Nick Mathewson2022-08-161-1/+5
| |
* | Mark some circuit-building errors as "transient".Nick Mathewson2022-08-162-15/+71
|/ | | | | | | | | | | | A "transient" error is one that does not indicate a true failure, but rather an _expected_ need to retry. When we hit one of these, we do not count it against the total number of permitted failures. (We do impose a higher limit on "real failures plus transient failures", though, to prevent infinite loops in the event of a programming error. Closes #517.
* tor-netdir: Collapse by_id and by_relay_id into a single fn.Nick Mathewson2022-08-103-8/+11
| | | | | | There are some downstream changes required for this to work, but they are all just unit tests that could no longer infer the type of an Ed25519 key.