aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'remove-lint' into 'main'Jim Newsome2026-07-153-3/+1
|\ | | | | | | | | | | | | Removed unnecessary lint Closes #2556 See merge request tpo/core/arti!4210
| * Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-152-2/+0
| |
| * add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
| |
| * Removed unnecessary lintpryty262026-07-151-1/+1
| | | | | | | | Removed unnecessary lint
* | multiple crates: Fix clippy warningshjrgrn2026-07-101-3/+3
|/
* tor-chanmgr: remove comment for something that's not implementedSteven Engler2026-06-171-2/+1
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-0910-0/+10
| | | | | | | | | | | | 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.
* tor-rtcompat+misc: add `NetStreamProvider::ConnectOptions`Steven Engler2026-06-082-2/+6
| | | | | | | | | This adds the trait type `ConnectOptions` to `NetStreamProvider` and adds this `ConnectOptions` as an argument to `NetStreamProvider::connect()`. You probably want to look at the changes in tor-rtcompat first, then the rest of this commit is updating the various places we use `NetStreamProvider`.
* tor-chanmgr: Add doccomments and fix typo.Wesley Aptekar-Cassels2026-06-022-2/+4
|
* tor-chanmgr: Refactor metrics code slightly.Wesley Aptekar-Cassels2026-06-022-194/+161
|
* tor-chanmgr: Split out channels built error metrics.Wesley Aptekar-Cassels2026-06-022-7/+206
|
* tor-chanmgr: Separate inbound/outbound channel metrics.Wesley Aptekar-Cassels2026-06-022-8/+10
|
* tor-chanmgr: Add metrics.Wesley Aptekar-Cassels2026-06-022-1/+41
| | | | | | This adds a structure to initialize metrics when the `ChanMgr` is created, and adds a counter for the total number of channels built, broken down by success and failure.
* tor-chanmgr: fix `unused_imports` warningSteven Engler2026-05-271-1/+3
|
* Merge branch '3777_rebased' into 'main'Nick Mathewson2026-05-262-1/+8
|\ | | | | | | | | ptmgr: pass outbound_proxy to managed PT processes See merge request tpo/core/arti!4017
| * ptmgr: Defer proxy protocol string conversionNihal2026-05-261-1/+1
| |
| * ptmgr: pass outbound_proxy to managed PT processesNihal2026-05-261-0/+7
| | | | | | | | | | | | | | Previously the [channel] outbound_proxy setting was applied to Arti's own direct connections but was not forwarded to managed PT processes. https://spec.torproject.org/pt-spec/configuration-environment.html
* | Merge branch 'fix-channel-build-task-disappeared' into 'main'Nick Mathewson2026-05-264-119/+188
|\ \ | |/ |/| | | | | | | | | tor-chanmgr: notify waiters when a launch is cancelled Closes #1716 See merge request tpo/core/arti!3946
| * tor-chanmgr: Notify waiters when a launch is cancelledBoris Nagaev2026-05-044-119/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a future that owns a pending channel launch is dropped after publishing the pending entry, other waiters can see the oneshot sender disappear and report "channel build task disappeared" as an internal bug. Fix this by tying pending-entry cleanup and waiter notification together. Once we take responsibility for a pending launch, every exit path now removes or upgrades the pending entry and notifies waiters with the observed result. Cancellation reports RequestCancelled, while post-build failures keep their original error instead of turning into the internal bug or retrying the launch owner. Add regression tests that cover both successive dropped launch-owner futures and a failure while installing a newly built channel, so waiters see the expected error in each case.
* | Merge branch 'socket-buf-size' into 'main'opara2026-05-211-2/+14
|\ \ | | | | | | | | | | | | | | | | | | Set socket buffer sizes (`SO_SNDBUF` and `SO_RCVBUF`) for proxy sockets Closes #2500 See merge request tpo/core/arti!3957
| * | tor-rtcompat+misc: add `NetStreamProvider::ListenOptions`Steven Engler2026-05-071-2/+14
| |/ | | | | | | | | | | | | | | | | This adds the trait type `ListenOptions` to `NetStreamProvider` and adds this `ListenOptions` as an argument to `NetStreamProvider::listen()`. You probably want to look at the changes in tor-rtcompat first, then the rest of this commit is updating the various places we use `NetStreamProvider`.
* | chanmgr: report target address, not proxy address, in errorNick Mathewson2026-05-073-5/+10
| | | | | | | | | | | | Also, change the address type in the error to String for now. In reality we need a better representation of this error, but that shouldn't block this.
* | chanmgr: refactor error typesNick Mathewson2026-05-073-21/+43
| | | | | | | | | | Proxy belonged as a subcase of ChannelBuild. And ChannelBuild was only about making an initial connection.
* | chanmgr: Do not turn connect errors into proxy errors.Nick Mathewson2026-05-072-15/+32
|/ | | | | | | This fixes the problem where we'd report all connect failures as proxy failures. Closes #2459.
* linkspec: Rename all_addrs_allowed_for_extend()David Goulet2026-04-091-2/+4
| | | | | | Also set a better error message when validating channel target. Signed-off-by: David Goulet <[email protected]>
* 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]>
* chanmgr: Validate the ChanTarget for both client and relayDavid Goulet2026-04-091-41/+64
| | | | | | | | | | It used to be only with the feature = relay but since client can have that feature enabled, we now validate based on channel outbound type instead. Related to #2440 Signed-off-by: David Goulet <[email protected]>
* tor-{proto,chanmgr}: change how channels accept a CREATE* handlerSteven Engler2026-04-081-18/+13
| | | | | | | | | | | 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-chanmgr: add support for a `CreateRequestHandler`Steven Engler2026-04-083-4/+90
|
* linkspec: Rename has_all_public_addresses()David Goulet2026-03-301-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* linkspec: Rename has_all_reachable_addresses()David Goulet2026-03-301-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* linkspec: Rename has_all_valid_port() to has_all_nonzero_port()David Goulet2026-03-301-2/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Rename RelayIdentities to RelayChannelAuthMaterialDavid Goulet2026-03-303-41/+50
| | | | | | | | | | | | This object contains a melting pot of public keys, private keys and certificates. Rename it to reflect that it is channel authentication material and not "identities. https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374454 Signed-off-by: David Goulet <[email protected]>
* proto: Rename many variables with more fine grained namingDavid Goulet2026-03-301-7/+7
| | | | | | | | | | Mostly, identity a `ChanTarget` as a "target" since we juggle with PeerInfo and OwnedChanTarget nowadays. All certificate and keys have very specific names which attempts to match the spec as much as possible. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Always use MaybeSensitive<PeerAddr> when building a channelDavid Goulet2026-03-301-7/+6
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add a build_client_channel() helper functionDavid Goulet2026-03-301-59/+83
| | | | | | | | | | | | This moves the client channel building code into build_client_channel() to match the build_relay_channel() function pattern. No behavior change, just code movement. Small changes were needeed (reference for instance) but no behavior change. https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374448 Signed-off-by: David Goulet <[email protected]>
* chanmgr: Move relay target PT validation in validate_relay_target()David Goulet2026-03-301-6/+9
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Validate the relay channel target addressesDavid Goulet2026-03-301-1/+35
| | | | | | | | | | | | | | | Make sure the port is non zero and that all addresses are globally reachable. Notice the use of ChanProto error in this commit instead of UnusableTarget. Relay channel initiator are opened by the circuit reactor meaning from an EXTEND2 request meaning the target is not controlled by us so any errors is a channel protocol violation. UnusableTarget is an internat Bug. https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374447 Signed-off-by: David Goulet <[email protected]>
* tor-chanmgr: port to web-time-compat.Nick Mathewson2026-03-261-11/+9
|
* tor-chanmgr: don't `warn_report!` for failed connectionsSteven Engler2026-03-241-1/+0
| | | | | | | | | | | | | | | | | | | | `warn_report!` is useful when there's an error that we need to ignore and can't propagate up the call stack. But here we're using `warn_report!` while also returning the error in a `Error::ChannelBuild`. This is not great because: 1. The caller should warn if it wants to, since it will have the error message and the proper context. 2. This code is doing something like happy eyeballs, which means we only care that one connection succeeds, not if any fail. One instance where this is problematic is when running Arti on a machine without IPv6 support. If connecting to a relay with both an IPv4 and IPv6 address, the IPv6 attempt will always fail. We don't want to warn about every outgoing IPv6 connection failure when the IPv4 connection succeeds.
* chanmgr: Don't build relay channel if method is not DirectDavid Goulet2026-03-191-0/+6
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Clarify the use of no identity ChanTargetDavid Goulet2026-03-191-6/+10
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Don't get the peer cert as a responder channelDavid Goulet2026-03-191-9/+1
| | | | | | | | No initiator present a TLS certificate and so don't try to get one. Fixes #2388 Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add a comment/TODO about channel expiryDavid Goulet2026-03-181-0/+16
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Support reconfigure of unauthenticated channelsDavid Goulet2026-03-181-5/+8
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Use the unauth_channels listDavid Goulet2026-03-181-7/+12
| | | | | | Put channel without relay identities in the unauth_channels list. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add a list of unauthenticated channelsDavid Goulet2026-03-181-0/+13
| | | | | | | | | | | Needed to handle client/bridge -> relay channels which are not authenticated meaning they don't have a RelayIds so they can't be put in the ListByRelayIds<>. Feature gate it to "relay" as a client will never have those kind of channels. Signed-off-by: David Goulet <[email protected]>
* cargo fmtNihal2026-03-181-6/+9
|
* tor-chanmgr: add loopback validation, startup warning and httparseNihal2026-03-184-176/+332
|
* tor-chanmgr: split handshake into helper functionsNihal2026-03-181-14/+47
|