| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | | | | | |
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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
|
| |\ \ \ \ \ \
| |_|_|/ / /
|/| | | | |
| | | | | |
| | | | | | |
relay: Transform the crypto task into a reactor
See merge request tpo/core/arti!3919
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Instead of a HashMap, use a struct that contains explicit valid_until
value per key type as those won't change anytime soon.
This is to have a smaller memory footprint and simpler design.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This change made it that we don't need Result<> to be returned for two
functions therefore affecting the callsites.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This is the last piece that needed to be removed since we can use the
view to get those keys.
This also allows us to remove the temporary FullKeyView::keymgr()
function and instead keep the keymgr access strictly to the view guard.
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 effectively removes KeyChange and use the returned set of key types
that were rotated.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Rebuild the valid_until cache from the key manager and return which key
has changed.
Function is not used in this commit.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Rename the try_rotate_keys() to be explicit about no locking and use it
in the Reactor.
We need this try_rotate_keys() independent function so our first
generate all keys can call it which is done before the reactor starts.
Because we need crypto material in order to initialize the ChanMgr, we
have to generate keys before spawning the task.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This also remove unused code from this change.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Like previous commit, we only care now if a generate has been done. It
is enough of a signal to rebuild our channel auth material and set ntor
keys.
Part of the refactoring into phases.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The crypto task remove_expired_keys() only returns the next minimum
expiry time of all keys it looked at if any remains.
This is part of a broad refactoring of the task so we get to have three
phases at each run that is: 1. Expire, 2. Rotate, 3. Reconcille
With that design, we only need to know if a rotation happened and if so,
we can signal other task that we did and rebuild the channel auth key
material and ntor keys.
The reconcille phase will be in charge of rebuilding the valid_until
task of the view.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The race will appear once we start using the FullKeyView accross the
code in the next commit(s).
This is also neat because it will enforce that the keymgr is only
accessed with the write lock held.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This is a full copy without change (except the keymgr access) so that
function becomes a Reactor function.
Future commit will cleanup the original copy when the crypto reactor
replaces the current task.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This basically copies the code from rotate_keys_task() and puts it in
the run_once().
Cleanup will follow in the next commits to lock step changes.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| |/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This object wraps the `KeyMgr` and provide getters for all specific
relay key types.
That view is meant to access all keys a relay has. Upcoming restricted
views will wrap that object to offer a limited view that is more domain
specific.
A valid_until cache is kept for all expirable keys so all get() of those
keys always return the same one.
Signed-off-by: David Goulet <[email protected]>
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Add metrics exporter to arti-relay
See merge request tpo/core/arti!3980
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This is not likely to cause any major problem, so just warning should be
fine.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This currently does not actually export any metrics, but puts the
infrastructure in place to do so.
This adds the `experimental`, `__is_experimental`, etc features to
arti-relay. I presume we want to do that in the long term, but I'm not
100% sure on that.
|
| |/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This will allow these types to be shared by arti and arti-relay.
This does change these types from being behind the experimental-api
flag. I think this is okay, as tor-config is not a stable crate anyways,
but it's worth keeping in mind.
There is also an argument to be made for having two separate types, one
in arti and one in arti-relay, as we do for LoggingConfig. I think that
using a single type has benefits, and we should strive to eventually
merge the LoggingConfigs, for instance, and perhaps other types, but it
doesn't seem critical in either direction at the moment.
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Stabilize 'flowctl-cc' and add to 'full'
Closes #2419
See merge request tpo/core/arti!4014
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| |\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
ptmgr: pass outbound_proxy to managed PT processes
See merge request tpo/core/arti!4017
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Previously the [channel] outbound_proxy setting was applied to Arti's
own direct connections but was not forwarded to managed PT processes.
https://spec.torproject.org/pt-spec/configuration-environment.html
|
| |\ \ \ \ \ \ \
| |/ / / / / /
|/| | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
tor-chanmgr: notify waiters when a launch is cancelled
Closes #1716
See merge request tpo/core/arti!3946
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
If a future that owns a pending channel launch is dropped after
publishing the pending entry, other waiters can see the oneshot sender
disappear and report "channel build task disappeared" as an
internal bug.
Fix this by tying pending-entry cleanup and waiter notification
together. Once we take responsibility for a pending launch, every exit
path now removes or upgrades the pending entry and notifies waiters with
the observed result. Cancellation reports RequestCancelled, while
post-build failures keep their original error instead of turning into
the internal bug or retrying the launch owner.
Add regression tests that cover both successive dropped launch-owner
futures and a failure while installing a newly built channel, so
waiters see the expected error in each case.
|
| |\ \ \ \ \ \ \
| |_|/ / / / /
|/| | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
netdir: Fix SRV lifetime calculation for non-standard voting periods
Closes #2522
See merge request tpo/core/arti!3965
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This test was supposed to set both the current and the previous SRV in the
test netdir, but was actually only setting the previous one.
With the new SRV fixes from ee07c441909b41d5fbbfbffae310e954a69db478,
all the hsservice tests using this netdir were panicking on an
`.unwrap()`, because the SRV for the "previous" TP could not be found,
which is actually what you'd expect to happen, given that the netdir was
built with only one SRV. The reason the tests weren't failing before is,
funnily enough, because of the bug in SRV calculation that is fixed in
ee07c441909b41d5fbbfbffae310e954a69db478:
In `tor-netdir`, the `extract_srvs()` function (correctly) only returned
a single SRV from the consensus (the "previous one", set with
`bld.shared_rand_prev()` in the test), but the `find_params_for_time()`
was wrongly matching up that same SRV with multiple time periods. This
happened because the old implementation was computing the "previous SRV"
validity interval as:
* ts_begin = `[start_of_day_containing(consensus_ts) - ONE_DAY`
* ts_end = `ts_begin + srv_interval`
And because the test SRV interval is 288h(!), and the test TP length is
only 24h, the validity period of the previous SRV (incorrectly) covered
two TPs (both the previous and the current). So as a result, the test
was "successfully" getting back the same SRV for both the previous and
the current TP.
The bug was introduced in the commit that originally added the hsservice
tests: 279842526591918e25ca97e6392f211a50192396
|