| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
To avoid copying the same information for every circuit,
as suggested by @opara in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3906#note_3399497
|
| |
|
|
|
| |
It doesn't make sense to do so, as pointed out by @opara in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3906#note_3398956
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3906#note_3397922
|
| | |
|
| |
|
|
|
|
|
| |
The relay reactor will now reject any EXTEND2 that tries to extend the
circuit to a hop that shares any identities with our previous hop.
Closes #2415
|
| |
|
|
|
| |
This will soon be used for preventing the circuit from being extended to
the previous hop (#2415).
|
| | |
|
| |
|
|
|
|
|
|
|
| |
The EXTEND2 handling logic is fairly self-contained, so I'm moving it
outside of the `Forward` handler. This refactoring enables us to add
more context to the handler (i.e. the inbound channel identities needed
for #2415) without cluttering the `Forward` implementation.
I recommend reviewing this commit with `git diff --color-moved`.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |\
| |
| |
| |
| | |
proto: Remove dummy suffixes from variable name
See merge request tpo/core/arti!3903
|
| | |
| |
| |
| |
| |
| |
| |
| | |
I used these `_foo` suffixes to make sense of things during development:
at the time, I had multiple "forward" and "backward" types, and I needed
to distinguish them without spending too much time thinking of a
provisory name. I meant to remove them before upstreaming my branch, but
I forgot...
|
| | |
| |
| |
| |
| | |
I'm removing this so that we don't accidentally suppress new instances
of this warning.
|
| |/
|
|
| |
This will be needed for ntor handshakes.
|
| |
|
|
|
|
|
|
|
| |
We can't access `NetParameters` in this crate to build from consensus
default value so instead add a `defaults_for_tests()` gated function for
each parameters object which puts in the defaults from the spec.
We'll need CircNetParameters in order to build create request handler
for unit tests hence why it is in src/circuit.rs.
|
| |
|
|
|
|
|
|
|
| |
From the reactor.rs to channel.rs, makes more sense and we'll need it in
the handshake tests.
No behavior change, just code movement and a function rename.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of copying the client unit tests into the channel module, just
make both current unit tests run on a client and relay handshake.
This required a bit of trickery with type HandshakeConnectFn but works
out in the end.
It also adds the RelayMsgBuf that wraps a MsgBuf in order to implement
CertifiedConn which is very relay only.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
This will be needed for ntor handshakes.
|
| | |
|
| |
|
|
|
| |
This also updates the key rotation task to call the setter whenever the
ntor keys get updated.
|
| |
|
|
| |
This will need to be updated each time the ntor keys change.
|
| |
|
|
|
|
|
|
|
|
| |
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]>
|
| |\
| |
| |
| |
| | |
tor-proto: Move CREATE_FAST handling to a helper
See merge request tpo/core/arti!3869
|
| | |
| |
| |
| |
| | |
Clippy has started warning about this since we moved the CREATE_FAST
handling to a helper, so this resolves that.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Fix formatting from previous code movement.
|
| | |
| |
| |
| |
| | |
This moves the code, changes the indentation, and wraps the result in an
`Ok()`.
|
| | | |
|
| | |
| |
| |
| | |
This had already been resolved.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
for handling CREATE* messages on channels.
|
| |
|
|
|
| |
When used for relay channels, the channel reactor will soon need to
spawn relay circuit reactors.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
We use this constant value when building the AUTHENTICATE cell to
optimize the memory allocation as this won't ever change.
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
No need to call `set_authenticated()` for a relay initiator channel
because relay initiator channel are always authenticated and thus the
underlying channel cell codec will always use the R2R restricted message
set.
This is only useful to a relay responder channel. The naming of that
function is not great actually and should probably change.
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Only get the inner generic unverified channel into a verified channel
after the actual verification in the relay responder handshake.
Some variables needed a rename as this was dangerously named.
No behavior change.
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374481
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]>
|
| |
|
|
|
|
| |
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374462
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]>
|