| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
Give a tx to the descriptor task so it can request the keys when
building a new descriptor.
Implement the crypto task handling of that command channel.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
| |
The crypto task can now signal the descriptor task that the keys have
changed related to the relay descriptor (signing key and ntor keys) so
a new descriptor can be built and uploaded.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
Config reload is not fully supported just yet but when that comes, we'll
need to make a task command for new targets.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
This is the basics, with many TODO(relay), for a relay descriptor upload
task which uses tor-dirpublish::Publisher.
Future commits will implement the several todo!().
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
| |
Context:
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4222#note_3437336
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This will be used shortly, as we need to spawn a `DirMirror::serve()`
task from `TorRelay::run()` for handling the incoming directory stream
requests.
The `DirMirror` is currently built from dummy data because there is no
config for it yet.
|
| |
|
|
|
| |
This is just the skeleton of the task. The implementation will follow
later.
|
| |
|
|
|
|
|
|
|
|
|
| |
We need to return the "futures::Stream of Tor streams" from the CREATE
handler, because these need to be handled from `arti-relay`,
as per `doc/dev/notes/relay-streams.md`
This commit is intentionally (slightly) misformatted to make reviewing a
bit easier (the next commit will rustfmt everything).
Part of #2612
|
| |
|
|
| |
Fixes a TODO.
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The recompute of the valid_until cache is done now in the constructor of
FullKeyView so the view is directly usable once built.
Else, the caller always need to call the recompute function which is
error prone especially when used as a throwaway view.
Also, without this change, building the view and then attempting to log
the public keys would fail.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
Rename it to init_keys() so it capture the semantic of initialization
especially that now it returns a InitKeyMaterial.
This is so we don't use this function outside initialization in the
future.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This moves commit makes it that FullKewView is not visible outside the
crypto task.
For this, we need to keep the KeyMgr in the inert tor relay struct until
it is passed to the crypto task.
The public keys logging is moved to the run() function of the crypto
task and the try_generate_keys() now returns an InitKeyMaterial struct
which contains the channel authentication key material (for ChanMgr) and
the Ntor keys for the CREATE2 handler.
This way, we cut the need of the FullKeyView in the main thread.
Related to #2548
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is so we early set the FullKeyView and we use it accross the code
from initialization.
The try_generate_keys() now takes a view and locks it to make its
changes.
And we also make build_proto_relay_auth_material() use a view to
simplify its code and also stop relying on the KeyMgr for key accessors.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
This also remove unused code from this change.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
This adds the trait type `ListenOptions` to `NetStreamProvider` and adds
this `ListenOptions` as an argument to `NetStreamProvider::listen()`.
You probably want to look at the changes in tor-rtcompat first, then the
rest of this commit is updating the various places we use
`NetStreamProvider`.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
| |
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]>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
| |
This way we can unit tests properly.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Disable use-statements which are only needed for unix.
|
| | |
|
| |
|
|
| |
Will clean this up in the following commit.
|
| |
|
|
|
|
| |
No need to pass from the arti relay binary our addresses when handling
an incoming channel, use the one in the channel builder that an
initiator channel uses.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
This method was renamed previously.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
Move rotating keys into a function so we can use it in
try_generate_keys() that is used at startup.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This task crypto module has a rotate key task that is in charge of
rotating keys from our KeyMgr based on the valid until.
To do so, we add a RotatableKeySpec trait to help us specify our to
rotate a specific key. Allows us to have a generic rotate/generate
function for all our keys.
Task runs every 60 seconds. Taken from C-tor.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This requires the `TlsKeyAndCert` so be passed on the TLS acceptor
settings. We assume that `RelayIdentities` has this information.
The ChanBuilder::new() was getting a bit too convoluted and feature
gated to instead we introduce new_client() and new_relay() and remove
the need for `with_identities()`.
Because of this, the ChanMgr::new() now returns a `Result<>`.
Related to #1597
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
| |
This method won't really be used for bootstrapping anymore.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
We need the advertised addresses for the NETINFO cell when opening a
relay channel. Keep them in the TorRelay object so we can pass them to
the ChanMgr channel handler.
This will also help with config reload where only the local values in
TorRelay will need to be updated.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This struct is used to pass configuration parameters to the ChanMgr when
building it.
At the moment, it holds the ChannelConfig and RelayIdentities (feature
gated) which will be used in subsequent commits.
Note that relays do require RelayIdentities to build channels.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
We'll rely on a RelayIdentities to pass in the right keys to the ChanMgr
instead of the entire KeyMgr.
Signed-off-by: David Goulet <[email protected]>
|
| | |
|