summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/hspool.rs
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-251-2/+2
| | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* CircMgr: Make CircMgr and HsCircPool generic over builder type.Wesley Aptekar-Cassels2024-09-241-91/+161
| | | | | | | | | | This will allow for testing, as the CircuitBuilder can be replaced with a mocked version. This did require moving some of what was in the CircuitBuilder impl into the AbstractCircuitBuilder type, since Drop implementations can't be specialized, but that's fine, as we'll probably be doing more of that in the future anyways.
* tor-circmgr: Make client rendezvous circuits EXTENDED instead of SHORT.Gabriela Moldovan2024-06-251-3/+3
| | | | | | | | This updates the code to match the spec. This fixes TROVE-2024-008. Closes #1474
* tor-circmgr: Remove duplicated path building logic from HS pool.Gabriela Moldovan2024-06-201-30/+19
|
* tor-circmgr: Fix clippy warning.Gabriela Moldovan2024-06-201-1/+1
|
* tor-circmgr: Gate vanguard-specific code behind vanguards feature.Gabriela Moldovan2024-06-201-0/+15
| | | | | | | This is just code motion: moving the vanguard-specific parts of `maybe_extend_stub_circuit()` behind the `vanguards` feature will enable us to refactor it to use `select_middle_for_vanguard_circuit()`, which is only available if the `vanguards` feature is enabled.
* tor-circmgr: Rename HsCircStubKind::len to HsCircStubKind::num_hops.Gabriela Moldovan2024-06-201-3/+3
|
* tor-circmgr: Note which test prevents TROVE-2024-005.Gabriela Moldovan2024-06-201-0/+1
| | | | | | This test is not new (it was added in !2168), but I think it's a good idea to annotate the tests preventing security issues with the TROVE number and/or arti ticket they pertain to.
* tor-circmgr: Refactor duplicated circuit stub length calculation.Gabriela Moldovan2024-06-201-13/+25
| | | | Part of #1459
* tor-circmgr: Exclude the target when extending SHORT stubs.Gabriela Moldovan2024-06-041-4/+18
| | | | | When extending SHORT circuit stubs, the last hop shouldn't be the same as the circuit target.
* tor-circmgr: Apply deferred fmt.Gabriela Moldovan2024-06-041-1/+3
|
* tor-circmgr: Add TODOs about improving circuit length checks.Gabriela Moldovan2024-06-041-0/+2
|
* tor-circmgr: Remove HsPool::vanguards_enabled() (fmt).Gabriela Moldovan2024-06-041-2/+10
|
* tor-circmgr: Remove HsPool::vanguards_enabled().Gabriela Moldovan2024-06-041-24/+33
| | | | | | | | | Previously, the HsCircPool had a bug that caused SHORT lite-vanguards circuits to be incorrectly extended by one hop when being repurposed as EXTENDED circuits (EXTENDED circuits only need to be extended by extra hop if full vanguards are in use). Closes #1456 and #1458
* tor-circmgr: Validate the circuit stub length before returning it.Gabriela Moldovan2024-06-041-8/+68
|
* tor-circmgr: Display the offending hop if the circuit is not compatible with ↵Gabriela Moldovan2024-06-031-4/+5
| | | | target.
* tor-circmgr: Use has_any_relay_id_from to check for relay equality.Gabriela Moldovan2024-06-031-2/+2
| | | | | | | When checking for relay equality, we are happy to accept some false positives (which result in building/selecting a different circuit). We want to be less tolerant of false negatives, to avoid accidentally using a circuit that doesn't have the properties we need.
* tor-circmgr: Ensure circuit stubs are compatible with the target.Gabriela Moldovan2024-06-031-1/+39
| | | | | | This is a follow-up from !2167. It should prevent issues like #1417 from going unnoticed.
* tor-circmgr: Make retire_all_circuits unconditional.Gabi Moldovan2024-06-031-1/+0
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2168?commit_id=3c67fa55c7c5b0c4f30c1d57e8e67fe541d9c99e#note_3033368
* tor-circmgr: Log the kind of HS circuit stub we are selecting.Gabriela Moldovan2024-06-031-1/+7
|
* tor-circmgr: Remove VanguardMode from Pool (fmt).Gabriela Moldovan2024-06-031-3/+1
|
* tor-circmgr: Remove VanguardMode from Pool.Gabriela Moldovan2024-06-031-6/+6
| | | | | | | | | Storing the VanguardMode in multiple places (in the VanguardMgr *and* the HS circ Pool) is dangerous and can lead to split brain situations where different parts of the code think they are running in different VanguardModes. See #1424
* tor-circmgr: Remove dangerous vanguards_enabled() function.Gabriela Moldovan2024-06-031-4/+9
| | | | | | | `VanguardMgr` should be the source of truth for obtaining the current `VanguardMode`. Closes #1424
* tor-circmgr: Add a test to check that the pool uses the right VanguardMode.Gabriela Moldovan2024-06-031-0/+86
| | | | See arti#1424
* tor-circmgr: Ensure we don't select an incompatible circuit stub.Gabriela Moldovan2024-06-031-3/+19
| | | | | | | | | | | Previously, HS stub circuit selection (with vanguards enabled) was buggy: when selecting a circuit stub from the circ pool, we failed to ensure its last hop was different from the circuit target. So in some cases, arti would attempt to extend a stub circuit of the form G -> L2 [-> L3] -> T to T, which can't work, because a relay won't extend a circuit to itself (or to its predecessor, for that matter). Closes #1417
* tor-circmgr: Move vanguard circuit validation to a separate function.Gabriela Moldovan2024-06-031-1/+20
| | | | This will soon grow more complex.
* tor-circmgr: Downgrade a HS-VANGUARDS TODO.Gabriela Moldovan2024-06-031-1/+1
|
* tor-circmgr: Fix a broken doc link.Gabriela Moldovan2024-05-161-1/+1
|
* tor-circmgr: Replace STUB/STUB+ terminology with SHORT/EXTENDED.Gabriela Moldovan2024-05-161-8/+8
| | | | | | | The previous STUB/STUB+ terminology was confusing, because STUB and STUB+ are both "circuit stubs" (but STUB is shorter than STUB+). Closes #1339
* tor-circmgr: Rename HsCircStubKind::Stub to HsCircStubKind::Short.Gabriela Moldovan2024-05-161-22/+28
| | | | Part of #1339
* tor-circmgr: Reword a somewhat inaccurate comment about vanguards.Nick Mathewson2024-05-141-1/+1
|
* tor-circmgr: If necessary, extend the circuit to become STUB+.Gabriela Moldovan2024-05-131-8/+42
| | | | Closes #1400
* tor-circmgr: Add a helper for extending HsCircStubs by one hop.Gabriela Moldovan2024-05-131-2/+15
| | | | | | We're about to use this in `maybe_extend_stub_circuit` too. Part of #1400
* tor-circmgr: Don't log unless we are launching some circuits.Gabriela Moldovan2024-04-291-5/+7
| | | | Otherwise we end up logging that we're launching 0 circuits.
* tor-circmgr: Remove no-longer-relevant TODO.Gabriela Moldovan2024-04-291-1/+1
| | | | The wanted_kind _does_ matter.
* tor-circmgr: The circuit must still be usable, even if vanguards are enabled.Gabriela Moldovan2024-04-291-3/+1
|
* tor-circmgr: Prefer STUB+ where possible.Gabriela Moldovan2024-04-291-6/+26
| | | | Closes #1385
* tor-circmgr: Add a TODO about launching HS circuits in parallel.Gabriela Moldovan2024-04-291-0/+1
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2102#note_3024370
* tor-circmgr: Remove an addressed TODO.Gabriela Moldovan2024-04-291-13/+0
|
* tor-circmgr: Log the kinds of circuits we're about to launch (fmt).Gabriela Moldovan2024-04-291-4/+1
|
* tor-circmgr: Log the kinds of circuits we're about to launch.Gabriela Moldovan2024-04-291-3/+14
|
* tor-circmgr: Remove no-longer-needed dead code allows.Gabriela Moldovan2024-04-291-2/+0
|
* tor-circmgr: Make a fraction of preemptive HS circuits be STUB+.Gabriela Moldovan2024-04-291-7/+8
| | | | Closes #1353
* tor-circmgr: Loop until we run out of circuits to launch.Gabriela Moldovan2024-04-251-1/+1
| | | | | Previously this would only loop `n_to_launch - 1` times, so the pool was always 1 circuit short of the `n_to_launch` target.
* tor-circmgr: Cross-reference the hspath docs in the HsCircStubKind docs.Gabriela Moldovan2024-03-201-1/+3
|
* tor-circmgr: Remove unnecessary Result wrapping.Gabriela Moldovan2024-03-201-7/+7
|
* tor-circmgr: Add an explanation and a couple of TODOs.Gabriela Moldovan2024-03-201-0/+8
|
* tor-circmgr: Clarify the TODO in launch_hs_circuits_as_needed.Gabriela Moldovan2024-03-201-2/+12
|
* tor-circmgr: s/can_build/can_become.Gabriela Moldovan2024-03-201-2/+2
|
* tor-circmgr: Move match block to a separate function.Gabriela Moldovan2024-03-201-15/+20
|