summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-netdoc: Wrap port policies in InternClara Engler2026-06-241-2/+4
| | | | This commit wraps the port policies in an Intern.
* proto: Add crate-level exports for two extra stream types (fmt)Gabriela Moldovan2026-06-171-4/+2
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-0914-0/+15
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-121-5/+5
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* circmgr,hsclient: s/requery_period/requery_intervalGabriela Moldovan2026-05-071-3/+3
| | | | C Tor calls this a "period", but "interval" is more accurate.
* circmgr: Add config option for the HsDir requery periodGabriela Moldovan2026-05-071-0/+16
|
* circmgr: Document caveats about BuildCircuit estimatorNick Mathewson2026-05-071-0/+11
| | | | | There's no reason that the next person should have to rediscover these caveats.
* circmgr: Modernize and correct saturating_mul_f64Nick Mathewson2026-05-071-19/+23
| | | | | | | | | | | | | | Duration::try_from_secs_f64 has existed since Rust 1.66, so we can use it now. It seems wrong to treat "infinity" and "negative infinity" as "one second", so make them actually saturating. Additionally, document behavior for infinity and negative infinity, and document that the NaN behavior isn't documented. (And secretly NaN behavior return a number on the same order of magnitude as the input.)
* circmgr: Avoid half-steps in our timeout_scale calculationNick Mathewson2026-05-071-12/+23
| | | | | This strategy is safe because (outside of our tests) we never look at the actual values of timeout_scale, but only at their ratios.
* circmgr, hsclient: Introduce and use a OneWay timeout estimator.Nick Mathewson2026-05-071-0/+10
|
* 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.)