| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |\ \
| | |
| | |
| | |
| | | |
multiple crates: Fix clippy warnings
See merge request tpo/core/arti!4203
|
| | |/ |
|
| |\ \
| |/
|/|
| |
| | |
Upgrade cipher, aes, and ctr.
See merge request tpo/core/arti!4195
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
We _already_ do not include FLOWCTRL_CC as a listed protocol among
the capabilities we provide, when we make a virtual hop. This
branch will make that behavior even more certain, by not looking at
required-client-protocols any longer.
|
| | |
| |
| |
| | |
We do something similar with non-virtual hops at !4076.
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
proto: Allow BeginDir and Resolve messages in the stream reactor
Closes #2613
See merge request tpo/core/arti!4188
|
| | | |
| | |
| | |
| | |
| | | |
See
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4188#note_3432579
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
These assertions no longer fail now that the stream reactor is able to
handle non-`BEGIN` streams.
|
| | | | |
|
| | |/
| |
| |
| |
| |
| |
| | |
Previously, these would fail to parse, because the (WIP) stream reactor
assumed all streams would be exit (BEGIN) streams.
Closes #2613
|
| |/
|
|
|
|
| |
Additionally, fix itertools usage in maybenot_padding.rs
The definition of `Position` changed in 0.15.0.
|
| |
|
|
|
|
|
| |
Tests that the customizable `IncomingCmdChecker` added for #2606 is
doing its job, by ensuring that the circuit reactor doesn't emit
`IncomingStream`s for incoming streams created with commands that are
not in the reactor's allow list.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
The `CreateRequestHandler` now passes the list of allowed "incoming
stream request" commands (i.e. BEGIN, BEGIN_DIR, or RESOLVE) to the
reactor, replacing the hard-coded command list.
Closes #2606
|
| |
|
|
|
|
|
|
|
|
|
| |
This enables us to make these configurable: any relays that are not
configured to be an exit will exclude BEGIN and RESOLVE from their list
of allowed commands, causing exit and DNS streams to be rejected as soon
as the BEGIN/RESOLVE cell is received in the circuit reactor.
Context: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4145#note_3430345
Part of #2606
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Now that relays no longer use `CtrlCmd::AwaitStreamRequests`, some of
these fields are unused. I'm leaving them in for now, but we should
remove them if they're still unused after we finish the circ reactor
impl.
I'm not removing `AwaitStreamRequests`, because it will be needed by
onion services, when we replace the old client circuit reactor with the
new one.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We don't need it anymore now that `RelayCirc`s always allow incoming
stream requests.
The previous design, where you could build a `RelayCirc` that didn't
allow stream requests, was a leftover from the onion service
`ClientCirc` implementation that this was inspired from (onion services
*do* need the two to be decoupled, because incoming stream requests are
only allowed on the virtual hop, after it's established).
Closes #2582
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements what we discussed in
`doc/dev/notes/relay-streams.md` (lines 218-234):
> Currently, to allow incoming stream requests on a circuit,
> you first need to call `RelayCirc::allow_stream_requests()`
> to install a `CmdChecker` and `IncomingStreamRequestFilter`.
> This is not ideal, because `allow_stream_requests()` will need to be
> called unconditionally, on each `RelayCirc`,
> right after it's created in the `CreateHandler` impl
> (which in turn, would mean making `handle_create()` async too,
> because `allow_stream_requests()` is async, which wouldn't be great).
>
> So, the first step here is to rework the `RelayCirc` API to make relay circuits
> be constructable with a list of allowed `RelayCmd`s and `IncomingStreamRequestFilter`
> from the get-go ([#2582]), and to get rid of `allow_stream_requests()`,
> which will enable the `CREATE*` handler to remain non-`async`.
>
> In any case, the `CREATE*` handler will still require some changes,
> because it needs to be initialized with an `IncomingStreamRequestFilter`,
I am not sure using an `IncomingStreamRequestFilter` "factory" is
necessarily the right approach here, but the circuit `Reactor`'s
constructor needs to take an `IncomingStreamRequestFilter`, and
`IncomingStreamRequestFilter` is not `Clone` (and FWIW, I think it's
better if we don't make it `Clone`).
One obvious limitation is that the `IncomingStreamRequestFilter` of the
circuit reactor is fixed for the entire lifetime of the circuit.
In practice, I don't think this is going to be a problem,
because the arti-relay `IncomingStreamRequestFilter` is only going
be used for
* preventing single-hop exit streams
* per-circuit rate-limiting.
Both of these checks will require the filter to have access to a recent
`NetDir`, which is straightforward if the filter has an Arc<dyn
NetDirProvider> (as mentioned in doc/dev/notes/relay-streams.md,
`NetDirProvider` has a handy non-async `timely_netdir()` function we can
use). And since these checks are based on consensus params, we don't
really need to ever update an already-built circuit with a new
`IncomingStreamRequestFilter` (because all `IncomingStreamRequestFilter`
will have the ability to obtain a fresh `NetDir` as needed).
Nevertheless, I left a TODO about this, because I expect this type to
change once we figure out all the other pieces needed for #1448.
|
| | |
|
| |
|
|
| |
Part of #2582
|
| |
|
|
|
|
|
|
|
| |
Relay circuits always need a filter, so it's best to set it via the
constructor.
Part of #2582
Closes #2577
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Instead of converting the `RelayEarly` message to a `Relay` message, we
add a new `RelayMaybeEarlyChanMsg` restricted message set that can hold
either.
Previously we were passing the wrong channel message command to
`decrypt_outbound()`, which would cause the decryption to fail for relay
crypto algorithms that use the command.
|
| |\
| |
| |
| |
| |
| |
| | |
proto: Add circ reactor scaffolding for rejecting pending streams
Closes #2590
See merge request tpo/core/arti!4139
|
| | |
| |
| |
| |
| | |
See
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4139#note_3429586
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reworks `get_or_spawn_reactor()` to return `Error` instead of
`ReactorError`.
The main change here is that we now have a dedicated `Error::Spawn`
variant for `SpawnError`s, instead of mapping these to `ReactorError`
(which actually triggers a clean shutdown, which is not quite what we
want here).
|
| | | |
|
| | |
| |
| |
| |
| | |
This doesn't need to contain the `CloseStreamBehavior` or
`TerminateReason`, because we always use the same ones.
|
| | |
| |
| |
| |
| |
| |
| | |
I realized the previous naming was ambiguous. Hopefully this makes it
clear that this `StreamEvent` triggers when the MPSC channel connecting
the reactor to the local application stream (for example the local TCP
connection of the stream, in the case of exit streams) is dropped.
|
| | |
| |
| |
| | |
This already returns `()` in the `Ok` case.
|
| | |
| |
| |
| | |
Closes #2590
|
| | | |
|
| | |
| |
| |
| | |
This will soon be reused for implementing `CtrlMsg::ClosePendingStream`.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This will be sent by the FWD reactor.
Essentially, this going to be the final control message in the chain
`IncomingStream::reject()` ->
`RelayCirc::reject()` ->
`forward::CtrlCmd::ClosePendingStream`->
`HopMgr::close_pending()` ->
`stream::CtrlCmd::ClosePendingStream`
-> stream gets removed from the stream map, END sent
Part of #2590
|
| | | |
|
| | |
| |
| |
| | |
Closes #2590
|
| | | |
|