summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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]>
* Merge branch 'minor-doc-fix' into 'main'gabi-2502026-06-021-1/+1
|\ | | | | | | | | proto: Fix typo in ResolveCmdChecker docs See merge request tpo/core/arti!4035
| * proto: Fix typo in ResolveCmdChecker docsGabriela Moldovan2026-05-281-1/+1
| | | | | | | | This returns a boxed `ResolveCmdChecker`, not a `DataCmdChecker`.
* | Remove semver.md files post-releaseGabriela Moldovan2026-06-011-1/+0
| |
* | Bump all the unstable tor- and arti- crates to 0.43.0Gabriela Moldovan2026-06-011-23/+23
| | | | | | | | | | | | | | | | | | | | Done using: ``` for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.43.0 done ```
* | Merge branch 'stream-docs' into 'main'David Goulet2026-05-283-4/+4
|\ \ | | | | | | | | | | | | proto: Replace outdated references to RawCellStream See merge request tpo/core/arti!4036
| * | proto: Replace outdated references to RawCellStreamGabriela Moldovan2026-05-283-4/+4
| |/ | | | | | | | | `RawCellStream` was removed long ago, in c559754116678866eabe525f5b189b50cc78b5cc.
* / tor-proto: remove `use asynchronous_codec as futures_codec` in ↵Neel Chauhan2026-05-271-13/+14
|/ | | | | | `/channel/handler.rs` Closes #1690.
* Merge branch 'relay-destroy' into 'main'gabi-2502026-05-263-31/+161
|\ | | | | | | | | proto: Add tests for DESTROY and TRUNCATE handling See merge request tpo/core/arti!4008
| * proto: Remove TODOs about flushing pending dataGabriela Moldovan2026-05-262-8/+0
| | | | | | | | | | | | We decided the reactor is the wrong place to handle this. See discussion in #2490
| * proto: Remove unused asyncGabriela Moldovan2026-05-201-3/+2
| |
| * proto: Make TRUNCATE trigger a proto violationGabriela Moldovan2026-05-202-5/+25
| |
| * proto: Add some tests for DESTROY handlingGabriela Moldovan2026-05-201-1/+60
| |
| * proto: Make do_create2_handshake() check EXTENDED2 was sentGabriela Moldovan2026-05-201-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an extra assertion that ensures the relay reactor does in fact send an EXTENDED2 on its towards-the-client channel after receiving the CREATED2 response from the fake hop. This check is nice to have in general, but the main reason I'm doing this now is because for the DESTROY tests I'm about to add, I need the inbound MPSC queue (towards the client) drained of these handshake messages in order to check that the "next" cell we've sent is a destroy. I could've added some custom code to drain it just for the purposes of that test, but I think it's better to have `do_create2_handshake()` take care of it.
| * proto: Extend helper to check that DESTROY was sent in both directionsGabriela Moldovan2026-05-201-7/+21
| |
| * proto: Rename a test helper and adjust its docsGabriela Moldovan2026-05-201-7/+6
| | | | | | | | | | | | | | | | The new name is (hopefully) a bit more descriptive. I'm planning on extending this function soon to support checking if a DESTROY has been sent on the outbound channel too, so I'm tweaking the docs a bit in preparation for that.
| * proto: Return the CircId from test handshake helperGabriela Moldovan2026-05-201-2/+4
| | | | | | | | I'll soon need this for a DESTROY test.
| * proto: Add test helper for sending AnyChanMsgsGabriela Moldovan2026-05-201-0/+5
| |
| * proto: Add a comment clarifying why we don't need to propagate DESTROYGabriela Moldovan2026-05-201-0/+7
| |
| * proto: Adjust DESTROY-related logs in the backward reactorGabriela Moldovan2026-05-201-2/+6
| | | | | | | | | | | | | | This changes a debug log to have the same format as the corresponding DESTROY-related log from the forward reactor. Part of #2490
| * proto: Pass the cell by reference to resolve a warningGabriela Moldovan2026-05-201-3/+2
| |
| * proto: Log a message when a forward DESTROY comes alongGabriela Moldovan2026-05-201-3/+15
| | | | | | | | Part of #2490
* | tor-proto: move 'flowctl-cc' from 'experimental' to 'full'Steven Engler2026-05-221-2/+2
| |
* | Merge branch 'socket-buf-size' into 'main'opara2026-05-211-0/+1
|\ \ | | | | | | | | | | | | | | | | | | Set socket buffer sizes (`SO_SNDBUF` and `SO_RCVBUF`) for proxy sockets Closes #2500 See merge request tpo/core/arti!3957
| * | tor-proto: add note about proxy socket buf sizesSteven Engler2026-05-071-0/+1
| | |
* | | tor-proto: destructure the `ReactorStreamComponents`Steven Engler2026-05-211-5/+12
| | |
* | | tor-proto: have `StreamReqInfo` store a `ReactorStreamComponents`Steven Engler2026-05-216-49/+41
| | |
* | | tor-proto: add a TODO item for XON/XOFF flow controlSteven Engler2026-05-211-0/+3
| | |
* | | tor-proto: move memquota stream account arg to last positionSteven Engler2026-05-215-11/+11
| | | | | | | | | | | | This better matches nearby code.
* | | tor-proto: clean up `CIRCUIT_BUFFER_SIZE`Steven Engler2026-05-214-12/+2
| | |
* | | tor-proto: move more stream queue init to reactorSteven Engler2026-05-217-149/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously when initializing a stream, we constructed most of the stream-related queues outside of the reactor and passed the relevant halves of the queues (senders or receivers) into the reactor. A downside of the above approach is that the reactor may be better informed about what queues to construct, and how to construct them. For example the reactor knows what type of flow control that the hop is using, so it knows whether we need queues for passing rate limits and drain rates for XON/XOFF flow control. This commit moves the construction of these queues into the reactor and passes the relevant halves out of the reactor. In the future we can make better decisions about which queues are needed depending on the flow control method used instead of always constructing them (see arti#2068). Reviewing with `--color-moved` might be helpful as a few lines have been moved.