aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
| * proto: Simplify StreamEvent::LocalStreamClosedGabriela Moldovan2026-06-231-15/+4
| | | | | | | | | | This doesn't need to contain the `CloseStreamBehavior` or `TerminateReason`, because we always use the same ones.
| * proto: Rename StreamEvent::Closed to LocalStreamClosedGabriela Moldovan2026-06-231-5/+5
| | | | | | | | | | | | | | I realized the previous naming was ambiguous. Hopefully this makes it clear that this `StreamEvent` triggers when the MPSC channel connecting the reactor to the local application stream (for example the local TCP connection of the stream, in the case of exit streams) is dropped.
| * proto: Remove unnecessary result mappingGabriela Moldovan2026-06-231-1/+1
| | | | | | | | This already returns `()` in the `Ok` case.
| * proto: Implement ClosePendingStream in the stream reactorGabriela Moldovan2026-06-233-5/+40
| | | | | | | | Closes #2590
| * proto: Add a helper function for handling closed streams (fmt)Gabriela Moldovan2026-06-231-10/+10
| |
| * proto: Add a helper function for handling closed streamsGabriela Moldovan2026-06-231-6/+22
| | | | | | | | This will soon be reused for implementing `CtrlMsg::ClosePendingStream`.
| * proto: Add a new StreamReactor control message for closing streamsGabriela Moldovan2026-06-231-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be sent by the FWD reactor. Essentially, this going to be the final control message in the chain `IncomingStream::reject()` -> `RelayCirc::reject()` -> `forward::CtrlCmd::ClosePendingStream`-> `HopMgr::close_pending()` -> `stream::CtrlCmd::ClosePendingStream` -> stream gets removed from the stream map, END sent Part of #2590
| * proto: Update docs to clarify where the StreamReactor cell sender isGabriela Moldovan2026-06-231-1/+2
| |
| * proto: Implement RelayCirc::close_pending()Gabriela Moldovan2026-06-231-4/+17
| | | | | | | | Closes #2590
| * proto: Add a control message for closing pending streams (fmt)Gabriela Moldovan2026-06-231-3/+4
| |
| * proto: Add a control message for closing pending streamsGabriela Moldovan2026-06-232-1/+41
| |
| * proto: Replace StreamMsg with a new CtrlMsg typeGabriela Moldovan2026-06-234-26/+32
| | | | | | | | | | | | | | This replaces the `StreamMsg` `StreamReactor` sender with a new `CtrlMsg` type. This `CtrlMsg` currently only has a `DeliverStreamMsg` variant (which is the same as the old `StreamMsg` type), but will soon grow another variant, for terminating a stream.
| * proto: Make the new reject_stream() test check the END cell tooGabriela Moldovan2026-06-231-1/+5
| |
| * proto: Factor helper macro out of test functionGabriela Moldovan2026-06-231-17/+17
| | | | | | | | This is just code motion
| * proto: Refactor test macro to not rely on function contextGabriela Moldovan2026-06-231-6/+7
| | | | | | | | | | | | I am about to move this out of the `extend_and_forward()` test, because I want to reuse it in the new `reject_stream()` test for checking that the relay wrote an END cell to the stream.
| * proto: Add a test for rejecting an incoming stream in the relay reactorGabriela Moldovan2026-06-231-0/+40
| | | | | | | | | | | | | | | | This test currently fails, because `IncomingStream::reject()` calls `RelayCirc::close_pending()` under the hood, which isn't implemented yet. Part of #2590
* | proto: log hop settings at trace upon client circuit opening.Nick Mathewson2026-06-231-1/+2
|/
* Merge branch 'msrv-1.91' into 'main'gabi-2502026-06-181-1/+1
|\ | | | | | | | | Bump MSRV to 1.91 See merge request tpo/core/arti!4105
| * Bump MSRV to 1.91Clara Engler2026-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit bumps the MSRV to 1.91 which was released on 2025-10-30. The Cargo.toml files were updated as follows: ```sh git ls-files | \ grep ".*Cargo\.toml$" | \ xargs sed -i '' 's/^rust-version = "1\.89"$/rust-version = "1\.91"/g' ``` The following files were updated manually: ``` modified: .gitlab-ci.yml modified: README.md modified: flake.nix modified: maint/docker-android/Dockerfile ```
* | proto: Update tests to use the new stream exportsGabriela Moldovan2026-06-171-4/+4
| | | | | | | | The tests don't compile otherwise.
* | proto: Add crate-level exports for two extra stream types (fmt)Gabriela Moldovan2026-06-177-26/+10
| |
* | proto: Add crate-level exports for two extra stream typesGabriela Moldovan2026-06-171-0/+4
| | | | | | | | | | For convenience. This will soon replace a corresponding re-export from `tor_proto::client::stream`.
* | proto: Re-export StreamReceiver from tor_proto::streamGabriela Moldovan2026-06-171-1/+2
| | | | | | | | This will soon replace the re-export from `tor_proto::client::stream`.
* | proto: Re-export the Incoming* types from tor_proto::streamGabriela Moldovan2026-06-171-0/+6
| | | | | | | | | | | | | | | | | | | | These will replace the pub re-exports from `tor_proto::client::stream`. This reorg is needed because currently, the only public export of the incoming stream types is from `tor_proto::client::stream`, but these aren't actually client specific: relays will use them too, for implementing exit, DNS and directory streams. So it makes more sense to export them from the top-level stream module instead.
* | proto: Make the stream module pubGabriela Moldovan2026-06-171-1/+1
| |
* | Merge branch 'flowctrl-tests' into 'main'opara2026-06-162-14/+434
|\ \ | |/ |/| | | | | tor-proto: Add unit test for `XonXoffReader` See merge request tpo/core/arti!4093
| * tor-proto: add a unit test for `XonXoffReader`Steven Engler2026-06-162-1/+399
| | | | | | | | | | The 'futures' version bump is needed so that our test can use `UnboundedSender::try_recv()` in the minimal-versions CI test.
| * tor-proto: add `DrainRateNotifier` trait for `XonXoffReader`Steven Engler2026-06-101-13/+35
| | | | | | | | This will allow us to add a unit test for `XonXoffReader`.
* | Merge branch 'destroy' into 'main'opara2026-06-122-29/+5
|\ \ | | | | | | | | | | | | | | | | | | Always use destroy reason NONE in circuit handshake code Closes #2466 See merge request tpo/core/arti!4088
| * | tor-proto: circ handshake now always uses NONE destroy reasonSteven Engler2026-06-122-29/+5
| |/
* | tor-proto: Remove a now-redundant .iter() in a call to iter_joinIan Jackson2026-06-111-1/+1
| |
* | Merge branch 'cgo-stable' into 'main'Nick Mathewson2026-06-101-2/+2
|\ \ | |/ |/| | | | | | | | | Mark "counter-galois-onion" as stable Closes #2550 See merge request tpo/core/arti!4069
| * Mark "counter-galois-onion" as stableNick Mathewson2026-06-041-2/+2
| |
* | Merge branch 'clippy-string-slice' into 'main'Nick Mathewson2026-06-1035-0/+36
|\ \ | | | | | | | | | | | | Lint for clippy::string_slice See merge request tpo/core/arti!4086
| * | maint: Run maint/add_warning to deny string slicesClara Engler2026-06-0935-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Bump derive-deftly to 1.11.3Ian Jackson2026-06-091-1/+1
|/ / | | | | | | New beta semver policy means we should pin the patchlevel.
* | proto: Move RateLimitedWriter to tor-async-utilsDavid Goulet2026-06-086-768/+4
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | proto: Move TokenBucket to tor-basic-utilsDavid Goulet2026-06-083-848/+3
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | Merge branch 'destroy-cell3' into 'main'gabi-2502026-06-089-28/+395
|\ \ | | | | | | | | | | | | proto: Add a new channel -> circuit queue type See merge request tpo/core/arti!4025
| * | proto: Update the tests to use the new CircuitRx{Receiver,Sender}sGabriela Moldovan2026-06-086-16/+17
| | |
| * | proto: Replace CircuitRx{Sender,Receiver} with new channel typeGabriela Moldovan2026-06-083-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed for relays as part of #2490. Note that changing this type affects the client implementation too (i.e. clients will start prioritizing inbound DESTROY, discarding any queued data without forwarding it to their local streams). But that's okay, because it will generally only affect misbehaving clients, and clients unlucky enough to encounter a hibernating relay.
| * | proto: Remove now-unused importGabriela Moldovan2026-06-081-1/+1
| | | | | | | | | | | | | | | `CircuitRxSender` is no longer a `Sink`, so we don't need this import anymore.
| * | proto: Add a new channel -> circuit queue typeGabriela Moldovan2026-06-082-0/+372
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds new a `CircuitRxSender`/`CircuitRxReceiver` queue type. The corresponding (`Sink`-link) sender and `Stream` implementations prioritize the delivery of `DESTROY` messages, which get delivered immediately, even if there are other messages queued in the underlying MPSC message queue. We are okay with the resulting data loss, because inbound DESTROY can be indicative of malicious activity on the circuit. We choose to err on the safe side, and free up the resources associated with such circuits as soon as possible. DESTROY messages are also sent by relays when they're about to hibernate, and by clients once they've decided to stop using a circuit. In the latter case, the lack of an `RELAY_COMMAND_END_ACK` does mean that this prioritization can cause data loss in cases where the client closes the circuit immediately after END-ing a stream. However, this is a deficiency in the protocol, and not something we want to fix by implementing custom flushing logic in the reactor. See torspec#196 and the discussion in #2490. Part of #2490
* | proto: Enable the relay exit stream testGabriela Moldovan2026-06-081-1/+0
| | | | | | | | | | This passes now that we can build a `DataStream` without a `ClientDataStreamCtrl`.
* | proto: Set the ClientDataStreamCtrl to None for relay streams (fmt)Gabriela Moldovan2026-06-081-5/+7
| |
* | proto: Set the ClientDataStreamCtrl to None for relay streamsGabriela Moldovan2026-06-081-3/+3
| | | | | | | | Previously this would panic.
* | proto: Make the ClientDataStreamCtrl optional throughoutGabriela Moldovan2026-06-081-12/+22
|/ | | | | | | We will reuse `DataStream` for relay exit streams, and those aren't going to have a `ClientDataStreamCtrl`. Part of #2557
* Upgrade tokio to LTS 1.47.1Neel Chauhan2026-06-031-2/+2
| | | | Closes #2137.
* proto: add regression tests for verify_link_auth_certmoumenalaoui2026-06-021-0/+79
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Fix inverted cert sig and AUTHENTICATE compareDavid Goulet2026-06-022-5/+2
| | | | | | | | | | | | Missed at review and no unit tests at the time catched those. The next commit has a unit tests to make sure these checks are now valid. Fixes #2501 Fixes #2502 Special thanks to Moumen Alaoui for reporting this early! Signed-off-by: David Goulet <[email protected]>