| 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.
|
| |
|
|
|
|
| |
Also set a better error message when validating channel target.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
| |
It used to be only with the feature = relay but since client can have
that feature enabled, we now validate based on channel outbound type
instead.
Related to #2440
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
| |
Mostly, identity a `ChanTarget` as a "target" since we juggle with
PeerInfo and OwnedChanTarget nowadays.
All certificate and keys have very specific names which attempts to
match the spec as much as possible.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This moves the client channel building code into build_client_channel()
to match the build_relay_channel() function pattern.
No behavior change, just code movement. Small changes were needeed
(reference for instance) but no behavior change.
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374448
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure the port is non zero and that all addresses are globally
reachable.
Notice the use of ChanProto error in this commit instead of
UnusableTarget. Relay channel initiator are opened by the circuit
reactor meaning from an EXTEND2 request meaning the target is not
controlled by us so any errors is a channel protocol violation.
UnusableTarget is an internat Bug.
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374447
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
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]>
|