aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src
Commit message (Collapse)AuthorAgeFilesLines
...
* relay: Use the new RelayNtorKeys for the create handlerDavid Goulet2026-04-211-9/+5
| | | | Signed-off-by: David Goulet <[email protected]>
* Merge branch 'rust-1.95-warnings' into 'main'Nick Mathewson2026-04-211-13/+5
|\ | | | | | | | | Fix new warnings from Rust 1.95 See merge request tpo/core/arti!3902
| * tor-proto: Simplify a match+if statement.Nick Mathewson2026-04-211-13/+5
| |
* | Merge branch 'stream-close' into 'main'opara2026-04-201-6/+9
|\ \ | | | | | | | | | | | | tor-proto: Small comment and variable name changes See merge request tpo/core/arti!3865
| * | tor-proto: small comment and variable name changesSteven Engler2026-04-071-6/+9
| | | | | | | | | | | | I think this makes the code a little easier to follow.
* | | Merge branch 'rm-var-suffix' into 'main'David Goulet2026-04-201-4/+4
|\ \ \ | | | | | | | | | | | | | | | | proto: Remove dummy suffixes from variable name See merge request tpo/core/arti!3903
| * | | proto: Remove dummy suffixes from variable nameGabriela Moldovan2026-04-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I used these `_foo` suffixes to make sense of things during development: at the time, I had multiple "forward" and "backward" types, and I needed to distinguish them without spending too much time thinking of a provisory name. I meant to remove them before upstreaming my branch, but I forgot...
* | | | proto: Remove unnecessary clippy allowGabriela Moldovan2026-04-201-2/+0
| |_|/ |/| | | | | | | | | | | I'm removing this so that we don't accidentally suppress new instances of this warning.
* | | tor-proto: give our rsa ident to the channel reactorSteven Engler2026-04-166-5/+31
|/ / | | | | | | This will be needed for ntor handshakes.
* | proto: Remove unused imports in unit testsDavid Goulet2026-04-141-1/+1
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | proto: Fix relay unit tests with new CreateRequestHandlerDavid Goulet2026-04-141-1/+13
| | | | | | | | | | | | | | The CreateRequestHandler was introduced prior to the relay handshake unit tests so fix them now that we have a way to build one. Signed-off-by: David Goulet <[email protected]>
* | proto: Add a test helper function for building a CircNetParametersDavid Goulet2026-04-143-0/+86
| | | | | | | | | | | | | | | | | | We can't access `NetParameters` in this crate to build from consensus default value so instead add a `defaults_for_tests()` gated function for each parameters object which puts in the defaults from the spec. We'll need CircNetParameters in order to build create request handler for unit tests hence why it is in src/circuit.rs.
* | proto: Move DummyChan/DummyChanProvider to relay channel.rsDavid Goulet2026-04-142-64/+77
| | | | | | | | | | | | | | | | | | From the reactor.rs to channel.rs, makes more sense and we'll need it in the handshake tests. No behavior change, just code movement and a function rename. Signed-off-by: David Goulet <[email protected]>
* | proto: Remove re-export of MsgBuf in unit testsDavid Goulet2026-04-143-5/+3
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | proto: Add channel relay handshake unit testsDavid Goulet2026-04-144-182/+430
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 test certs module at the topDavid Goulet2026-04-141-31/+31
| | | | | | | | | | | | | | | | | | Just for mental sanity to have all const at the same place and easily readable. No behavior change. Signed-off-by: David Goulet <[email protected]>
* | proto: Move channel client handshake tests into client moduleDavid Goulet2026-04-143-218/+237
| | | | | | | | | | | | | | | | | | 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]>
* | tor-proto: handle a div-by-zero case that should never happenSteven Engler2026-04-131-3/+7
| | | | | | | | | | If this is zero, then it means that the consensus had bad values. But may as well check it anyways.
* | tor-proto: fix flow control side channel checksSteven Engler2026-04-131-35/+47
| |
* | tor-proto: change flow control `bytes_sent_total` to `u64`Steven Engler2026-04-131-9/+9
| |
* | tor-proto: add more tests for flow controlSteven Engler2026-04-131-0/+16
| |
* | Merge branch 'id-logging' into 'main'Jim Newsome2026-04-131-2/+2
|\ \ | | | | | | | | | | | | Tweak TunnelId and TunnelScopedCircId Display impls See merge request tpo/core/arti!3875
| * | Tweak Display for TunnelScopedCircIdJim Newsome2026-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Circuit IDs (UniqId) are displayed as "Circ <x>.<y>". Prior to this MR, these TunnelScopedCircId's were displayed as "Circ <t>.<x>.<y>" where t is the integer tunnel ID. This made corresponding logs a bit confusing as to why some "Circ" identifiers had two parts and some have three, and didn't make clear that the "<x>.<y>" part of the latter were comparable with the two-part UniqIds. The previous commit effectively changes the latter to "Circ Tunnel <t>.<x>.<y>", which is still a bit confusing. This commit changes the display of TunnelScopedCircId's to "Circ <x>.<y> (Tunnel <t>)", which makes the distinction between the circuit and tunnel IDs clearer.
| * | Tunnel ID: included "Tunnel" type-specifier in DisplayJim Newsome2026-04-091-1/+1
| | | | | | | | | | | | | | | | | | This is akin to how circuit `UniqId`'s are prefixed with "Circ", and helps clarify logs where it isn't always clear from context whether a tunnel ID or circuit ID is being displayed.
* | | tor-proto: small comment improvementSteven Engler2026-04-091-1/+2
| | |
* | | tor-proto: replace a tuple with a dedicated structSteven Engler2026-04-092-18/+29
| | |
* | | tor-proto: give our ed ident to the channel reactorSteven Engler2026-04-096-5/+48
| | | | | | | | | | | | This will be needed for ntor handshakes.
* | | proto: Apply deferred rustfmtGabriela Moldovan2026-04-091-1/+1
| | |
* | | proto: Add method for installing ntor keys in the create handlerGabriela Moldovan2026-04-091-2/+27
| | | | | | | | | | | | | | | This also updates the key rotation task to call the setter whenever the ntor keys get updated.
* | | arti-relays: Pass a CreateRequestHandler to the crypto taskGabriela Moldovan2026-04-091-0/+1
| | | | | | | | | | | | This will need to be updated each time the ntor keys change.
* | | relay: Pass advertise SocketAddr to channel builder instead of IpAddrDavid Goulet2026-04-092-8/+8
|/ / | | | | | | | | | | | | | | | | | | This trickles down to the tor-proto channel handshake code. But, the real need is in the channel builder in order to validate the outbound channel target. Fixes #2440 Signed-off-by: David Goulet <[email protected]>
* | Merge branch 'create-fast' into 'main'gabi-2502026-04-092-56/+71
|\ \ | | | | | | | | | | | | tor-proto: Move CREATE_FAST handling to a helper See merge request tpo/core/arti!3869
| * | tor-proto: take `CreateRequest` message by referenceSteven Engler2026-04-082-6/+5
| | | | | | | | | | | | | | | Clippy has started warning about this since we moved the CREATE_FAST handling to a helper, so this resolves that.
| * | tor-proto: move a TODOSteven Engler2026-04-081-2/+1
| | |
| * | tor-proto: remove old TODOSteven Engler2026-04-081-4/+1
| | |
| * | tor-proto: rustfmtSteven Engler2026-04-081-6/+3
| | | | | | | | | | | | Fix formatting from previous code movement.
| * | tor-proto: move CREATE_FAST handlingSteven Engler2026-04-081-45/+43
| | | | | | | | | | | | | | | This moves the code, changes the indentation, and wraps the result in an `Ok()`.
| * | tor-proto: prepare to move CREATE_FAST handling to a helperSteven Engler2026-04-081-8/+34
| | |
| * | tor-proto: remove old TODOSteven Engler2026-04-081-1/+0
| | | | | | | | | | | | This had already been resolved.
* | | proto: Bring back AuthLogDigest and explicitly convert to SLOG/CLOGDavid Goulet2026-04-084-36/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From opara's comment: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3844#note_3388789 Keep the low level AuthLogDigest type alias and return it. The callsite is the one deciding if the returned digest is a Clog or a Slog. Related to #2441 Signed-off-by: David Goulet <[email protected]>
* | | proto: Add ClogDigest and SlogDigest typesDavid Goulet2026-04-087-38/+80
|/ / | | | | | | | | | | | | | | | | Introduce those types in order to avoid mixing them up as the previous AuthLogDigest was just a type alias over [u8; 32] Fixes #2441 Signed-off-by: David Goulet <[email protected]>
* | Merge branch 'create-fast' into 'main'opara2026-04-0815-99/+833
|\ \ | | | | | | | | | | | | Add support for handling CREATE_FAST cells and launching a circuit reactor See merge request tpo/core/arti!3846
| * | tor-proto: replace use of `ChannelDirection` with `CircIdRange`Steven Engler2026-04-084-25/+16
| | |
| * | Revert "tor-proto: change `CreateResponse` to `restricted_msg!`"Steven Engler2026-04-082-29/+20
| | | | | | | | | | | | This reverts commit 9c38daf2d3548feca2ff555f5bd52165add0d20c.
| * | tor-proto: add a `From<$ttype>` impl for `RestrictedChanMsgSet`Steven Engler2026-04-081-0/+8
| | | | | | | | | | | | This is needed for the revert in the following commit.
| * | tor-{proto,chanmgr}: change how channels accept a CREATE* handlerSteven Engler2026-04-088-85/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: simplify error handling in `CreateRequestHandler::handle_create()`Steven Engler2026-04-081-71/+85
| | |
| * | tor-proto: rename `CircIdRange::is_allowed_by_peer()` to `is_allowed_for_peer()`Steven Engler2026-04-081-2/+2
| | |
| * | tor-proto: remove TODO about `UniqId` overflowSteven Engler2026-04-081-2/+2
| | |
| * | tor-proto: handle incoming RELAY_EARLY messagesSteven Engler2026-04-081-2/+10
| | |