| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |/
|
|
|
|
|
|
|
| |
Introduce those types in order to avoid mixing them up as the previous
AuthLogDigest was just a type alias over [u8; 32]
Fixes #2441
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
| |
This reverts commit 9c38daf2d3548feca2ff555f5bd52165add0d20c.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
We can't pass the request handler during the `Channel` constructor since
it would require conditionally compiled function arguments, which aren't
nice.
|
| |
|
|
| |
for handling CREATE* messages on channels.
|
| |
|
|
|
| |
This better fits with existing code that uses `restricted_msg!` and is a
bit more flexible.
|
| |
|
|
|
| |
When used for relay channels, the channel reactor will soon need to
spawn relay circuit reactors.
|
| | |
|
| |
|
|
| |
And rename `CircMap::add_ent()` to `add_origin_ent()`.
|
| | |
|
| | |
|
| |
|
|
| |
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]>
|
| |
|
|
|
|
|
|
| |
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374476
and
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374478
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
Make read_msg() into a helper and use it accross the handshake code.
No behavior change.
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374466
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
We can remove the "/* take_slog */ true" pattern and instead have an
explicit type at the callsite for semantic.
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374457
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374457
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
| |
Typos found with codespell
|
| |
|
|
|
|
| |
In other words kp_relaysign_ed.
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It used to work for an initiator to set the link protocol once a
VERSIONS is received because initiator send their VERSIONS before. This
failed with responders because a responder channel sends their VERSIONS
after receiving one from the initiator.
This reverse logic means that the channel cell handler was transitionned
to the Handshake state before a responder was able to send a VERSIONS
cell leading to a failure because VERSIONS cell aren't allowed at the
Handshake state.
To fix this, the send/recv or recv/send is now explicit per channel type
and once this is done and successful, the link protocol is set. A
`set_link_protocol()` is added to the ChannelBaseHandshake trait so it
can be used to set the cell handler.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
The initiator and responder are quite different. Building an
AUTHENTICATE cell is delicate and so this change differenticates clearly
between the two.
This allows us to remove the peer_cert_digest from an UnverifiedChannel
which is only something that makes sense for an initiator.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
| |
Both client and relay specialized channel now use it as their inner base
channel so they can use the same common verify() function since it is
the same validation for both.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the last part from check_internal() that is specific to an
initiator channel.
At this commit, all three specialized channel do the verify process
within their own verify() function.
The client and relay initiator both look at the TLS cert (code
duplication unfortunately). And the relay responder looks at the
LINK_AUTH cert extracting the peer KP_link_ed key for validation.
The CERTS cell is removed from UnverifiedChannel as it is now only
useful within the verification process which is now specialized.
A series of TODO(relay) is added to point out the current problem and
how to fix them.
The next step is to create an UnverifiedInitiatorChannel that will hold
the verity_tls_cert() function and peer cert information which is only
relevant to an initiator. This will remove code duplication.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
The responder channel will soon use it.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to pull this off, make
UnverifiedChannel::check_relay_identities() to return a RelayIds that it
builds after checking if they match the peer we were expecting.
This part is moved in this commit so once check_relay_identities()
returns, we are certain of the relay identity validity on both "it
identified properly" and "it is the right expected relay".
This makes it that the check_relay_identities() returns the RelayIds,
the signing key and the RSA id digest (which is needed for
authentication later).
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
This introduces verify_tls_cert() standalone function. It is such
because both client and relay initiator will use it.
For now, the check_internal() has been modified to use it. We are slowly
building towards having specialized check function per channel type.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a loaded commit, apologize in advance but not many way around
this.
One thing that is generic to all verifiable channel (authenticated) is
that they all need to check the relay identities and signing key from
the CERTS cell.
This commits extracts that part into
UnverifiedChannel::check_relay_identities() which returns those said
identities and the signing key (KP_relaysign_ed).
The signing key is actually needed for only one context, the initiator
part because the TLS cert is signed with it. The LINK AUTH cert is
signed by the ed25519 identity key itself which is what the responder
will look for.
This commit has two side effects which I believe are OK:
1. The timeliness check of the identity certs is now done prior to the
other cert (TLS/LINK).
2. We no longer check signatures in batch mode as we can't batch ed25519
sig check with the RSA crosscert sig. It appears the batch validation
was there for performance and not for security purposes.
The end goal of this piece of work is that the specialized channel will
start by calling a generic check function that will call
check_relay_identities(). And then, the secondary certificates will get
checked depending on the side of the channel.
Expect also a variable rename commit at the end as the naming in this
function is really bad.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
Move two inline functions located in UnverifiedChannel::check_internal()
into the UnverifiedChannel object itself.
Laying down the ground work for the more specialized objects to use
those as the check_internal() is about to get massively refactored into
more specific channel types.
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
The responder always sends an AUTH_CHALLENGE cell.
|
| |
|
|
|
|
|
| |
As far as I know, a responder will always send an AUTH_CHALLENGE cell
since it doesn't yet know if the initiator is a client or relay. The
spec also doesn't have any mention about the AUTH_CHALLENGE being
optional. So we should send it in our tests as well.
|
| |
|
|
|
|
| |
Rename them to respectively sensitive() and not_sensitive().
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
This is used when we build an OwnedChanTarget using the builder. Instead
of going identities by identities at the callsite, we can use this
helper to get us a RelayIds builder and set it in the
OwnedChanTargetBuilder.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
To make the code a bit better here. Also, at this commit, the
UnverifiedChannel::finish() and VerifiedChannel::finish() are basically
the exact same.
A refactoring to use a finish() helper would work nicely.
Signed-off-by: David Goulet <[email protected]>
|