| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
| |
The backward reactor will soon need the ability to send other types of
relay messages too: it will soon need the ability to respond to EXTEND2
by sending back an EXTENDED2, so I am preemptively making this function
more general so we can reuse it.
|
| | |
|
| |
|
|
| |
Since we removes a existing feature, we need to bump the version.
|
| |
|
|
|
|
|
|
|
|
| |
Done via:
```
for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do
cargo set-version -p $crate 0.39.0
done
```
|
| |
|
|
| |
This will need to become async soon.
|
| |
|
|
| |
Fixes a clippy warning
|
| | |
|
| |
|
|
|
|
|
| |
In the backward reactor, we call this the `forward_reactor_rx` (because
it receives commands from the foward reactor), and in the forward
reactor we call it `backward_reactor_tx` (because it sends commands to
the backward reactor).
|
| |
|
|
|
|
|
|
|
|
| |
We settled on
* `inbound_chan{tx, rx}`, for the inbound channel (the channel towards
the guard, if we are a client, or towards the client if we are a
relay)
* `outbound_chan{tx, rx}`, for the outbound channel (the channel
towards the exit, if we are a middle relay)
|
| | |
|
| |
|
|
|
| |
This will change significantly in the near future, or disappear
entirely.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
This is just because the generic reactor will soon need a clone of the
CC object, so I am preemptively making this function return a ref to the
underlying `Arc` instead. Technically, it would've been fine to just
kept this method and add a separate one returning `&Arc<Mutex<..>>`,
but I'd prefer keeping the API small.
|
| |
|
|
|
| |
This renaming is needed because I will soon introduce a new `Forward`
struct, with a completely different purpose.
|
| |
|
|
|
|
| |
Soon it won't need be needed here any more. I'm removing it, because
having redundant handles to the CC state makes it difficult to see
exactly where it's being used from.
|
| |
|
|
| |
This is not just for clients!
|
| |
|
|
| |
Currently empty, will be fleshed out in a future commit.
|
| |
|
|
| |
I am about to use this in other places too.
|
| | |
|
| |
|
|
| |
Relays will need to use it too.
|
| |
|
|
|
|
|
|
|
| |
This will be used in a future commit, inside the new generic circuit
reactor.
We need it because RELAY cells are handled very similarly, so we need
some way of finding out if a given generic chancell is actually a RELAY
cell that we can handle in an implementation-agnostic way.
|
| |
|
|
|
| |
This will be used in the stream reactor too (and the stream reactor will
eventually replace the corresponding client impl).
|
| |\
| |
| |
| |
| |
| |
| | |
maint/add_warning: Deny clippy::unused_async
Closes #2328
See merge request tpo/core/arti!3613
|
| | | |
|
| | |
| |
| |
| | |
This code is still WIP, so I propose we ignore the lint for now.
|
| | |
| |
| |
| |
| | |
This resolves a warning triggered by the newly-introduced
`#[deny(clippy::unused_async)]`.
|
| | |
| |
| |
| | |
This adds the lint to all our crates.
|
| |\ \
| |/
|/|
| |
| | |
clippy: Fix missing doc for non-Linux builds
See merge request tpo/core/arti!3611
|
| | | |
|
| |\ \
| |/
|/|
| |
| |
| |
| | |
arti: Downgrade "stream closed without END" warning to debug.
Closes #2304
See merge request tpo/core/arti!3608
|
| | |
| |
| | |
Co-authored-by: carti-it <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As near as I can tell, there are only three ways that the sender
corresponding to this rx can be dropped:
- `StreamMap::terminate` because the stream object itself was
dropped. (But see #2323.)
- `StreamMap::close_stream` because an END message or similar
has been received. (But see #2322.)
- The `StreamMap` has been dropped.
The first two cases are already handled, and AFAICT the third can
only happen when the circuit hop closes. That makes
`CircuitClosed` the appropriate error here, not `StreamProto`.
Part of a fix for #2304.
|
| | |
| |
| |
| | |
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This commits returns either Some(AUTH_CELL, CERTS) or None. We future
proof ourselves against one Some and other None even if an error check
is done before.
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the channel type from Unverified and Verified channels and
instead use the channel type in the underlying channel codec.
The codec requires such type in order to restrict messages sets. Instead
of duplicating it, this commit simply makes it that there is now only a
single channel type attached to a channel structure.
The resulting `struct Channel` in the end gets it copied from the
channel codec as the framed_tls gets split and given to the `Reactor`.
Down the line, we need a channel type attached to the `Channel` in order
to know if it is a client or not and authenticated or not.
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| |
| |
| | |
Avoid having one None and the other Some which would be a bug.
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
Instead, use the static AUTHTYPE_ED25519_SHA256_RFC5705 value which is
for now the only version we support.
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
A Responder receiving cells from the Initiator, if it gets a CERTS, an
AUTHENTICATE must also be present (and vice-versa).
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is so check() only authenticate a channel. The finish() function
now only sends back the missing cells and build the final Channel.
To pull this off, the AUTHENTICATE cell and our IP addresses need to be
copied into the VerifiedRelayChannel.
This allows us to remove complexity into the check() function as well
and future commit will remove the async.
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We can't get into the UnverifiedChannel::check() without wanting to
verify our identities and authenticate.
This validation has moved before calling check() for the relay channel
type.
Signed-off-by: David Goulet <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reason for this is so we can use the type system to enforce that a
client/bridge<-> relay channel can never become verified and thus in the
code path of authentication.
In other words, when check() is called, without an authentication cell,
we can't authenticate or even verify the identities so we immediately
return "self" which in this case is the UnverifiedRelayChannel.
That channel can be finish()-ed to yield a Channel that can never be
considered authenticated.
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit is a bit loaded but it is coherent.
First, we set Eq and PartialEq to the channel message Authenticate so we
can compare it with the one we expected.
Second, the AuthenticationCell enum is introduced to store either an
AUTH_CHALLENGE or an AUTHENTICATE since one side of the handshake can
only have one. This allows us to store one or the other in
UnverifiedRelayChannel.
Depending on what we have, the authentication process is different as it
dictates which side we are on (initiator vs responder). Keep in mind
that the handshake code enforces receiving a AUTH_CHALLENGE along side
CERTS. And same goes for AUTHENTICATE which means that if we have an
AUTH_CHALLENGE in the UnverifiedRelayChannel, it is certain that the
other side wants to authenticate and we are the initiator.
Finally, the sending of CERTS and AUTHENTICATE by the initiator is now
in UnverifiedRelayChannel::check() done right after verifying the
channel CERTS and holding a "VerifiedChannel" object.
This means that the last piece, sending the `NETINFO` by the initiator
will be done in the check() but in a future commit. This leaves the
VerifiableChannel::finish() to send nothing and only finalize the
channel with the NETINFO (canonicity).
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]>
|