summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-circmgr: Make take_or_launch_stub_circuit future SendIan Jackson2023-03-301-2/+1
| | | | | thread_rng() isn't Send. We can fix this by not holding it over an await point.
* Add some missing importsIan Jackson2023-03-282-2/+5
| | | | | | | | Now nailing-cargo +stable clippy -p tor-hsclient --all-features --all-targets actually works. squash! Add some missing imports
* hspool: simplify loop and add a maximumNick Mathewson2023-03-221-41/+39
|
* hspool: Clarify/document more TODO HS items.Nick Mathewson2023-03-221-2/+8
|
* circmgr: Make a separate SupportedCircUsage for HS stuffNick Mathewson2023-03-221-3/+6
| | | | | This uncovered a bug: NoUsage wasn't correct for Hs circuits because of its behavior with channel_usage().
* circmgr: Declare builder() unconditionally.Nick Mathewson2023-03-221-2/+3
| | | | (Still, only expose it when experimental-api is enabled.)
* hspool: Tweak comments and add more TODOs.Nick Mathewson2023-03-221-10/+33
|
* circmgr: hspool now launches circuits in the background.Nick Mathewson2023-03-221-11/+157
| | | | | | The prediction and scheduling logic here is quite primitive; we should probably refactor it considerably. This should be good enough for now, though.
* circmgr: Add an actual pool to HsCircPool.Nick Mathewson2023-03-222-6/+173
| | | | | | | | We now have support for a pool of pre-build circuits that we can use for HS-related purposes, and we take circuits from this pool as needed. Nothing populates or cleans the circuit pool yet.
* circmgr: Begin an HS circuit pool structureNick Mathewson2023-03-223-0/+162
| | | | | This is now enough to launch circuits on demand. It still needs to pre-build the first three hops, and to retry on failure.
* circmgr: Add a usage for building the beginning of an hs circNick Mathewson2023-03-223-16/+86
| | | | | This only builds the first 3 hops. It can be extended to a fourth hop later -- or not, depending on the circuit kind.
* circmgr: Functions to launch an unmanaged circuit.Nick Mathewson2023-03-222-3/+26
| | | | We'll use this to implement the circuits used by onion circuits.
* remove unused type parametertrinity-1686a2023-03-181-1/+1
|
* Fix a bunch of needless-conversion warnings.Nick Mathewson2023-03-101-1/+0
| | | | | Apparently 1.68 now warns when you call into_iter() on something that's already an iterator. Fair enough. Let's stop doing that.
* Fix an unrelated missing cfg_attr.Nick Mathewson2023-03-081-0/+1
|
* hsclient: Abolish knowledge of HS circuits in circmgrIan Jackson2023-03-012-83/+0
| | | | | | | | | | | Abolish CircMgr::get_or_launch_onion_client and everything to support it. We have decided that `.onion` diversion ccan't/shouldn't occur in tor-circmgr. Probably, it should occur much higher up - arti-client maybe - since it will sometimes need ambient authority (KS_hsc_*). Now all knowledge of HS connections is in tor-hsclient. This gets rid of a layering inversion and the trait needed for tor-circmgr to do the upcall to tor-hsclient.
* Apply rustfmtIan Jackson2023-03-011-5/+10
|
* tor-circmgr: Provide testing feature and TestConfigIan Jackson2023-03-012-0/+46
| | | | Like the similar thing in tor-guardmgr.
* HS API: Remove HS client keys from circmgr APIIan Jackson2023-03-012-2/+0
| | | | | | | | *If* we're going to retain any HS knowledge in circmgr, it definitely doesn't need to know about per-operation client secrets. (Maybe there might be ambient secrets, used for .onion diversion, but they don't need to be in this API.)
* HS planning: Discuss whether to remove all HS code from circmgrIan Jackson2023-03-012-4/+18
|
* HS planning: Intend for HS connector to do all lifecycle mgmtIan Jackson2023-03-011-6/+3
| | | | | | | | Otherwise there has to be a state entry in the circmgr *and* a state entry in the hs connector, for every HS. This division of responsibilit will be confusing. The HS code will then be more completely just a layer on top of circmgr.
* Rename onion-* cargo features to hs-* in tor-* cratesIan Jackson2023-02-281-6/+6
| | | | Fixes #756
* tor-hscrypto: Rename key types to correspond to new spec names.Nick Mathewson2023-02-082-2/+2
|
* Use ErrorReport - run rustfmtIan Jackson2023-01-302-4/+11
| | | | Split off for ease of review and possible rebase.
* Use ErrorReport for remaining errors in error! in tor-circmgrIan Jackson2023-01-301-4/+4
|
* Use ErrorReport for errors in warn! in tor-circmgrIan Jackson2023-01-303-5/+6
|
* Use ErrorReport for errors in info! in tor-circmgrIan Jackson2023-01-301-6/+6
|
* 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.