| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
| |
No initiator present a TLS certificate and so don't try to get one.
Fixes #2388
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
Rename them to respectively sensitive() and not_sensitive().
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
On I/O error, we safely log the peer address that was used that lead to
this error.
Closes #2375
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
Only the R2R channel that the PeerAddr becomes unsensitive. The rest, we
keep it sensitive as it can be a client or a client's guard/bridge.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
It was _target before because we had it in the function with a
cfg_if!(). Now don't so no need.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |\
| |
| |
| |
| | |
chanmgr: Store our relay addresses in the builder
See merge request tpo/core/arti!3716
|
| | |
| |
| |
| |
| |
| | |
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 validate_relay_target() is meant to probably have more checks in the
future hence the vagueness of it instead of being specific to the goal
of this patch.
Closes #1699
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]>
|
| |
|
|
|
|
|
| |
This commit also adds the TlsKeyAndCert to the identities so the TLS
acceptor can set it up.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
Responder relay handshake requires the peer address at the very start as
it sends its NETINFO right away.
For initiators, we only need it during the finalization process which is
when the NETINFO is sent and the Channel is created.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
This is a large change but it is basically using PeerAddr in the channel
builder through the channel handshake code and into the Channel itself.
Signed-off-by: David Goulet <[email protected]>
|
| |\
| |
| |
| |
| |
| |
| | |
Mr 3616 rebased
Closes #1800
See merge request tpo/core/arti!3681
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
| |
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]>
|
| |
|
|
| |
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]>
|
| |
|
|
|
|
|
|
| |
Implement the accept_from_transport() in the ChanBuilder.
This returns a `Channel` and spawns a reactor.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
With specific types now for relay channels, add a function to build the
channel and run the reactor.
That function is feature gated and thus relay only.
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
| |
Remove code duplication and simplifies the code by using the new
VerifiableChannel and FinalizableChannel traits.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
| |
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]>
|
| |
|
|
|
|
|
| |
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]>
|
| |\
| |
| |
| |
| | |
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
|
| | |
|
| |
|
|
|
|
| |
Closes #2210.
Edited-by: Nick Mathewson <[email protected]>
|
| |
|
|
|
| |
I've added these in places that are useful for the debugging that I've
been doing.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|