aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/client
Commit message (Collapse)AuthorAgeFilesLines
* tor-proto: disable flowctrl sidechannel mitigations for relaysSteven Engler7 days2-3/+22
| | | | | | | | The end result should be: 1. outgoing streams - enable sidechannel mitigations 2. incoming hs streams - enable sidechannel mitigations 3. incoming exit streams - disable sidechannel mitigations
* Merge branch 'clippy-fixes' into 'main'gabi-25013 days3-3/+6
|\ | | | | | | | | tor-proto: Some misc rust/clippy warning fixes See merge request tpo/core/arti!4304
| * tor-proto: fix a `clippy::unnecessary_filter_map`Steven Engler2026-08-111-0/+2
| |
| * tor-proto: box `CircParameters` in test-only `CtrlCmd::AddFakeHop`Steven Engler2026-08-112-2/+3
| | | | | | | | This fixes a `clippy::large_enum_variant`.
| * tor-proto: fix a 'clippy::useless_conversion'Steven Engler2026-08-111-1/+1
| |
* | tor-proto: change some instances of `sendme_inc` to u8Steven Engler2026-08-121-1/+1
|/
* proto: Add {backward|forward} prefix to circ_id in logsDavid Goulet2026-08-033-17/+17
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Rename uniq_id to circ_unique_id mostly in loggingDavid Goulet2026-08-033-22/+22
| | | | | | | | | We have decided that instead of "uniq_id" in logging, we'll use the "<domaine>-[<type>]-id" syntax to indicate who is that unique ID. This commit only renames circuit's unique ID to "circ_uniq_id". Signed-off-by: David Goulet <[email protected]>
* proto: Log both UniqId and CircId when possibleDavid Goulet2026-08-034-24/+88
| | | | | | | | | | This commit only affects logging. Whenever possible, log both the UniqId and CircId. This also changes the log lines which is now "uniq_id=" and "circ_id=" as the UniqId is internal and circ_id (CircId) is protocol level. Signed-off-by: David Goulet <[email protected]>
* proto: Rename CircId and UniqId variable nameDavid Goulet2026-08-034-15/+15
| | | | | | | | | | | | | | | A CircId is now a circ_id and a UniqId is a unique_id so we stop confusing them in the code. Furthermore, channel_id that are CircId are now circ_id. Channel IDs are different and encoded internally into a UniqId. This is the first step to clarify semantic before we change the logging to log both unique ID and circ ID. No behavior change. Signed-off-by: David Goulet <[email protected]>
* tor-cell: rename `XonKbpsEwma` to `XonKBpsEwma`Steven Engler2026-07-303-6/+6
|
* proto: Remove feature-gating from CircHop::handle_msg()Gabriela Moldovan2026-07-231-1/+3
| | | | | | | | | | | | | | | This feature-gating has been a source of confusion, and it unnecessarily complicates the stream message handling flow. I've previously argued in favour of keeping it, in the spirit of a belt and braces approach to message validation, but I've been convinced that in this particular case, the feature-gate is more trouble than it's worth. What makes things worse is that the `CircHop::handle_msg()` function was designed poorly (by yours truly). I plan on refactoring it at some point, hopefully soon. There is a TODO about this below its doc comment.
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-1/+0
|
* proto: log virtual hop additions at trace.Nick Mathewson2026-07-021-0/+2
| | | | We do something similar with non-virtual hops at !4076.
* proto: Improve/clarify documentation on extend_virtual.Nick Mathewson2026-07-021-0/+8
|
* Upgrade to itertools 0.15.0Nick Mathewson2026-07-011-10/+9
| | | | | | Additionally, fix itertools usage in maybenot_padding.rs The definition of `Position` changed in 0.15.0.
* proto: log hop settings at trace upon client circuit opening.Nick Mathewson2026-06-231-1/+2
|
* proto: Add crate-level exports for two extra stream types (fmt)Gabriela Moldovan2026-06-175-19/+6
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | 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.
* proto: Move RateLimitedWriter to tor-async-utilsDavid Goulet2026-06-081-2/+3
| | | | Signed-off-by: David Goulet <[email protected]>
* Merge branch 'destroy-cell3' into 'main'gabi-2502026-06-081-12/+1
|\ | | | | | | | | 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-081-12/+1
| |
* | 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
* 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`.
* | proto: Replace outdated references to RawCellStreamGabriela Moldovan2026-05-283-4/+4
|/ | | | | `RawCellStream` was removed long ago, in c559754116678866eabe525f5b189b50cc78b5cc.
* tor-proto: have `StreamReqInfo` store a `ReactorStreamComponents`Steven Engler2026-05-211-4/+1
|
* tor-proto: move memquota stream account arg to last positionSteven Engler2026-05-213-8/+8
| | | | This better matches nearby code.
* tor-proto: clean up `CIRCUIT_BUFFER_SIZE`Steven Engler2026-05-211-4/+0
|
* tor-proto: move more stream queue init to reactorSteven Engler2026-05-214-80/+8
| | | | | | | | | | | | | | | | | | | | 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.
* tor-proto: add `ReactorStreamComponents` to bundle return valsSteven Engler2026-05-204-21/+29
|
* tor-proto: move stream incoming queue init to reactorSteven Engler2026-05-204-36/+46
| | | | | | | | | | | The stream queue length (for messages incoming from the Tor network) depends on the type of flow control we're using for the hop. Currently we construct the stream queue outside of the circuit reactor, but we don't have the flow control information here. Instead of constructing the stream queue outside of the reactor and passing the sender into the reactor, we construct the stream queue inside of the reactor and pass the receiver out of the reactor.
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-121-4/+4
| | | | | | | | | | | 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.
* tor-proto: clean up return type of `Circuit::begin_stream()`Steven Engler2026-05-112-13/+8
|
* tor-proto: indentation cleanupSteven Engler2026-05-111-20/+15
|
* tor-proto: reorg error handling for BeginStream reactor cmdSteven Engler2026-05-112-10/+26
|
* proto: Derive PartialEq for MetaCellDispositionGabriela Moldovan2026-05-071-1/+1
|
* proto rpc: Turn tunnel paths into a dictNick Mathewson2026-04-282-9/+30
| | | | | | | | | This will make it possible to tell whether a path has been replaced in the tunnel. Since the UniqId type might change its representation in the future, I've documented that we don't guarantee anything about the strings used to distinguish paths.
* proto rpc: Change PathEntry to an enum.Nick Mathewson2026-04-281-28/+30
|
* proto: Add an RPC function to access tunnel and inspect its path.Nick Mathewson2026-04-281-0/+222
| | | | Additionally, allow inspecting tunnel paths directly from streams.
* proto: Allow DataStreamCtrl and ClientTunnel to be RPC objects.Nick Mathewson2026-04-281-0/+5
|
* tor-proto: Simplify a match+if statement.Nick Mathewson2026-04-211-13/+5
|
* proto: Remove re-export of MsgBuf in unit testsDavid Goulet2026-04-141-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Add channel relay handshake unit testsDavid Goulet2026-04-141-178/+0
| | | | | | | | | | | | | Instead of copying the client unit tests into the channel module, just make both current unit tests run on a client and relay handshake. This required a bit of trickery with type HandshakeConnectFn but works out in the end. It also adds the RelayMsgBuf that wraps a MsgBuf in order to implement CertifiedConn which is very relay only. Signed-off-by: David Goulet <[email protected]>
* proto: Move channel client handshake tests into client moduleDavid Goulet2026-04-141-0/+225
| | | | | | | | | No behavior change. Make the const cells public as they will be useful for more upcoming unit tests especially on the relay side. Signed-off-by: David Goulet <[email protected]>
* Merge branch 'create-fast' into 'main'opara2026-04-082-10/+10
|\ | | | | | | | | Add support for handling CREATE_FAST cells and launching a circuit reactor See merge request tpo/core/arti!3846
| * tor-{proto,chanmgr}: change how channels accept a CREATE* handlerSteven Engler2026-04-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | Instead of giving the `CreateRequestHandler` to the channel after it's constructed, we integrate it into the handshake so that we can give it to the channel constructor. The `ChannelType` is no longer part of the `Channel`. Some of the tests could be cleaned up slightly now that the channel doesn't need the `ChannelType`, but I don't want to conflict with !3853.
| * tor-proto: small cleanup of legacy codeSteven Engler2026-04-081-6/+1
| | | | | | | | | | | | | | I think it was written like this because earlier versions of rust didn't allow references to temporaries like `&mut rand::rng()` and needed them to be bound to a variable. But this isn't necessary anymore and so the comment doesn't make sense.