summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
* Bump all the unstable tor- and arti- crates to 0.40.0.Gabriela Moldovan2026-03-021-20/+20
| | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.40.0 done
* Bump the versions of the non-{arti-,tor-} cratesGabriela Moldovan2026-03-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The non-{arti-,tor-} crates are: ``` ./maint/list-crates | rg -v '^(tor|arti)' oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error futures-copy ``` Because this release bumps the MSRV, I am bumping the minor version of all of them. MINOR=" oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error futures-copy " for crate in $MINOR; do cargo set-version --bump minor -p $crate; done ```
* Merge branch 'relay-channel-fixes' into 'main'David Goulet2026-02-263-5/+4
|\ | | | | | | | | relay: Couple fixes related to channel creation See merge request tpo/core/arti!3726
| * proto: Remove/fix some very minor TODO(relay)David Goulet2026-02-262-5/+0
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
| * proto: Add 'CreateFast/CreatedFast' to relay message filterSteven Engler2026-02-261-0/+4
| |
* | proto: The AUTHENTICATE cell requires the SHA256 RSA identity digestDavid Goulet2026-02-262-27/+36
|/ | | | | | | Before this commit, we would use the RsaIdentity which is a SHA1 digest. We do the same for the peer RSA key. Signed-off-by: David Goulet <[email protected]>
* proto: Implement the build_certs_cell() helperDavid Goulet2026-02-253-27/+13
| | | | | | | It was all commented out until now that we have a final RelayIdentities. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Use CircIdRange::Low for relay channelsDavid Goulet2026-02-251-1/+5
| | | | | | Closes #1601 Signed-off-by: David Goulet <[email protected]>
* tor-proto: improve debug tracing messageSteven Engler2026-02-241-2/+2
| | | | | | | | | | | | | | Before: ```text Completed handshake with Ed25519Identity { ClByyE4zT+p3dudeCVkUfVA1zp2y2sOUe7u/HHLliWU } [(RsaIdentity { $547bb37f9cd8079eaf1cfcb73fff5887d6f58138 }, [9, 111, 131, 62, 212, 144, 149, 88, 211, 87, 175, 114, 18, 111, 189, 36, 205, 21, 66, 205, 217, 176, 139, 130, 70, 211, 40, 130, 79, 29, 144, 179])] ``` After: ```text Completed handshake with ed25519:wo9NA5RXkPAc7sB2301JBpvdk1RvSOGZEzgwuWP/msA [$feebaba2b6faf53ae1dc8dda8681ce026537dfa4] ```
* tor-proto: split field into two fieldsSteven Engler2026-02-242-7/+11
| | | | | These were previously in a single `Option`, but now that the `Option` was removed, I think it's nicer to make these separate fields.
* tor-proto: remove unnecessary `Option`sSteven Engler2026-02-242-26/+10
| | | | | | I don't think that the `Option`s are needed anymore, since unauthenticated channels no longer transition through the `VerifiedChannel` state.
* chanmgr: Don't allow to build relay channel to ourselfDavid Goulet2026-02-241-2/+12
| | | | | | | | | | The validate_relay_target() is meant to probably have more checks in the future hence the vagueness of it instead of being specific to the goal of this patch. Closes #1699 Signed-off-by: David Goulet <[email protected]>
* proto: Modify RelayIdentities to have encodable certDavid Goulet2026-02-231-13/+16
| | | | | | | This commit also adds the TlsKeyAndCert to the identities so the TLS acceptor can set it up. Signed-off-by: David Goulet <[email protected]>
* proto: Filter the IP address in the channel's OwnedChanTargetDavid Goulet2026-02-191-23/+35
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Reuse the RelayIds builder during the handshakeDavid Goulet2026-02-191-18/+11
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Pass PeerAddr at the channel handshake finish for initiatorsDavid Goulet2026-02-197-68/+35
| | | | | | | | | | Responder relay handshake requires the peer address at the very start as it sends its NETINFO right away. For initiators, we only need it during the finalization process which is when the NETINFO is sent and the Channel is created. Signed-off-by: David Goulet <[email protected]>
* proto: Use constructor for PeerInfo instead of BuilderDavid Goulet2026-02-192-18/+16
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Remove Default of PeerInfo/Addr and use const insteadDavid Goulet2026-02-194-31/+41
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Fix clippy errorsDavid Goulet2026-02-191-3/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Put a PeerInfo in ChannelDavid Goulet2026-02-193-3/+40
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Use the PeerAddr accross channel handshakeDavid Goulet2026-02-198-69/+76
| | | | | | | This is a large change but it is basically using PeerAddr in the channel builder through the channel handshake code and into the Channel itself. Signed-off-by: David Goulet <[email protected]>
* proto: Add PeerInfo and PeerAddr in src/peer.rsDavid Goulet2026-02-193-0/+163
| | | | | | | | | | | | | | The plan is to create PeerInfo when we do a transport connect() which indicates the exact values that are being used for to connect to the peer. We'll then put this struct in the Channel so we can use it when picking the best channel in the ChanMgr. Unfortunately, the OwnedChanTarget has a confusing and even possibly wrong API from which we can't have guarantees. Signed-off-by: David Goulet <[email protected]>
* proto: Remove unused ChannelBuilderDavid Goulet2026-02-192-77/+4
| | | | Signed-off-by: David Goulet <[email protected]>
* Merge branch 'circ-sync-view-streams' into 'main'gabi-2502026-02-1610-117/+45
|\ | | | | | | | | | | | | proto: Replace circuit-scoped `CircSyncView` with per-hop alternative Closes #2351 See merge request tpo/core/arti!3680
| * proto: Remove unfinished sentence from docsGabriela Moldovan2026-02-161-2/+0
| |
| * proto: Update IncomingStreamRequestFilter docsGabriela Moldovan2026-02-161-2/+3
| | | | | | | | | | The `CircHopSyncView` is now the view of a hop, not of the whole circuit.
| * proto: Rename CircSyncView to CircHopSyncView (fmt)Gabriela Moldovan2026-02-161-1/+1
| |
| * proto: Rename CircSyncView to CircHopSyncViewGabriela Moldovan2026-02-167-23/+15
| | | | | | | | And update the docs
| * proto: Remove unused n_open_streams() functionsGabriela Moldovan2026-02-161-17/+0
| |
| * proto: Use CircSyncView in the new circuit reactorGabriela Moldovan2026-02-161-13/+7
| | | | | | | | | | Now that CircSyncView no longer needs to know the total number of streams, we can use it in the new per-hop stream reactor design.
| * proto: Replace circuit-scoped n_open_streams() with per-hop alternativeGabriela Moldovan2026-02-162-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `IncomingStreamRequestFilter`s, and `CircSyncView`s, by extension, are used both by old relay implementation and the new one for implementing an out-of-reactor way of deciding how to handle an incoming stream. In the new circuit reactor design, we have a separate stream reactor for each hop. Upon receiving an incoming stream, the stream reactor will need to build one of these `CircSyncView` objects, and then pass it to an externally-provided `IncomingStreamRequestFilter`. Before this change, `CircSyncView::n_open_streams()` returned the total number of open streams, which wouldn't have worked with the new reactor design, because the per-hop stream reactor doesn't have a global view of all the hops, so its `CircSyncView` can't return the total number of streams (at least not without message passing, or sharing state with the other stream reactors).
| * proto: Replace CircSyncView with previously client-only CircSyncViewGabriela Moldovan2026-02-165-72/+23
| | | | | | | | | | | | | | | | | | | | Note: this commit only contains the removal of the old `CircSyncView`, and it of course doens't compile. A future commit will replace the removed file with the `syncview.rs` from the client module. This change is split over two commits because it makes reviewing easier (`git mv`ing the new file over the old results in a confusing diff, because `git` refuses to show it as a move).
| * proto: Adjust visibility in client::reactor::CircSyncViewGabriela Moldovan2026-02-161-3/+3
| | | | | | | | | | This is in preparation for replacing the top-level `CircSyncView` with it.
| * proto: Use absolute path in CircHopList importGabriela Moldovan2026-02-161-1/+1
| | | | | | | | This file will be moved to the top-level `circuit` module soon.
| * proto: Rename ClientCircSyncView to CircSyncViewGabriela Moldovan2026-02-164-10/+7
| | | | | | | | | | This will soon replace `CircSyncView` wholesale. The preliminary renaming will make the future diffs easier to review.
| * proto: Add an accessor for the CircHopOutbound of a CircHopGabriela Moldovan2026-02-161-0/+5
| | | | | | | | This will soon be needed for building a `CircSyncView`.
* | Merge branch 'msrv-1.89' into 'main'Nick Mathewson2026-02-165-4/+5
|\ \ | |/ |/| | | | | Bump MSRV to 1.89 See merge request tpo/core/arti!3684
| * proto: Use is_multiple_of() as suggested by clippyGabriela Moldovan2026-02-163-3/+3
| |
| * Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | | | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
| * Bump MSRV from 1.86 to 1.89Gabriela Moldovan2026-02-161-1/+1
| | | | | | | | | | | | | | As agreed at our last team meeting. See https://gitlab.torproject.org/tpo/core/arti/#minimum-supported-rust-version
* | Merge branch 'relay-own-cert' into 'main'David Goulet2026-02-163-6/+20
|\ \ | |/ |/| | | | | relay: Pass our TLS cert to the responder verify process See merge request tpo/core/arti!3665
| * relay: Pass our TLS cert to the responder verify processDavid Goulet2026-02-123-6/+20
| | | | | | | | | | | | | | | | | | | | For the responder to build the authentication data, it needs its own certificate of the TLS handshake that it is responding to (as a TLS server). This resolves an important TODO(relay) in the code. Signed-off-by: David Goulet <[email protected]>
* | Merge branch 'early-relay' into 'main'gabi-2502026-02-128-133/+154
|\ \ | |/ |/| | | | | | | | | proto: Pass *all* cells to handle_forward_cell() Closes #2339 See merge request tpo/core/arti!3674
| * Revert "proto: Add a new ToRelayMsg util"Gabriela Moldovan2026-02-127-57/+2
| | | | | | | | | | | | | | | | | | | | This reverts commit 04ab3cd848d7977baf58dd64ebfcad6aa54ecb17. Reverted because we no longer need to "peek" into the opaque `CircChanMsg` of a circuit reactor: now the implementation-dependent part of the reactor is in charge of handling the channel messages, and extracting `Relay` objects out of RELAY/RELAY_EARLY cells, which then get processed in the base reactor.
| * proto: Remove unused function in relay FWD reactorGabriela Moldovan2026-02-121-7/+1
| |
| * proto: Move decode_relay_cell() out of ForwardHandlerGabriela Moldovan2026-02-122-43/+36
| | | | | | | | | | | | | | | | This doesn't need to be part of the `ForwardHandler` trait anymore, because the base reactor no longer calls it directly (instead implementations are supposed to handle it internally). No functional changes here, just code motion.
| * proto: Forbid EXTEND2 from RELAY cellsGabriela Moldovan2026-02-122-2/+11
| | | | | | | | Closes #2339
| * proto: Pass the early flag to handle_relay_msg() (fmt)Gabriela Moldovan2026-02-121-1/+3
| |
| * proto: Pass the early flag to handle_relay_msg()Gabriela Moldovan2026-02-121-3/+5
| | | | | | | | | | Needed because some messages are handled differently depending on the cell type they originated from (RELAY vs RELAY_EARLY).
| * proto: Return a protocol error if we get too many RELAY_EARLYGabriela Moldovan2026-02-121-1/+20
| |