| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
We want to require that whenever we generate a key that's persistent
(stored in KeyMgr), it's going to be made from a stronger-than-usual
Rng. This trait helps us enforce that.
We also add a FakeEntropicRng struct to use for testing.
Note that this turned up a case that we'd missed, which required
an internal change in tor-hsservice.
|
| | |
|
| |\
| |
| |
| |
| |
| |
| | |
protover: Add support for subprotocol version mnemonics.
Closes #1891
See merge request tpo/core/arti!2854
|
| | | |
|
| | |
| |
| |
| | |
- The Rng::gen() functions have been renamed to Rng::random().
|
| | |
| |
| |
| | |
- The Standard distribution has been renamed to StandardUniform.
|
| | |
| |
| |
| | |
- The rand::distributions module has been renamed to rand::distr
|
| | |
| |
| |
| | |
- `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
|
| |\ \
| |/
|/|
| |
| |
| |
| | |
tor-hsservice: Add is_fully_reachable() method
Closes #1890
See merge request tpo/core/arti!2850
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit adds a `is_fully_reachable()` method to
`tor_hsservice::status::State` in order to check whether the hidden
service is believed to be fully reachable.
See #1887
Fixes #1890
|
| |/ |
|
| |
|
|
| |
rustfmt.
|
| |
|
|
|
|
|
|
|
|
| |
We're going to distinguish top-level runtime entry, from *re*-entry to
an existing executor. It is most convenient to rename this trait
first. Documentation of the distinction will come later.
(We're going to retain the function name `block_on`, but we want the trait
to be more obviously a top-level only thing, though, so we give it a
name that will hopefully avoid it peroulating throughout the codebase..)
|
| |
|
|
|
| |
This took a little refactoring, since derive_more::Foo
no longer re-exports std::ops::Foo.
|
| |
|
|
| |
We have a new lint that requires this.
|
| | |
|
| | |
|
| |
|
|
|
| |
This previously returned a &str for sort of unclear reasons, which was
only used in logging. Remove that.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Get rid of anything talking about hashes or "h" in mod.rs, since that
should now be relegated to ipt.rs. Fix some other things to use generic
names as well.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This didn't really need to be a helper, we can just do everything in
check_for_replay. It was a helper since we previously couldn't test the
check_for_replay function, but now that this is generic we can.
|
| |
|
|
|
| |
This needed to be the same as the MESSAGE_LEN constant, so we should
just use the same constant for both.
|
| |
|
|
|
| |
I don't think a newtype here was really buying us anything. Might as
well get rid of it.
|
| |
|
|
| |
The IPT log is the only one that will need hashing, so move that code.
|
| | |
|
| |
|
|
|
|
| |
This is a internal detail that the tests shouldn't care about. This will
also allow us to make hashing a detail handled by IptReplayLogType,
rather than having it in the generic code.
|
| |
|
|
| |
This will ensure that we can't confuse different types of replay logs.
|
| | |
|
| |
|
|
|
| |
This will shortly become multiple files, so it will be helpful to have
it in a directory.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is unused but most importantly it allows any RELAY cell to be sent
from anywhere in the code which is really not desirable because it is
skipping congestion control.
It also allows us to remove the `control_tx` from the reactor which is
one less channel to track/understand/think about.
This opens up the door to all sorts of problems especially side channel
that can be exploited if we are not careful.
We can always bring this back if we need it but for now, it is unused
and allows us to remove the `CtrlMsg::SendRelayCell` control message.
No code behavior change.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This rewrites the circuit reactor main loop to use `select_biased!` to poll
multiple futures simultaneously.
The new `run_once()`, like the old, first waits for an initial
`CtrlMsg::Create`. Then, it uses a `select_biased!` to poll the
`chan_sender` sink and shutdown channel for readiness.
When the channel sink is ready, we poll the `control` and `input`
channels like before, as well as the new `ready_streams` `Stream`
(`ready_streams` is a `futures::Stream` that replaces the previous
`send_outbound()` function).
Most of the implementation remains unchanged, except the `handle_input`,
`handle_cell` and `handle_control` functions no longer send anything on
the `chan_sender` channel. Instead, they may do some (synchronous)
processing, and send instructions for the remaining work that needs to
be done (for example, for writing the cell to the `chan_sender`
channel). These instructions are handled at the end of `run_once()`,
and are encoded in the `RunOnceCmdInner` enum.
What this change does **not** do:
* the control channel *still* bypasses congestion control. We could
fix this by making the various reactor functions send the
`RunOnceCmdInner` commands to `run_once()` via a channel
(instead of returning them). This would enable the reactor to stop
reading the commands (except for handle `Sendme`, which would be
handled separately) if it's blocked on congestion control.
|
| |
|
|
|
|
| |
Instead, return an error and make all call site handle it.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Congestion control parameters have specific values depending on the
circuit type. Instead of using a CircuitType, which is removed in this
commit, specialize the function in this case onion and exit.
This allows us to get rid of CircuitType and solely use TargetCircUsage
instead.
At this commit, we use .expect() on the Builder. Future commit will
remove this to return a Result in case of failure. Worth noting that we
don't expect one.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The congestion control parameters are created from the consensus
parameters (netparams) and then put into the CircParameters object that
is then passed down the tor-proto crate.
Because different parameters are selected depending on the circuit type
(onion vs exit vs sbws), a CircuitType enum is introduced for the sole
purpose of being used to select the right parameters.
Related #534
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
Denies 'mod.rs' files for consistency.
https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
|
| |
|
|
|
|
|
|
| |
In 1.83, this warning triggers on many of our crates.
We're thinking of fixing them all, but for now,
we're going to disable the warning.
This is part of #1765.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
These helpers seem potentially broadly useful, and only really
discoverable if they're here.
|
| |
|
|
| |
This currently is not implemented.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a big change across multiple crates since there isn't a good way
to break it up.
This changes the signature of `CfgPath::path` to:
```
pub fn path(&self, path_resolver: &CfgPathResolver) -> Result<PathBuf, CfgPathError> {
```
Making this change means that our global `CfgPathResolver` needs to be
stored in the 'arti-client' library instead of `tor-config-path`, and
must be passed through to anything that calls `path` to expand the
variables.
|
| | |
|
| |
|
|
|
| |
Also updated other packages to get `CfgPath` directly from
`tor-config-path' instead of 'tor-config'.
|
| |\
| |
| |
| |
| |
| |
| | |
Move crates to crates to slotmap-careful
Closes #1531
See merge request tpo/core/arti!2530
|
| | | |
|