summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-guardmgr: Temporarily reintroduce VanguardConfig.Gabriela Moldovan2024-04-291-1/+1
| | | | | | | | | | | | | | As discussed on #tor-dev, I'm reintroducing `VanguardConfig` for now. The `VanguardConfig` specifies what mode (full/lite/disabled) the `VanguardMgr` should run in. We currently don't have a separate modes for HS clients and HS services. We shouldn't actually *need* a `VanguardConfig` at all, so this is just a (hopefully!) short- or medium-term fix until we sort out #1382 (which might involve making breaking changes to our `reconfigure()` APIs). Closes #1272
* tor-guardmgr: Store whether we're running an onion svc (fmt).Gabriela Moldovan2024-04-111-1/+6
|
* tor-guardmgr: Store whether we're running an onion svc.Gabriela Moldovan2024-04-111-2/+8
| | | | | | The `VanguardMgr` needs to know whether arti is running as an onion service or not, in order to figure out which of the `vanguards_enabled` and `vanguards_hs_service` modes to use.
* tor-circmgr: Call VanguardMgr::launch_background_tasks.Gabriela Moldovan2024-04-051-0/+9
|
* tor-guardmgr: Give VanguardMgr a handle to the runtime (fmt).Gabriela Moldovan2024-04-051-1/+2
|
* tor-guardmgr: Give VanguardMgr a handle to the runtime.Gabriela Moldovan2024-04-051-3/+3
|
* tor-circmgr: Make the path module crate-private.Gabriela Moldovan2024-03-201-1/+1
| | | | | | | | | | | | | | We're not currently using any of the path builders outside of `tor-circmgr`, so let's make them crate-private for now. Care must be taken if/when we decide to make them public again. For instance, the `HsPathBuilder` exposes two path building functions, one that uses vanguards, and one that doesn't. We want to strongly encourage the use of the vanguards-aware version of the function whenever the `vanguards` feature is enabled, without breaking any of its existing non-vanguard uses. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2046#note_3010217
* tor-circmgr: Tell HsPathBuilder what kind of circuit stub is needed.Gabriela Moldovan2024-03-201-0/+4
|
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-circmgr: Fix clippy warning.Gabriela Moldovan2024-03-111-1/+1
|
* tor-circmgr: Create the VanguardMgr in CircMgr::new.Gabriela Moldovan2024-03-111-2/+4
|
* tor-circmgr: Discard all circuits if VanguardMgr says so.Gabriela Moldovan2024-03-111-0/+11
|
* tor-circmgr: Give CircMgr a VanguardMgr.Gabriela Moldovan2024-03-111-0/+6
| | | | Closes #1277
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Teach *CircUsage structs about stability.Nick Mathewson2024-02-201-1/+10
| | | | | | | | | | | This lets us check long_lived_ports only when we are constructing a TargetCircUsage, and lets us remember whether or not the circuit we've built is suitable for non-long-lived ports. It also lets us decide whether existing circuits are compatible with new requests. Closes #1100.
* Downgrade some messages to traceIan Jackson2023-11-291-1/+1
| | | | | These messages are very verbose and I doubt anyone will want them, usually, even when debugging.
* arti-client: add exit selection with GeoIP country codeseta2023-09-181-1/+12
| | | | | | | | | | | | | | | | | | | | This threads the country codes work through the rest of the codebase: - `tor-dirmgr` will now enable GeoIP with the embedded database when the `geoip` future is enabled - This can be extended later using the `DirMgrConfig` to allow specifying a custom database; this is not done here, though - `tor-circmgr`'s `SupportedCircUsage` and `TargetCircUsage` fields gain new `country_code` members to allow filtering circuits by country - These are `()` in builds where the `geoip` feature is not enabled -- doing it this way means we don't have to copy and paste huge swathes of code, since we can't use `#[cfg]` in patterns - `ExitPathBuilder` gains (hacked-in) support for choosing a relay with the correct country code - Due to the lack of conjuction, we just copy and paste a small bit, pending further refactoring - `StreamPrefs` now lets you specify a country code, letting embedders make use of the feature
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+2
|
* Merge branch 'report-bugs-v2' into 'main'Nick Mathewson2023-07-071-19/+9
|\ | | | | | | | | Optional tracing support in tor-error for error reporting See merge request tpo/core/arti!1379
| * circmgr: Use event_report!() and similar macrosNick Mathewson2023-07-071-19/+9
| | | | | | | | This simplifies our logging a little, and implements part of
* | Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
|/ | | | Closes #950.
* tor-circmgr: Expose CircParameters from NetParameters constructionIan Jackson2023-06-291-15/+5
| | | | | | | | As per #935. I called this "circparameters_from_netparameters" not "circparameters_from_netparams" because the type is "NetParameters" not "NetParams".
* Merge branch 'circmgr-timeout-est' into 'main'Nick Mathewson2023-06-221-1/+31
|\ | | | | | | | | circmgr: New API to expose estimate-based timeouts. See merge request tpo/core/arti!1281
| * circmgr: New API to expose estimate-based timeouts.Nick Mathewson2023-06-221-1/+31
| | | | | | | | | | This will help create good timeout values for various onion-service operations.
* | lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|/
* cirmgr: remove a dead-code exception.Nick Mathewson2023-06-161-1/+0
|
* Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-161-4/+4
| | | | | | | | | | | | Now ClientCirc is no longer `Clone`, and the things that need it to be `Clone` instead return and use an Arc<ClientCirc> We're doing this so that ClientCirc can participate in the RPC system, and so that its semantics are more obvious. Closes #846. Thanks to the type system, this was a much simpler refactoring than I had feared it would be.
* Add some missing importsIan Jackson2023-03-281-1/+1
| | | | | | | | Now nailing-cargo +stable clippy -p tor-hsclient --all-features --all-targets actually works. squash! Add some missing imports
* circmgr: Declare builder() unconditionally.Nick Mathewson2023-03-221-2/+3
| | | | (Still, only expose it when experimental-api is enabled.)
* circmgr: Begin an HS circuit pool structureNick Mathewson2023-03-221-0/+2
| | | | | 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-221-15/+17
| | | | | 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-221-3/+8
| | | | We'll use this to implement the circuits used by onion circuits.
* hsclient: Abolish knowledge of HS circuits in circmgrIan Jackson2023-03-011-48/+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.
* tor-circmgr: Provide testing feature and TestConfigIan Jackson2023-03-011-0/+3
| | | | Like the similar thing in tor-guardmgr.
* HS API: Remove HS client keys from circmgr APIIan Jackson2023-03-011-1/+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-011-4/+10
|
* 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-081-1/+1
|
* Use ErrorReport - run rustfmtIan Jackson2023-01-301-2/+8
| | | | 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-301-3/+3
|
* 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-271-0/+1
| | | | | 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-241-0/+46
|