| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| |\ \
| |/
|/|
| |
| |
| |
| | |
proto: Pass *all* cells to handle_forward_cell()
Closes #2339
See merge request tpo/core/arti!3674
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 04ab3cd848d7977baf58dd64ebfcad6aa54ecb17.
Reverted because we no longer need to "peek" into the opaque
`CircChanMsg` of a circuit reactor: now the implementation-dependent
part of the reactor is in charge of handling the channel messages,
and extracting `Relay` objects out of RELAY/RELAY_EARLY cells,
which then get processed in the base reactor.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This doesn't need to be part of the `ForwardHandler` trait anymore,
because the base reactor no longer calls it directly (instead
implementations are supposed to handle it internally).
No functional changes here, just code motion.
|
| | |
| |
| |
| | |
Closes #2339
|
| | | |
|
| | |
| |
| |
| |
| | |
Needed because some messages are handled differently depending on the
cell type they originated from (RELAY vs RELAY_EARLY).
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This pushes the RELAY/REALY_EARLY handling inside
`handle_forward_cell()`, which now decodes the relay cells and
* handles them internally, if they are unrecognized
(`handle_unrecognized_cell()`), or
* returns them back to the base reactor if they are recognized
(RELAY and RELAY_EARLY cells are handled the same way by the
base reactor)
|
| | |
| |
| |
| |
| | |
Soon this function will be in charge of decoding the cell too, so it
will need a handle to the `HopMgr` (see `decode_relay_cell()`)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, the implementation-dependent `handle_forward_cell()` handled
all forward cells *except* for RELAY cells, which were handled in the
generic base reactor.
This changes the implementation to pass *all* cells, including RELAY
cells, to `handle_forward_cell()` too. This is needed because both
RELAY and RELAY_EARLY cells need to be handled very similarly: both
can be either recognized or unrecognized, with unrecognized cells
being handled by the implementation-dependent code, and the recognized
ones being sent to the base reactor for handling.
A future commit will update `handle_forward_cell()` to extract `Relay`
object out of RELAY/RELAY_EARLY cells, and return it back to the base
reactor for handling.
|
| |\ \
| |/
|/|
| |
| | |
Implement channel canonicity
See merge request tpo/core/arti!3668
|
| | |
| |
| |
| | |
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
During the channel handshake, we require the peer IP address for the
canonicity check which requires the exact peer IP we are connected to.
This commit adds a function that enforces this requirement on a
ChannelMethod so anything else results in an error.
It is to basically have stronger guarantee on the channel method we use
in the handshake.
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This struct will be put in a Channel and derived from the received
NETINFO cell.
This follows the C-tor implementation for which we have two indicator of
canonicity:
1. Peer is canonical: the address they advertise in the NETINFO cell
matches the one we see on the TCP connection.
2. Canonical to peer: the peer sees us as canonical.
Those flag will get used to select "the best" channel.
Signed-off-by: David Goulet <[email protected]>
|
| |/
|
|
|
|
|
|
| |
This is not yet implemented, so we should just return an error for now
(`todo!()` will cause a panic, shutting down the thread the reactor is
running on. We don't want this happening when we start manually testing
our WIP impl, because depending on which thread it happens on, it can
make the entire relay process unusable).
|
| | |
|
| |
|
|
| |
Closes #2345
|
| | |
|
| |
|
|
| |
This will tell the base `BackwardReactor` how to handle the cell.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
| |
This type is needed in the tor-chanmgr crate in order to decide to
verify or not the underlying relay channel.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This requires the `TlsKeyAndCert` so be passed on the TLS acceptor
settings. We assume that `RelayIdentities` has this information.
The ChanBuilder::new() was getting a bit too convoluted and feature
gated to instead we introduce new_client() and new_relay() and remove
the need for `with_identities()`.
Because of this, the ChanMgr::new() now returns a `Result<>`.
Related to #1597
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
|
| |
See discussion at
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3648#note_3339863
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Implements this part of the spec:
```
To tear down a circuit completely, a relay or client sends a DESTROY
cell to the adjacent nodes on that circuit, using the appropriate
direction’s circID.
```
|
| |
|
|
|
| |
This doesn't need to be async, as it delegates the handling to a
background task.
|
| |
|
|
|
|
|
|
| |
To handle EXTEND2, the relay `ForwardHandler` impl spawns a background
task, which reports back the result via the `CircEvent` MPSC stream.
This stream is polled from the `ForwardReactor` main loop, and each
`CircEvent` is passed back to `ForwardHandler::handle_event()` for
handling.
|
| |
|
|
| |
These will be used by the relay code too (for circuit extension).
|
| |
|
|
| |
Users reading the log won't necessarily know what a "forward channel" is.
|
| | |
|
| | |
|
| |
|
|
|
| |
This will enable us to obtain implementation-dependent asynchronous
events (such as the outcome of an extend handshake).
|
| |
|
|
|
|
| |
This will be needed by relays, for wrapping tor_linkspec decode errors
(which can happen if the link specifiers in the EXTEND2 cell can't be
converted to a channel target).
|
| |
|
|
| |
To match the `ChannelProvider::get_or_launch()` function signature.
|
| |
|
|
|
|
| |
We need the unique_id here, because the Forward handler will soon start
using the `ChannelProvider::get_or_launch()` to launch outbound
channels, which takes the reactor unique_id as an argument.
|
| |
|
|
|
|
| |
The channel provider is relay-specific, so I am moving it to the relay
`ForwardHandler` implementation. This enables us to get rid of some of
the feature gating from the generic reactor.
|
| |
|
|
| |
This is currently very similar to its client counterpart.
|
| |
|
|
| |
We will need the ability to build one from within tor-proto.
|
| |
|
|
| |
This was leftover from back when this command was only for Sendmes.
|
| |
|
|
| |
This just removes an unnecessary `async`.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
Remove the use of traits, the caller will handle the specific type.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
No need for these types, we've replaced them with more specific types.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
Add the unverified, verified, non verifiable flavor types of a responder
channel.
This follow on the previous commit to use the type system for stronger
guarantees.
Signed-off-by: David Goulet <[email protected]>
|