| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
(We don't need as many of these to be public as I had originally
thought.)
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
All the tests still pass!
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
There are two levels here. At the lower level, the caller is
responsible for providing their own select/poll wrapper. At the
higher level, we use mio to provide our own.
Before the end of this branch, this new module will replace llconn.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This will be necessary since, in order to make the RPC stuff
nonblocking, we'll need a better API than just `Box<dyn Read>` etc.
|
| |\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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]>
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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]>
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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]>
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
proto: Return internal error on TRUNCATE
See merge request tpo/core/arti!3675
|
| | |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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).
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| |/ / / /
| | | |
| | | |
| | | |
| | | | |
This will be needed later so that our channel selection functions can
take a `HasAddrs`.
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
proto: Handle backward cells in the reactor
Closes #2345
See merge request tpo/core/arti!3666
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Closes #2345
|
| | | | | | |
|
| | | |/ /
| |/| |
| | | |
| | | | |
This will tell the base `BackwardReactor` how to handle the cell.
|
| | | | | |
|
| |/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
Without this change `arti` fails to compile with the `onion-service-cli`
and `onion-service-service` features enabled.
Closes #2347
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
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]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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]>
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Implement the accept_from_transport() in the ChanBuilder.
This returns a `Channel` and spawns a reactor.
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]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This makes it that we can get a server TLS acceptor provider which we
need for incoming connections.
Signed-off-by: David Goulet <[email protected]>
|
| |\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Set package.metadata.docs.rs.all-features to true for all crates
Closes #2307
See merge request tpo/core/arti!3656
|
| | | | |
| | | |
| | | |
| | | | |
Makes docs.rs also document types behind optional feature flags.
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
proto: Start handling EXTEND2 in the relay reactor
Closes #1447
See merge request tpo/core/arti!3648
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
See discussion at
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3648#note_3339863
|