| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
| |
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]>
|
| |\
| |
| |
| |
| |
| |
| | |
tor-chanmgr: Add additional `get_or_launch()` tests and update doc comment
Closes #2344
See merge request tpo/core/arti!3676
|
| | |
| |
| |
| |
| | |
When there are two channel requests with the same identities and
different socket addresses, we return the same channel.
|
| |\ \
| |/
|/|
| |
| | |
Implement channel canonicity
See merge request tpo/core/arti!3668
|
| | |
| |
| |
| | |
Signed-off-by: David Goulet <[email protected]>
|
| |/
|
|
|
| |
This will be needed later so that our channel selection functions can
take a `HasAddrs`.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
| |
These are all aimed at figuring out in more detail what's going on
in #2079 and related issues.
|
| |\
| |
| |
| |
| | |
arti-relay: Add OR port listener task
See merge request tpo/core/arti!3396
|
| | |
| |
| |
| |
| | |
For incoming connections, wrap the peer address in `Sensitive` as it
could be a client.
|
| |/
|
|
| |
Run maint/add_warning
|
| |
|
|
|
| |
I've added these in places that are useful for the debugging that I've
been doing.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Needed for the chanmgr to be able to update existing channels with new
KIST settings read from the consensus.
|
| |
|
|
| |
This shouldn't be needed anymore now that we use a `Defer`.
|
| | |
|
| |
|
|
|
|
| |
These were supposed to fail loudly in debug builds by panicking, but
panics are mostly useless for debugging in async applications that use a
runtime which catches panics. So we'll just log the error instead.
|
| |
|
|
| |
`upgrade_pending_channel_to_open`
|
| |
|
|
|
|
|
|
|
|
| |
An attempt to make sure that there are no code paths which forget to
remove a pending channel from the channel map.
This also adds error-level log messages and panics during debug builds
if a `PendingChannelHandle` is dropped without properly passing it to
`MgrState::remove_pending_channel` or
`MgrState::replace_pending_channel`.
|
| |
|
|
|
|
|
|
| |
This reverts commit f85bc3cf849109aaa2c4da9fc8c06e7173a0543f.
There were some small conflcits in
`AbstractChanMgr::get_or_launch_internal`, so this wasn't a clean
revert.
|
| | |
|
| | |
|
| |
|
|
|
| |
This handle contains all of the details required to remove or replace a
pending channel entry from the channel map.
|
| |
|
|
|
|
| |
These methods on `MgrState` acquire a lock, and it's easy for calling
code to also try to acquire the same lock within the closure, causing a
deadlock. It's better to not expose these methods.
|
| | |
|
| |
|
|
|
|
|
|
| |
This moves most of the channel map logic from
`AbstractChanMgr::choose_action` to `MgrState::request_channel`.
This is working towards being able to remove
`MgrState::with_channels{,_and_params}`.
|
| |
|
|
| |
Fixes a TODO.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This gets it as far as the outbound circuit->channel mpsc queue creation.
Also, we provide an accessor for it.
|
| |
|
|
|
| |
This delivers a fresh account per channel to the places where channels
are actually made, but doesn't pass them to tor-proto yet.
|