| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
`/channel/handler.rs`
Closes #1690.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
From opara's comment:
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3844#note_3388789
Keep the low level AuthLogDigest type alias and return it. The callsite
is the one deciding if the returned digest is a Clog or a Slog.
Related to #2441
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
| |
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374457
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Typos found with codespell
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
| |
Due to this, it is not possible to get a VPADDING before because it
requires a link protocol version to decideon the encoding:
https://gitlab.torproject.org/tpo/core/torspec/-/issues/366
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The AUTHORIZE cell command is simply reserved but not defined. The tor
specification, at this point in time, is allowing such cell before the
handshake starts but it is very unclear on what ordering is allowed nor
how many can are allowed.
C-tor silents drop them like VPADDING and so clearly unused. Instead of
dealing with it, simply remove its support but keeping its reserved
number.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
| |
When starting a handshake, we were only expecting a VERSIONS which is
not what the protocol say. An AUTHORIZE and VPADDING can arrive before a
VERSIONS.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the ChannelFrame<> for the entirety of the outbound client handshake
that is the ClientInitiator channel type.
With this change, the codec.rs code is not needed anymore along its
CodecError as well which has been normalized onto the crate::Error
instead in order to simplify error handling and avoid duplication of
error types.
Unit tests have been modified to reflect this change of what can be done
with a channel frame. Also renamed to focus on client behavior.
Part of #1597
Signed-off-by: David Goulet <[email protected]>
|
|
|
The handler.rs file contains a generic "ChannelCellHandler" which is
split into three different handler depending of the channel state (new,
handshaking or open).
These handlers implement Encoder/Decoder so we can give a
ChannelCellHandler to a asynchronous_codec::Framed along a TLS stream.
That cell handler is also in charge of tracking the CLOG/SLOG (see
tor-spec), running digest of cells seen, which is used to authenticate a
channel for the Relay <-> Relay case.
This ChannelCellHandler auto transitions as the setters function are
used. The handshake code will use this to advance the handler. Each
handler uses a MessageFilter from msg.rs in order to allow or not to
return the message.
A keen eye will notice that we can avoid encoding a message if we don't
need but we will decode all possible messages and only then allow it or
not.
The channel cell handler is not used at this commit.
Part of #1597
Signed-off-by: David Goulet <[email protected]>
|