summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* circmgr: simplify a loop counter.Nick Mathewson2026-04-211-3/+1
|
* Log tunnel and circuit IDsJim Newsome2026-04-081-4/+8
|
* Fix log typo PreeemptiveJim Newsome2026-04-081-1/+1
|
* circmgr: Use runtime.now() in place of Instant/SystemTime::get().Nick Mathewson2026-03-312-9/+7
| | | | Part of #2428.
* circmgr: Port to web-time-compat.Nick Mathewson2026-03-2612-26/+36
|
* Merge branch 'weak_table_explicit_hasher' into 'main'David Goulet2026-03-241-2/+8
|\ | | | | | | | | | | | | Force use of standard hasher with weak_tables. Closes #2418 See merge request tpo/core/arti!3801
| * Force use of standard hasher with weak_tables.Nick Mathewson2026-03-241-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Closes #2418. Fixes TROVE-2026-005, where we would use a less cryptographically secure (and probably less DoS resistant) hash function for these tables if: - We are built alongside another crate that uses `weak-table` - That crate enables the `weak-table/ahash` feature. - We are running on a system without hardware AES. Severity: Low
* | Fix typosTobias Stoeckmann2026-03-241-1/+1
|/ | | | Typos found with codespell
* Fix word duplicate typosTobias Stoeckmann2026-03-151-1/+1
|
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* relay: Add a TLS acceptor in the ChanBuilderDavid Goulet2026-02-092-8/+12
| | | | | | | | | | | | | | | This requires the `TlsKeyAndCert` so be passed on the TLS acceptor settings. We assume that `RelayIdentities` has this information. The ChanBuilder::new() was getting a bit too convoluted and feature gated to instead we introduce new_client() and new_relay() and remove the need for `with_identities()`. Because of this, the ChanMgr::new() now returns a `Result<>`. Related to #1597 Signed-off-by: David Goulet <[email protected]>
* circmgr: Make test helper non-async (fmt)Gabriela Moldovan2026-01-281-5/+1
|
* circmgr: Make test helper non-asyncGabriela Moldovan2026-01-281-9/+9
|
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* test: Remove unused importDavid Goulet2026-01-131-1/+0
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Introduce a ChanMgrConfig structDavid Goulet2026-01-132-2/+2
| | | | | | | | | | | | This struct is used to pass configuration parameters to the ChanMgr when building it. At the moment, it holds the ChannelConfig and RelayIdentities (feature gated) which will be used in subsequent commits. Note that relays do require RelayIdentities to build channels. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Remove KeyMgr from constructorDavid Goulet2026-01-132-2/+0
| | | | | | | We'll rely on a RelayIdentities to pass in the right keys to the ChanMgr instead of the entire KeyMgr. Signed-off-by: David Goulet <[email protected]>
* fix: preserve timestamps when flattening RetryErrorsNihal2025-12-171-7/+1
|
* fix: use wallclock timestamps in all push_timed callsNihal2025-12-172-22/+27
|
* fix: semver labels and extend() with push_timed loopNihal2025-12-171-3/+6
|
* refactor: convert Extend to inherent method, forbid push/extend, fix ↵Nihal2025-12-172-0/+10
| | | | rend_handshake time
* refactor: clean codeNihal2025-12-171-4/+4
|
* feat(retry-error): add timestamps to retry errorsNihal2025-12-171-7/+26
|
* Demonstration: convert tor-circmgr to use derive_deftly(TorConfig)Nick Mathewson2025-12-091-98/+32
| | | | | (We could tighten this up even more by inlining some of the default values.)
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-043-5/+0
| | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* tor-circmgr: small comment fixSteven Engler2025-12-031-1/+1
|
* tor-circmgr: reduce level of info reactor tracing msgSteven Engler2025-12-031-1/+1
| | | | | Since "info" is the default level, we don't want to log by default each time a circuit reactor is created.
* circmgr: Add missing docs for RestrictionFailedGabriela Moldovan2025-12-011-0/+1
|
* circmgr: allow unstable_name_collisions lint for exactly_one()Gabriela Moldovan2025-12-011-0/+4
| | | | This silences a new nightly warning.
* tor-circmgr: simplify `CircMgrConfig`Steven Engler2025-11-261-9/+2
| | | | | | | Now that `vanguard_config()` is no longer conditional, we can handle `vanguard_config` just like other accessors. This is a breaking change, but I think we may as well make this change while we've already made another breaking change in the previous commit.
* tor-circmgr,arti-client: `CircMgrConfig::vanguard_config` is always builtSteven Engler2025-11-261-4/+0
|
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-2410-5/+72
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* tor-circmgr: fix incorrect match on `HsOnly`Steven Engler2025-11-191-0/+1
| | | | | | | | | | | | | | | | | | | Rust was treating this as a wildcard match if the `hs-common` feature wasn't enabled. This shouldn't have caused any bugs since the other match arms were already exhaustive, but this could have lead to a bug if new enum variants were added to `SupportedTunnelUsage`. ```text warning: variable `HsOnly` should have a snake case name --> crates/tor-circmgr/src/usage.rs:600:13 | 600 | HsOnly => { | ^^^^^^ help: convert the identifier to snake case: `hs_only` | = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default warning: `tor-circmgr` (lib) generated 1 warning ```
* RelayFlags: Use RelayFlag enum variant names everywhereIan Jackson2025-11-182-7/+7
| | | | | | | Abolish the constants with the transitional names. This also abolishes the controversial name `H_S_DIR`, which Rust case transformation rules generated from `HSDir`.
* RelayFlags: Use the singular RelayFlag for naming individual flagsIan Jackson2025-11-182-9/+9
| | | | | | | | | | | | | | We're going to separate RelayFlag from RelayFlags. We could continue to provide a bunch of constant values for RelayFlags, for each individual type, but that would involve an ad-hoc derive, and would still be a bit of an unusual API. Instead, we're going to make ``RelayFlag` a normal enum. In this commit, we change everyone to refer to it by its singular name. Hopefully separating out this bulk change makes both this, and the core commit, easier to review.
* tor-netdoc: Remove the RelayFlags type alias in netstatusIan Jackson2025-11-182-2/+3
| | | | I would do `#[deprecated]` but empirically that has no effect...
* tor-netdoc: Rename RelayFlags elements for regularity vs specIan Jackson2025-11-181-1/+1
| | | | | Add underscores so that the spec keywords and the flag constants correspond (according to `paste`'s case-changing rules).
* Fix another doc link.Nick Mathewson2025-11-131-1/+1
|
* Fix compilation without all-features.Nick Mathewson2025-11-121-7/+8
|
* circmgr: report errors from update_long_lived_tunnel_last_usedNick Mathewson2025-11-121-21/+54
| | | | | (The only error possible is an internal error from calling it with a non-long-lived tunnel.)
* circmgr: In expiration task, try again if we are not yet ready to expire.Nick Mathewson2025-11-121-21/+31
|
* circmgr: Add a timeout setting for long-lived circuits.Nick Mathewson2025-11-122-1/+20
|
* circmgr: Implement expiration for long-lived tunnels.Nick Mathewson2025-11-124-22/+228
| | | | | | | | | | | | | | | | | This code uses the algorithm of prop368: When a tunnel is sufficiently isolated, we want to expire it after it has been disused for a certain amount of time. The implementation is a little tricky, since we need to call an async function on ClientTunnel to look up the disused_since() check. We don't want to call async functions while holding locks, so we need to drop the TunnelList lock before we do the disused_since() calls, and the grab it again. As part of this change, I've had made expiration functions return the earliest time at which any tunnel might expire. We can use this in the future to spawn fewer expiration tasks, and scan the list of tunnels less often.
* circmgr: Add a notion of long-lived tunnels.Nick Mathewson2025-11-122-8/+77
|
* circmgr: Refactor should_expire()Nick Mathewson2025-11-121-24/+40
| | | | | Instead of a series of cutoffs, take an object with a set of lifetimes.
* circmgr: make expiration functions asyncNick Mathewson2025-11-122-31/+29
| | | | We'll need them to be async so they can call disused_since() on tunnels.
* circmgr: rename expire_tunnel to consider_expiring_tunnelNick Mathewson2025-11-121-3/+7
|
* Add a notion of isolation strong enough to enable long-lived circuits.Nick Mathewson2025-11-121-0/+38
| | | | Part of prop368.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-0614-15/+15
| | | | Run maint/add_warning
* all: run cargo fmtSteven Engler2025-11-043-3/+3
|