summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | proto: Make padding and timeout actions take priority.Gabriela Moldovan2025-09-251-34/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This rewrites `next_circ_action()` yet again, using two layers of `PollAll`: * the inner layer drives an individual circuit leg. Each circuit has a `PollAll` that drives its futures * the outer layer drives the inner `PollAll`s belonging to the circuits that form the tunnel
* | | | proto: Add comment emphasizing that the PollAll ordering matters.Gabriela Moldovan2025-09-251-0/+7
| | | |
* | | | proto: Add comment explaining why we need the chan_sender readiness check.Gabriela Moldovan2025-09-251-0/+3
| | | |
* | | | proto: Document exactly how PollAll polls its futures.Gabriela Moldovan2025-09-251-1/+11
| | | |
* | | | proto: Resolve a couple of clippy warnings in the tests.Gabriela Moldovan2025-09-251-2/+2
| | | |
* | | | proto: Rewrite should_skip_join_point to return bool.Gabriela Moldovan2025-09-251-11/+10
| | | | | | | | | | | | | | | | | | | | We don't really need to return a `HopNum` anymore (because we work out the join point `HopNum` unconditionally in `next_circ_action`).
* | | | proto: Avoid polling join point streams more than once.Gabriela Moldovan2025-09-251-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | If we poll the ready streams on the join point more than once per reactor loop, we risk sending more than one DATA cell (which is not good, because cc might block after the first cell is sent).
* | | | proto: Remove now-unused function.Gabriela Moldovan2025-09-251-21/+2
| | | |
* | | | proto: Rewrite ConfluxSet::next_circ_action() using PollAll.Gabriela Moldovan2025-09-254-132/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes our usage of `FuturesUnordered` in `ConfluxSet::next_circ_action()` to address two issues: * a fairness issue, where the futures driven by `FuturesUnordered` could be starved under some circumstances (#2180) * a logic error, where we'd explicitly avoid reading from the input channel if the outgoing `chan_sender` channel was blocked (#2179) Note that the fixing the latter will cause the reactor to buffer more into the unbounded `chan_sender` sink, but that *should* be okay, because no input message should be able cause us to queue cells excessively. Closes #2179, #2180
* | | | proto: Expose CircHopList in ConfluxSet.Gabriela Moldovan2025-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | We will soon need to access this directly (rather than via a method on `Circuit`) to work around borrow checker limitations.
* | | | proto: Return multiple actions from next_circ_action (fmt).Gabriela Moldovan2025-09-251-47/+47
| | | |
* | | | proto: Return multiple actions from next_circ_action.Gabriela Moldovan2025-09-252-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of #2180 Note: the code is intentionaly left misindented to make reviewing a bit easier. A future commit will fix the indentation.
* | | | proto: Add PollAll helper for driving futures in lockstep.Gabriela Moldovan2025-09-252-0/+196
| | | |
* | | | proto: Push conflux state checks inside handshake_timeout() (fmt).Gabriela Moldovan2025-09-251-6/+6
| | | |
* | | | proto: Push conflux state checks inside handshake_timeout().Gabriela Moldovan2025-09-254-10/+16
|/ / / | | | | | | | | | | | | | | | This simplifies the calling code, which will, in turn, make it easier for us to simplify the logic in ConfluxSet::next_circ_action() and abolish the questionable use of FuturesUnordered.
* | | Merge branch 'expire-halfstream-cbt' into 'main'gabi-2502025-09-2415-47/+321
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | proto: Remove half-streams when they expire. Closes #264 See merge request tpo/core/arti!3267
| * | | proto: Temporarily ignore large_enum_variant clippy warning.Gabriela Moldovan2025-09-231-0/+1
| | | | | | | | | | | | | | | | I want to tackle this separately, as part of #2003
| * | | proto: Apply deferred rustfmt.Gabriela Moldovan2025-09-221-3/+1
| | | |
| * | | proto: Remove duplicate word in comment.Gabriela Moldovan2025-09-221-1/+1
| | | |
| * | | proto: Add new error type for cells received on non-existent streams.Gabriela Moldovan2025-09-224-11/+41
| | | | | | | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3267#note_3261239
| * | | proto: Log circuit reactor errors at debug level.Gabriela Moldovan2025-09-221-2/+2
| | | |
| * | | proto: Use the circuit build timeout instead of the abandon timeout.Gabriela Moldovan2025-09-221-2/+2
| | | | | | | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3267#note_3259820
| * | | proto: Reject any messages arriving on expired half-streams.Gabriela Moldovan2025-09-193-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | Half-streams are periodically removed from each hop's stream map by the reactor main loop, but we still need to ensure we reject any messages arriving on expired half-streams in between these cleanup cycles.
| * | | proto: Add test to ensure half-streams are removed after a while.Gabriela Moldovan2025-09-191-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tests that the half-stream expiry works as expected. Note: it doesn't! This test currently fails, because there's a bug in the way half-streams are expired. Because we don't do it on a timer, and instead garbage-collect the half-streams on each reactor iteration, if the reactor is stuck long enough `.await`ing a message on one of its channels (for example, the `input` one), there is a chance it will accept a cell on a half-stream that should've been expired. A future commit will fix this bug.
| * | | proto: Calculate CBT more accurately.Gabriela Moldovan2025-09-192-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | This should look at length of the circuit up until the hop where the half-stream is (because the half-stream might be on an intermediate hop, and not necessarily on the final one).
| * | | proto: Remove half-streams when they expire.Gabriela Moldovan2025-09-164-1/+33
| | | | | | | | | | | | | | | | Closes #264
| * | | circmgr: Pass the timeout estimator to circuit constructor (fmt).Gabriela Moldovan2025-09-163-11/+22
| | | |
| * | | circmgr: Pass the timeout estimator to circuit constructor.Gabriela Moldovan2025-09-164-14/+22
| | | | | | | | | | | | | | | | | | | | This enables us to read the CBT estimates from the circuit reactor (we need these to compute the half-stream timeouts for #264).
| * | | circmgr: Implement TimeoutEstimator for Estimator.Gabriela Moldovan2025-09-161-0/+12
| | | | | | | | | | | | | | | | | | | | This will enable us to pass the timeout estimator to the circuit reactor in tor-proto.
| * | | proto: Use the CBT to compute half-stream timeouts.Gabriela Moldovan2025-09-166-9/+55
| | | |
| * | | proto: Give Each EndSentStreamEnt an expiry (fmt).Gabriela Moldovan2025-09-162-2/+8
| | | |
| * | | proto: Give Each EndSentStreamEnt an expiry.Gabriela Moldovan2025-09-164-8/+44
| | | |
| * | | proto: Remove unnecessary IEFE.Gabriela Moldovan2025-09-161-6/+4
| | | | | | | | | | | | | | | | | | | | The move of `self` into the closure was getting in the way, as I will need to reference `self` again below.
| * | | proto: Add an accessor for the max observed circ RTT.Gabriela Moldovan2025-09-161-0/+6
| | | | | | | | | | | | | | | | We will need this to calculate the END ack timeout.
| * | | proto: Expose RoundtripTimeEstimator more broadly.Gabriela Moldovan2025-09-161-3/+0
| | | | | | | | | | | | | | | | We need this to calculate the half-stream timeouts for #264.
* | | | Merge branch 'constant-time-eq' into 'main'Nick Mathewson2025-09-247-24/+172
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tor-llcrypto/tor-hscrypto: constant time PartialEq for tor-hscrypto types Closes #2021 See merge request tpo/core/arti!3268
| * | | | tor-hscrypto: derive_deftly is mandatory againhashcatHitman2025-09-232-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't know why this was breaking rust-recent-async-std-rustls, but oh well. Signed-off-by: hashcatHitman <[email protected]>
| * | | | tor-(hs|ll)crypto: export cteq macros correctlyhashcatHitman2025-09-236-76/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macros to deftly derive `ConstantTimeEq` and `PartialEq` (for `ConstantTimeEq`) are now only defined in `tor-llcrypto` and exported. The macro to deftly derive `ConstantTimeEq` is now struct only and uses `subtle::Choice::from(1)` for improved clarity. Signed-off-by: hashcatHitman <[email protected]>
| * | | | tor-llcrypto: unconditionally use derive_deftlyhashcatHitman2025-09-232-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I didn't even realize I was still conditionally using it on a feature. That's what I get for always testing with all-features. Signed-off-by: hashcatHitman <[email protected]>
| * | | | tor-llcrypto: derive_deftly is mandatoryhashcatHitman2025-09-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I forgot to make derive_deftly a required dependency. Oops. Signed-off-by: hashcatHitman <[email protected]>
| * | | | tor-(hs|ll)crypto: deftly derive ConstantTimeEqhashcatHitman2025-09-236-297/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is my initial attempt at deriving ConstantTimeEq and PartialEq. This includes the previously missed HsSvcNtorKeypair and HsClientDescEncKeypair types. In tor-llcrypto, a few implementations still had to be done by hand, and some types which previously derived normal PartialEq now derive it with ConstantTimeEq. I could not figure out how to properly set up the macros such that they could be used both in the current crate and in others, so for the moment they are duplicated. Just so I can get feedback. Ideally, this will be replaced with a better solution before merge. Signed-off-by: hashcatHitman <[email protected]>
| * | | | tor-hscrypto: constant time PartialEq for keyshashcatHitman2025-09-161-1/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented `subtle::ConstantTimeEq` for all of the following types: - `pk::HsIdKey` - `pk::HsIdKeypair` - `pk::HsBlindIdKey` - `pk::HsBlindIdKeypair` - `pk::HsDescSigningKey` - `pk::HsDescSigningKeypair` - `pk::HsIntroPtSessionIdKey` - `pk::HsIntroPtSessionIdKeypair` - `pk::HsSvcNtorKey` - `pk::HsSvcNtorSecretKey` - `pk::hs_client_intro_auth::HsClientIntroAuthKey` - `pk::hs_client_intro_auth::HsClientIntroAuthKeypair` - `pk::HsClientDescEncKey` - `pk::HsClientDescEncSecretKey` - `pk::HsSvcDescEncKey` - `pk::HsSvcDescEncSecretKey` - `pk::HsSvcDescEncKeypair` `PartialEq` has also been implemented for all listed types, using the constant time comparison under the hood. Signed-off-by: hashcatHitman <[email protected]>
| * | | | tor-llcrypto: as_bytes on curve25519::StaticSecrethashcatHitman2025-09-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exposed `as_bytes` on `curve25519::StaticSecret`, allowing a shared reference to the secret bytes rather than needing to copy them. Signed-off-by: hashcatHitman <[email protected]>
* | | | | Merge branch 'bounded_vec_deque' into 'main'gabi-2502025-09-242-11/+79
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | circmgr: Replace BoundedVecDeque with a much smaller wrapper Closes #2174 See merge request tpo/core/arti!3281
| * | | | | circmgr: Replace BoundedVecDeque with a much smaller wrapperNick Mathewson2025-09-172-11/+79
| |/ / / / | | | | | | | | | | | | | | | Closes #2174. See that ticket for rationale.
* | | | | arti-client: add doc comments to `TorClient::create_onion_service()`Steven Engler2025-09-231-0/+14
| | | | |
* | | | | tor-proto: add some trace logs to XON/XOFF codeSteven Engler2025-09-221-0/+9
| | | | |
* | | | | tor-cell: add `Display` impl for `XonKbpsEwma`Steven Engler2025-09-221-0/+9
| | | | |
* | | | | Merge branch 'migrate-to-waker-noop' into 'main'Jim Newsome2025-09-224-10/+9
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Migrate to waker noop See merge request tpo/core/arti!3250
| * | | | | Migrate to waker noopdisha2025-09-224-10/+9
| | | | | |