summaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src
Commit message (Collapse)AuthorAgeFilesLines
* Use an EntropicRng trait to enforce key generation rules.Nick Mathewson2025-03-242-2/+6
| | | | | | | | | | | 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.
* Use CautiousRng for keys going into the KeyMgr.Nick Mathewson2025-03-242-3/+2
|
* Merge branch 'named_protovers' into 'main'David Goulet2025-03-201-2/+3
|\ | | | | | | | | | | | | protover: Add support for subprotocol version mnemonics. Closes #1891 See merge request tpo/core/arti!2854
| * Use named subprotocol versions throughout arti.Nick Mathewson2025-03-121-2/+3
| |
* | squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-183-3/+3
| | | | | | | | - The Rng::gen() functions have been renamed to Rng::random().
* | squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | | | | | - The Standard distribution has been renamed to StandardUniform.
* | squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | | | | | - The rand::distributions module has been renamed to rand::distr
* | squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-185-5/+5
| | | | | | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* | Merge branch 'dev/cve/is_fully_reachable' into 'main'gabi-2502025-03-141-0/+10
|\ \ | |/ |/| | | | | | | | | tor-hsservice: Add is_fully_reachable() method Closes #1890 See merge request tpo/core/arti!2850
| * tor-hsservice: Add is_fully_reachable() methodClara Engler2025-03-131-0/+10
| | | | | | | | | | | | | | | | | | 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
* | Deprecate --onion-name; introduce --onion-addressdisha2025-03-121-6/+22
|/
* tor-rt*: Apply deferred formatting churnIan Jackson2025-03-041-1/+1
| | | | rustfmt.
* tor-rtcompat: Rename BlockOn to ToplevelBlockOnIan Jackson2025-03-044-5/+5
| | | | | | | | | | 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..)
* Upgrade to derive_more 2Nick Mathewson2025-02-261-4/+8
| | | | | This took a little refactoring, since derive_more::Foo no longer re-exports std::ops::Foo.
* tor-hsservice: Change replay/mod.rs to replay.rs.Wesley Aptekar-Cassels2025-02-101-0/+0
| | | | We have a new lint that requires this.
* tor-hsservice: Change unclear names in ReplayLog.Wesley Aptekar-Cassels2025-02-102-21/+21
|
* tor-hsservice: Assert that hash length is correct in ReplayLog.Wesley Aptekar-Cassels2025-02-101-0/+3
|
* tor-hsservice: Change ReplayLog parse_log_leafname API.Wesley Aptekar-Cassels2025-02-103-8/+11
| | | | | This previously returned a &str for sort of unclear reasons, which was only used in logging. Remove that.
* tor-hsservice: Fix some comments in ReplayLog.Wesley Aptekar-Cassels2025-02-101-2/+5
|
* tor-hsservice: Make TODOs not doccomments.Wesley Aptekar-Cassels2025-02-101-2/+2
|
* tor-hsservice: Rename some variables to reflect refactor.Wesley Aptekar-Cassels2025-02-101-22/+22
| | | | | | 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.
* tor-hsservice: Add whitespace.Wesley Aptekar-Cassels2025-02-101-0/+1
|
* tor-hsservice: Update comment in replay log code.Wesley Aptekar-Cassels2025-02-101-1/+3
|
* tor-hsservice: Remove ReplayLog::check_inner.Wesley Aptekar-Cassels2025-02-101-9/+2
| | | | | | 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.
* tor-hsservice: Remove ReplayLog HASH_LEN constant.Wesley Aptekar-Cassels2025-02-101-9/+8
| | | | | This needed to be the same as the MESSAGE_LEN constant, so we should just use the same constant for both.
* tor-hsservice: Clean up replay::ipt::hash types.Wesley Aptekar-Cassels2025-02-101-9/+6
| | | | | I don't think a newtype here was really buying us anything. Might as well get rid of it.
* tor-hsservice: Move replay::hash into replay::ipt::hash.Wesley Aptekar-Cassels2025-02-102-75/+83
| | | | The IPT log is the only one that will need hashing, so move that code.
* tor-hsservice: Move ReplayLog hashing out of generic code.Wesley Aptekar-Cassels2025-02-102-19/+20
|
* tor-hsservice: Stop using check_inner in ReplayLog tests.Wesley Aptekar-Cassels2025-02-101-41/+69
| | | | | | 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.
* tor-hsservice: Make ReplayLog magic bytes generic.Wesley Aptekar-Cassels2025-02-102-12/+21
| | | | This will ensure that we can't confuse different types of replay logs.
* tor-hsservice: Make ReplayLog generic.Wesley Aptekar-Cassels2025-02-105-50/+102
|
* tor-hsservice: Make directory for replay module.Wesley Aptekar-Cassels2025-02-101-0/+0
| | | | | This will shortly become multiple files, so it will be helpful to have it in a directory.
* proto: Remove ConversationInHandlerDavid Goulet2025-02-042-6/+2
| | | | | | | | | | | | | | | | | | | 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]>
* tor-proto: Rewrite circuit reactor run_once() loop to use select!.Gabriela Moldovan2025-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* circmgr: Remove the CircParameters build .expect()David Goulet2025-01-161-1/+2
| | | | | | Instead, return an error and make all call site handle it. Signed-off-by: David Goulet <[email protected]>
* circ: Specialize the circparams from netparams functionDavid Goulet2025-01-162-3/+2
| | | | | | | | | | | | | | | 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]>
* circmgr: Modify CircParameters for congestion controlDavid Goulet2025-01-161-1/+2
| | | | | | | | | | | | | | 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]>
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | 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.
* Add TODO to error if enable_pow is set but feature flag is disabled.Wesley Aptekar-Cassels2024-11-251-0/+1
|
* tor-hsservice: Clarify enable_pow setting TODO.Wesley Aptekar-Cassels2024-11-251-1/+1
|
* tor-netdir: Add timeliness param to wait_for_netdir_to_list.Wesley Aptekar-Cassels2024-11-251-1/+1
|
* Move helpers from tor-hsservice to tor-netdir.Wesley Aptekar-Cassels2024-11-256-99/+15
| | | | | These helpers seem potentially broadly useful, and only really discoverable if they're here.
* arti: Add onion_service.enable_pow option.Wesley Aptekar-Cassels2024-11-251-2/+8
| | | | This currently is not implemented.
* tor-hsservice: add clippy allowsSteven Engler2024-11-201-0/+4
|
* update `CfgPath::path` to use a `CfgPathResolver`Steven Engler2024-11-182-10/+9
| | | | | | | | | | | | | | | | 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.
* tor-hsservice: pass through the `CfgPathResolver`Steven Engler2024-11-185-15/+53
|
* tor-config: removed re-export of `CfgPath`Steven Engler2024-11-043-3/+5
| | | | | Also updated other packages to get `CfgPath` directly from `tor-config-path' instead of 'tor-config'.
* Merge branch 'bug1531' into 'main'Ian Jackson2024-10-211-2/+2
|\ | | | | | | | | | | | | Move crates to crates to slotmap-careful Closes #1531 See merge request tpo/core/arti!2530
| * Convert a few crates to slotmap-carefulNeel Chauhan2024-10-171-2/+2
| |