| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change prevents the channel reactor from sending DESTROY cells on
already-closed (or non-existent) circuits. Upon receiving a DESTROY
cell, the channel reactor removes the corresponding circuit entry, if
any, from its circmap. It then passes the DESTROY to the circuit reactor
for handling. The circuit reactor handles it by shutting down, and
calling `Channel::close_circuit()` on drop. Previously, this would
unconditionally send a DESTROY cell, which caused #2648 and #2646.
This affects both clients and relays, because both circuit reactors call
`Channel::close_circuit()` on drop.
Closes #2648, #2646
|
| |\
| |
| |
| |
| |
| |
| | |
proto: Silently drop DESTROY/RELAY/CREATED cells on unknown circuits
Closes #2655
See merge request tpo/core/arti!4301
|
| | |
| |
| |
| | |
And say why it's okay to do so.
|
| | |
| |
| |
| |
| | |
These are no longer causing the channel reactor to shut down, so we need
to update this test accordingly.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If we're a relay, we need to tolerate CREATED* with unrecognized
CircIds: for example, if we time out[^1] while trying to extend the circuit
by another hop, we will send a DESTROY to the extending hop, which can
race with the CREATED* response. In other words, a CREATED* cell
arriving on a closed circuit shouldn't be treated as a protocol
violation.
There are, however, a few cases where a CREATED* with an unknown CircId
*is* a protocol violation (and probably *should* cause us to close down
the channel):
* if the CREATED* is moving in the forward direction (towards the
exit), or
* if we have not previously sent a CREATE* with that particular CircId
As before, distinguishing these from the "closed circuit" case above
would involve some tricky logic, and the benefits are unclear, while the
downsides of closing a channel when we shouldn't have are significant.
It seems better to just drop these cells for now.
Closes #2655
[^1]: at the time of writing, we don't have timeouts for the circuit
extension logic, so what I've described here cannot actually happen
today. However, we *do* have a TODO for it, so the time outs I've
described here will be implemented at some point
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An unrecognized circuit ID is not always a protocol violation, so we
shouldn't close down the channel if it happens.
This change makes the channel reactor drop DESTROY and RELAY cells with
unknown CircIds without closing down the channel. It affects both
clients and relays.
Instead of dropping these unconditionally, we could have implemented
some more sophisticated checks to distinguish the bogus CircIds from the
CircIds of closed circuits, but it's unclear if it's worth the added
complexity (see discussion in #2655).
This partly addresses #2646 (an unrecognized circuit ID shouldn't cause
us to close down the channel if we're a relay).
This commit partially undoes the changes from
4f567e4a9432b340c2799e600c8ceb3724ad3082,
which was originally intended to mitigate flooding attacks.
Part of #2655
|
| |/ |
|
| |
|
|
|
| |
I think this might have been c&p from the half-stream code ("hs" =
"half-stream"). "hc" ("half-circuit") seems like a better name.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
The new relay circuit reactor test expect the `PeerInfo` to be populated
with the identity keys of the peer, and won't work without this change.
|
| |
|
|
| |
This will be needed for ntor handshakes.
|
| | |
|
| | |
|
| |
|
|
| |
This will be needed for ntor handshakes.
|
| |
|
|
|
| |
Clippy has started warning about this since we moved the CREATE_FAST
handling to a helper, so this resolves that.
|
| |
|
|
| |
This reverts commit 9c38daf2d3548feca2ff555f5bd52165add0d20c.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
We can't pass the request handler during the `Channel` constructor since
it would require conditionally compiled function arguments, which aren't
nice.
|
| |
|
|
| |
for handling CREATE* messages on channels.
|
| |
|
|
|
| |
This better fits with existing code that uses `restricted_msg!` and is a
bit more flexible.
|
| |
|
|
|
| |
When used for relay channels, the channel reactor will soon need to
spawn relay circuit reactors.
|
| | |
|
| |
|
|
| |
And rename `CircMap::add_ent()` to `add_origin_ent()`.
|
| |
|
|
|
|
| |
Rename them to respectively sensitive() and not_sensitive().
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
Every specific types know if the peer is sensitive or not so now the
finish() of each of these channel types builds the right PeerInfo with
MaybeSensitive.
This is passed on the Channel so from that point on, the Channel will
never leak peer data in the logs.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |\
| |
| |
| |
| |
| |
| | |
maint/add_warning: Deny clippy::unused_async
Closes #2328
See merge request tpo/core/arti!3613
|
| | | |
|
| | |
| |
| |
| |
| | |
This resolves a warning triggered by the newly-introduced
`#[deny(clippy::unused_async)]`.
|
| |/ |
|
| |
|
|
|
|
| |
Move the client specific unit tests into the client module.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit removes the CircuitRx* based solely on the client circuit
message and moves it into the top level of the crate so all reactors can
use them.
The client reactor then upon receiving the message, it converts the
AnyChanMsg into a ClientCircChanMsg. On error, this leads to a shutdown
of the entire reactor due to a fatal error.
In order to pull this off, we added a CircuitAction::Shutdown that is
handled as a priority.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
| |
Next commit will also move the Relay specific set into the relay module.
These two sets are becoming specific to the reactor as the circuit
reactor communication channel will use AnyChanMsg instead.
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.
|
| | |
|
| | |
|
| |
|
|
|
| |
Some of these are relay-specific, so it makes more sense to pull this
into a top-level module.
|
| | |
|
| |
|
|
| |
With this commit we now actually generate padding when we're told to.
|
| | |
|
| | |
|