| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
We decided the reactor is the wrong place to handle this.
See discussion in #2490
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds an extra assertion that ensures the relay reactor does in fact
send an EXTENDED2 on its towards-the-client channel after receiving the
CREATED2 response from the fake hop.
This check is nice to have in general, but the main reason I'm doing
this now is because for the DESTROY tests I'm about to add, I need the
inbound MPSC queue (towards the client) drained of these handshake
messages in order to check that the "next" cell we've sent is a destroy.
I could've added some custom code to drain it just for the purposes of
that test, but I think it's better to have `do_create2_handshake()` take
care of it.
|
| | |
|
| |
|
|
|
|
|
|
| |
The new name is (hopefully) a bit more descriptive.
I'm planning on extending this function soon to support checking if a
DESTROY has been sent on the outbound channel too, so I'm tweaking the
docs a bit in preparation for that.
|
| |
|
|
| |
I'll soon need this for a DESTROY test.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
This changes a debug log to have the same format as the corresponding
DESTROY-related log from the forward reactor.
Part of #2490
|
| | |
|
| |
|
|
| |
Part of #2490
|
| |
|
|
|
|
|
|
|
|
|
| |
When the circ-padding feature is enabled, we use maybenot, which does
not yet support rand 0.10. In the meantime, enabling this feature pulls
in rand 0.9. This is not ideal, but should be okay as a temporary
situation.
This also replaces the use of ReseedingRng (which was removed in 0.10)
with the reseeding_rng crate. This is somewhat less performant, but it
should be okay.
|
| |
|
|
|
|
| |
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.
|
| | |
|