summaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* chanmgr: Rename function parameterDavid Goulet2026-02-261-3/+3
| | | | | | | It was _target before because we had it in the function with a cfg_if!(). Now don't so no need. Signed-off-by: David Goulet <[email protected]>
* chanmgr: The validate_relay_target() had its logic inversedDavid Goulet2026-02-261-4/+6
| | | | Signed-off-by: David Goulet <[email protected]>
* tor-proto: change channel selection fns to take `HasChanMethod`Steven Engler2026-02-252-13/+15
|
* Merge branch 'chanbuilder-my-addrs' into 'main'David Goulet2026-02-246-26/+41
|\ | | | | | | | | chanmgr: Store our relay addresses in the builder See merge request tpo/core/arti!3716
| * chanmgr: Responder relay channel now use the builder my_addrsDavid Goulet2026-02-246-21/+11
| | | | | | | | | | | | No need to pass from the arti relay binary our addresses when handling an incoming channel, use the one in the channel builder that an initiator channel uses.
| * chanmgr: Store our relay addresses in the builderDavid Goulet2026-02-243-5/+30
| | | | | | | | | | | | | | | | | | | | We need those addresses when we build a relay channel in order to send them into our NETINFO cell. This adds the `with_my_addrs()` on the `ChanMgrConfig` object. Next commit will make arti-relay use it. Signed-off-by: David Goulet <[email protected]>
* | chanmgr: Don't allow to build relay channel to ourselfDavid Goulet2026-02-241-3/+33
|/ | | | | | | | | | 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]>
* chanmgr: Add a set_relay_identities() to update the RelayIdentitiesDavid Goulet2026-02-245-2/+42
| | | | | | | | | | The arti-relay crate rotates the keys at regular interval which we need to give to the ChanMgr to update its builder. This function boldly replace the default factory with the new identities including the TLS acceptor can pick up the new key. Signed-off-by: David Goulet <[email protected]>
* proto: Modify RelayIdentities to have encodable certDavid Goulet2026-02-231-1/+1
| | | | | | | This commit also adds the TlsKeyAndCert to the identities so the TLS acceptor can set it up. Signed-off-by: David Goulet <[email protected]>
* Merge branch 'config-migrate-part1' into 'main'gabi-2502026-02-201-13/+13
|\ | | | | | | | | Port several crates to derive_deftly(TorConfig) See merge request tpo/core/arti!3691
| * chanmgr: migrate to derive_deftly(TorConfig)Nick Mathewson2026-02-171-13/+13
| |
* | proto: Pass PeerAddr at the channel handshake finish for initiatorsDavid Goulet2026-02-191-4/+2
| | | | | | | | | | | | | | | | | | | | 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]>
* | chanmgr: Add a TODO() for logging PeerAddr instaed of ChanTargetDavid Goulet2026-02-191-0/+4
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | chanmgr: Fix channel builder commentDavid Goulet2026-02-191-6/+1
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | proto: Use the PeerAddr accross channel handshakeDavid Goulet2026-02-194-43/+38
| | | | | | | | | | | | | | 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: Remove unused ChannelBuilderDavid Goulet2026-02-191-2/+1
|/ | | | Signed-off-by: David Goulet <[email protected]>
* Merge branch 'mr_3616_rebased' into 'main'Nick Mathewson2026-02-165-17/+502
|\ | | | | | | | | | | | | Mr 3616 rebased Closes #1800 See merge request tpo/core/arti!3681
| * tor-chanmgr: minor chore adjustments for CINihal2026-02-161-4/+5
| |
| * tor-chanmgr: Use url crate userinfo encodingNihal2026-02-161-36/+51
| |
| * tor-chanmgr: use url crate for proxy URIs and error for socks4 passwordsNihal2026-02-161-44/+62
| |
| * tor-chanmgr: allow option_option for outbound proxy deserializerNihal2026-02-161-0/+1
| |
| * tor-chanmgr: fix outbound_proxy deserialization for builderNihal2026-02-161-3/+6
| |
| * tor-chanmgr: fix builder serde attrNihal2026-02-161-1/+1
| |
| * tor-chanmgr: fix proxy config parsing and clippy lintNihal2026-02-162-1/+23
| |
| * deps: add percent_encoding and remove serdeNihal2026-02-161-1/+1
| |
| * tor-chanmgr: improve ProxyProtocol documentationNihal2026-02-161-42/+159
| |
| * tor-chanmgr: remove SocketAddr and improve errorNihal2026-02-162-22/+15
| |
| * tor-chanmgr: add URI-style parsing for ProxyProtocol outbound_proxy configNihal2026-02-163-10/+263
| |
| * tor-chanmgr: integrate outbound proxy into DefaultTransportNihal2026-02-163-15/+41
| |
| * tor-chanmgr: add From<ProxyError> for io::Error conversionNihal2026-02-161-0/+6
| |
| * tor-chanmgr: add ProxyProtocol config type for outbound proxyNihal2026-02-161-0/+30
| |
* | Merge branch 'msrv-1.89' into 'main'Nick Mathewson2026-02-161-0/+1
|\ \ | | | | | | | | | | | | Bump MSRV to 1.89 See merge request tpo/core/arti!3684
| * | 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.
* | Merge branch 'relay-own-cert' into 'main'David Goulet2026-02-161-1/+6
|\ \ | | | | | | | | | | | | 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-121-1/+6
| |/ | | | | | | | | | | | | | | | | | | 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 'chan-target-addr' into 'main'David Goulet2026-02-162-2/+33
|\ \ | |/ |/| | | | | | | | | tor-chanmgr: Add additional `get_or_launch()` tests and update doc comment Closes #2344 See merge request tpo/core/arti!3676
| * tor-chanmgr: add doc comment to `ChanMgr::get_or_launch()`Steven Engler2026-02-121-0/+6
| |
| * tor-chanmgr: add `get_or_launch()` tests using different addrsSteven Engler2026-02-121-2/+27
| | | | | | | | | | When there are two channel requests with the same identities and different socket addresses, we return the same channel.
* | Merge branch 'channel-canonical' into 'main'David Goulet2026-02-124-19/+71
|\ \ | |/ |/| | | | | Implement channel canonicity See merge request tpo/core/arti!3668
| * chan: Use Canonicity when choosing a channelDavid Goulet2026-02-124-3/+49
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
| * chanmgr: Use the actual channel target used on connect()David Goulet2026-02-121-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When connecting, we pass an OwnedChanTarget that can contain a list of IPs of the relay we want to connect to. The connect() picks one and return the actual OwnedChanTarget used as in the real IP address we are using. From that point on, we must only use that as the channel canonicity requires to check against the IP we believe we are connected to. This also is much better to use for error handling considering the error is on the actual channel target, not the hypothetical one. Signed-off-by: David Goulet <[email protected]>
| * proto: Channel finish() now handles canonicityDavid Goulet2026-02-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | All handshake pass the NETINFO cell, the advertised addresses (if any) and the peer address in order to build the Canonicity and build the channel with it. In order to pull this off, the "my_addrs" were added to several object along the NETINFO cell. We also pass the channel method when connecting (initiator) to a relay as we need this for this canonicity build. Signed-off-by: David Goulet <[email protected]>
* | tor-chanmgr: update comment in `open_channel_is_allowed()`Steven Engler2026-02-111-2/+10
| |
* | tor-chanmgr: channel selection functions take a `HasAddrs`Steven Engler2026-02-111-18/+28
| | | | | | | | | | | | | | We will want our channel selection functions (`open_channel_is_allowed`, `pending_channel_maybe_allowed`, and `choose_best_channel`) to inspect the requested target addresses in the future (see their TODOs), so these functions need to take a `HasAddrs` to get those addresses.
* | tor-chanmgr: add `HasAddrs` bound to `AbstractChannelFactory::BuildSpec`Steven Engler2026-02-112-19/+31
|/ | | | | This will be needed later so that our channel selection functions can take a `HasAddrs`.
* proto: Relay responder channel allow to be non_exhaustiveDavid Goulet2026-02-091-1/+0
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Fix the outbound_chan_type() to not be based on relay featureDavid Goulet2026-02-091-10/+4
| | | | | | | A client can have the relay feature enabled. The presence of "identities" is what dictates if we are a relay or not. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Gate relay only functionDavid Goulet2026-02-092-0/+2
| | | | | | | | | Also, allow the `ChanMgr::runtime` to be unused as client don't use it yet but might one day. Simpler this way than feature gating it for relay only. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add inbound open channel to our listDavid Goulet2026-02-092-9/+26
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Build channel/reactor on incoming connectionsDavid Goulet2026-02-091-6/+74
| | | | | | | | Implement the accept_from_transport() in the ChanBuilder. This returns a `Channel` and spawns a reactor. Signed-off-by: David Goulet <[email protected]>