aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr
Commit message (Collapse)AuthorAgeFilesLines
...
* proto: Send relay channel NETINFO in check()David Goulet2026-01-221-15/+19
| | | | | | | | | | Once channel is verified and authenticate if need be, send the NETINFO. We require our advertised IP addresses for this so pass them to launch() as well to the UnverifiedRelayChannel. A cargo fmt change slipped in here, sorry about that. Signed-off-by: David Goulet <[email protected]>
* proto: Make VerifiableChannel::check() asyncDavid Goulet2026-01-221-1/+1
| | | | | | | | | Relay initiator needs to send CERTS and AUTHENTICATE in that function after verifiying the channel. And thus require to be async. Signed-off-by: David Goulet <[email protected]>
* relay: Pass advertised addresses to the channel handlerDavid Goulet2026-01-226-12/+23
| | | | | | | | | | | We need the advertised addresses for the NETINFO cell when opening a relay channel. Keep them in the TorRelay object so we can pass them to the ChanMgr channel handler. This will also help with config reload where only the local values in TorRelay will need to be updated. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Spawn task for ChannelProvider impl of get_or_launch()David Goulet2026-01-131-17/+23
| | | | | | | | | | | | | To pull this off, ChannelProvider::get_or_launch() needed to change from "&self" to "self: Arc<Self>" so we could pass self to the spawned task. This is fine as the caller of ChannelProvider (circuit reactor) has a Arc<ChanMgr>. This also removes the PhantomData for the runtime as we now actually use it. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Get rid of the builder outbound_chan_typeDavid Goulet2026-01-133-37/+33
| | | | | | | | | | | | | | | | | | | Instead, we'll simply use `RelayInitiator` if the identity keys (identities) struct is set. This avoids the problem where someone could call outbound_chan_type() of the ChanMgrConfig and get the wrong channel type if with_identities() is set after. This way, a single call, `with_identities()` is what will define the outbound channel type so no chance of errors. This also removes the cfg_if {} around the builder creation in a much more simplified version. Related to #1599 Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add semver.md for breaking changesDavid Goulet2026-01-131-0/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* build: Fixes for non relay featureDavid Goulet2026-01-131-2/+6
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Implement tor_proto::ChannelProvider for ChanMgrDavid Goulet2026-01-131-0/+25
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Use the new tor-proto channel traits in builderDavid Goulet2026-01-131-170/+55
| | | | | | | Remove code duplication and simplifies the code by using the new VerifiableChannel and FinalizableChannel traits. Signed-off-by: David Goulet <[email protected]>
* proto: Add traits for public channel viewsDavid Goulet2026-01-131-1/+1
| | | | | | | | | | | | | | Add traits that will be returned outside tor-proto allowing us to not expose client and relay specific channels. The goal is for the tor-chanmgr to get those objects implementing those traits and can build and run the reactor without knowing the specific underlying type. This allows us to have less code duplication and less client/relay distinction in the chanmgr. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add a relay channel connect to ChanBuilderDavid Goulet2026-01-131-9/+156
| | | | | | | | | | First, this is not great. Lots of duplicated code but it is a starting point that we can build on top to remove code duplication. Future commit will address this but for now, the client and relay mechanics are implemented. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Rename the connect_no_timeout() to be client specificDavid Goulet2026-01-131-6/+8
| | | | | | | | | | | | | | Heavy refactoring coming up for the ChanBuilder. This renames connect_no_timeout() to be client specific and uses the client channel builder directly instead of the generic one. Previous commit added the outbound ChannelType to the ChanBuilder which means that we'll soon have a relay specific function to connect using the relay channel builder. Refactoring will then happen for shared code in those two functions. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add RelayIdentities to ChanBuilderDavid Goulet2026-01-132-5/+29
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add ChannelType to channel manager configDavid Goulet2026-01-134-4/+27
| | | | | | | | | | This allows us to pass it to the ChanBuilder which will be able to use this type for the outbound channels. For now, we do this trick where if we have relay identities, we always consider that all outbound channels will be RelayInitiator. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Introduce a ChanMgrConfig structDavid Goulet2026-01-134-9/+40
| | | | | | | | | | | | This struct is used to pass configuration parameters to the ChanMgr when building it. At the moment, it holds the ChannelConfig and RelayIdentities (feature gated) which will be used in subsequent commits. Note that relays do require RelayIdentities to build channels. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Remove KeyMgr from constructorDavid Goulet2026-01-132-10/+3
| | | | | | | We'll rely on a RelayIdentities to pass in the right keys to the ChanMgr instead of the entire KeyMgr. Signed-off-by: David Goulet <[email protected]>
* cargo: Update `arti-*` and `tor-*` to `0.38.0`Clara Engler2026-01-121-20/+20
| | | | | | | | | Done using the following: ```bash for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.38.0 done ```
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-041-2/+0
| | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* Remove semver.md files post-releaseGabriela Moldovan2025-12-021-1/+0
|
* Bump all the unstable tor- and arti- crates to 0.37.0.Gabriela Moldovan2025-12-021-20/+20
| | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.37.0 done
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-244-1/+11
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* Merge branch 'relay-bin-4' into 'main'opara2025-11-117-11/+24
|\ | | | | | | | | arti-relay: Add OR port listener task See merge request tpo/core/arti!3396
| * tor-chanmgr: wrap the peer address in `Sensitive`Steven Engler2025-11-057-11/+24
| | | | | | | | | | For incoming connections, wrap the peer address in `Sensitive` as it could be a client.
* | Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-0610-10/+10
|/ | | | Run maint/add_warning
* all: run cargo fmtSteven Engler2025-11-041-1/+1
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-042-2/+2
|
* maint: bump minor versions of all published cratesSteven Engler2025-10-291-23/+23
| | | | | | | ```bash readarray -t publish < <(cargo metadata --format-version 1 | jq -r '.packages[] | select((.id | startswith("path+file:///")) and (.rust_version != null) and (.publish == null or .publish == true or .publish != [])) | .name') for package in "${publish[@]}"; do echo "$package:"; cargo set-version --bump minor -p "$package"; done ```
* Bump MSRV from 1.85.1 to 1.86Clara Engler2025-10-211-1/+1
|
* Use random_hostname() to pick an (E)SNINeel Chauhan2025-10-201-2/+4
| | | | | | Closes #2210. Edited-by: Nick Mathewson <[email protected]>
* Merge branch 'chan_padder' into 'main'Nick Mathewson2025-10-061-7/+37
|\ | | | | | | | | Apply maybenot padding to channels See merge request tpo/core/arti!3314
| * proto: Propagate PaddingCtrl into ChannelSender.Nick Mathewson2025-10-011-7/+37
| | | | | | | | We'll need it to tell the channel padder when padding is queued.
* | release: Bump versions.Wesley Aptekar-Cassels2025-10-021-23/+23
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we've updated our MSRV, we must bump the minor version for every package. This was done as follows: cargo set-version -p arti 1.6.0 cargo set-version -p oneshot-fused-workaround 0.4.0 cargo set-version -p slotmap-careful 0.4.0 cargo set-version -p test-temp-dir 0.5.0 cargo set-version -p fslock-guard 0.4.0 cargo set-version -p hashx 0.5.0 cargo set-version -p equix 0.4.0 cargo set-version -p caret 0.7.0 cargo set-version -p fs-mistrust 0.12.0 cargo set-version -p safelog 0.6.0 cargo set-version -p retry-error 0.8.0 xargs -I P <<END cargo set-version -p P 0.35.0 tor-basic-utils tor-error tor-general-addr tor-geoip tor-rtcompat tor-rtmock tor-async-utils tor-config tor-config-path tor-rpc-connect tor-log-ratelim tor-rpcbase tor-memquota tor-units tor-llcrypto tor-bytes tor-protover tor-checkable tor-cert tor-key-forge tor-hscrypto tor-socksproto tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-persist tor-keymgr tor-chanmgr tor-ptmgr tor-dircommon tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-dirserver tor-hsclient tor-hsservice tor-hsrproxy tor-relay-crypto arti-client arti-relay arti-rpcserver arti-ureq arti-rpc-client-core END
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* opentelemetry: Add some instrument macros.Wesley Aptekar-Cassels2025-09-244-2/+15
| | | | | I've added these in places that are useful for the debugging that I've been doing.
* Bump MSRV from 1.85 to 1.85.1Nick Mathewson2025-09-091-1/+1
| | | | Closes #2107
* Bump the minor version of every published crate except for `arti`.Nick Mathewson2025-08-281-23/+23
| | | | | | | | Per policy, we bump the minor version of every tor-*, arti-* crate on each release. We have updated our MSRV, so we're treating this as a breaking change for our non-(arti/tor)-prefixed crates too.
* proto: Add ChannelType enumDavid Goulet2025-08-201-1/+1
| | | | | | | | | | | | | | | | The ChannelType indicates the type of channel in order to dictate which message is allowed on it. The value use the Initiator and Responder terminology from tor-spec documents. At this commit, we only have client channel meaning the "ClientInitiator" type. In future commits, the channel type will be used by the channel reactor to restrict which message is allowed or not. Part of #1597 Signed-off-by: David Goulet <[email protected]>
* chan: Rename channel launch to launch_clientDavid Goulet2025-08-201-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add KeyMgr to channel builderDavid Goulet2025-08-203-4/+16
| | | | | | | This is so a relay can build authenticated channels. Several keys/cert are required for this that are within the key manager. Signed-off-by: David Goulet <[email protected]>
* clippy: fix `clippy::duplicated_attributes` warningsSteven Engler2025-08-111-1/+1
| | | | | | | | | | ```text warning: duplicated attribute --> crates/tor-hsservice/src/timeout_track.rs:630:14 | 630 | #![allow(clippy::needless_pass_by_value)] // TODO hoist into standard lint block | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ```
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0712-39/+40
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Update code for Edition 2024Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* Bump to hex-literal 1.0Nick Mathewson2025-08-051-1/+1
| | | | | (We were unable to do this before, since it required a rust version we didn't have.)
* Set MSRV to 1.85.Nick Mathewson2025-08-051-1/+1
|
* Bump version of tor-basic-utilsIan Jackson2025-08-051-1/+1
| | | | This was accidentally omitted from my version bump script.
* Version bumps for 1.4.6Ian Jackson2025-08-051-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made with the following shell script: export CARGO='nailing-cargo -Eu' # Non-functional changes only maint/bump_nodep hashx # Special $CARGO set-version -p arti 1.4.6 # Additional features, no breaking changes, depended on in tree $CARGO set-version -p safelog 0.4.8 # Unconditional bump to 0.33.0 xargs -I P <<END $CARGO set-version -p P 0.33.0 tor-error tor-general-addr tor-geoip tor-rtcompat tor-rtmock tor-async-utils tor-config tor-config-path tor-rpc-connect tor-log-ratelim tor-rpcbase tor-memquota tor-units tor-llcrypto tor-bytes tor-protover tor-checkable tor-cert tor-key-forge tor-hscrypto tor-socksproto tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy tor-relay-crypto arti-client arti-relay arti-rpcserver arti-ureq arti-rpc-client-core END
* Add a missing backtick.Nick Mathewson2025-07-091-1/+1
|
* Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-091-1/+1
| | | | Made with https://crates.io/crates/typos-cli
* Bump all the unstable tor- and arti- crates to 0.32.0.Gabriela Moldovan2025-07-071-19/+19
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.32.0 done ```
* Bump the versions of the non-{arti-,tor-} crates.Gabriela Moldovan2025-07-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ``` We split them in the following categories: * crates with no changes (no version bumps): None ``` maint/changed_crates -v "arti-v$LAST_VERSION" 2>&1 >/dev/null | grep -i "no change" | grep -v '\(tor\|arti\)-' ``` * crates that only have non-functional changes (bump the patch version): - oneshot-fused-workaround - slotmap-careful - test-temp-dir - fslock-guard - hashx - equix - caret - safelog - retry-error * crates where APIs were broken (bump minor): - fs-mistrust (the implicit once_cell feature was removed) The bumps from this commit were created using this script: ``` PATCH=" oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret safelog retry-error " for crate in $PATCH; do cargo set-version --bump patch -p $crate; done MINOR=" fs-mistrust " for crate in $MINOR; do cargo set-version --bump minor -p $crate; done ```