summaryrefslogtreecommitdiff
path: root/crates/tor-hsclient/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-2/+2
| | | | Run maint/add_warning
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-1/+1
|
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* opentelemetry: Add some instrument macros.Wesley Aptekar-Cassels2025-09-241-1/+2
| | | | | I've added these in places that are useful for the debugging that I've been doing.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-4/+4
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* conflux: Adjust docs and fix doc links.Gabriela Moldovan2025-08-051-1/+1
|
* hs: Use the new Tunnel interface for onion serviceDavid Goulet2025-08-051-19/+5
|
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* protover, *: Add documentation about what "supported" means.Nick Mathewson2025-04-161-1/+2
|
* Add warnings about removing supported protocols.Nick Mathewson2025-04-161-0/+2
|
* New functions to report supported subprotocolsNick Mathewson2025-04-161-0/+41
| | | | | | | | | | | | | | | Part of #1849. Note that these functions are distributed across crates, so that if (in the future) we stop doing API breaks with every release, we will get the right outputs. Note also that these functions build the list of protocols out of specific symbolic features, rather than numbers: this makes it easier to avoid errors about "which feature was Relay=4 again", and easier to avoid accidentally referring to a protocol that doesn't exist, like "Consensus" (should be "Cons") or "HsDir" (case is wrong).
* 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.
* hs-pow: Refactor to prefer stub types rather than cfg sprawl.Wesley Aptekar-Cassels2024-10-091-3/+1
| | | | | | | | | | | | | | | | | | | | | | In this design, the thin multiplexing layer between PoW types is always available when onion services are in use, but the specific pow schemes (and their dependency libraries) are gated by crate features everywhere. There are now no new cfg() gates. When the pow-v1 scheme is disabled, we can parse `pow-params v1` lines into an empty type (so clients know a PoW scheme exists that might be supported if they were configured differently). We currently don't save the contents of unknown hsdesc items. On the relaycell side, the hs ext module already sets a strong precedent for keeping unrecognized data as a byte vec, and it doesn't provide a good way to signal soft parse errors like unrecognized optional extensions. There, the `v1` type is completely optional, and services lacking a pow scheme suggested by a client would see one of these 'unrecognized' blobs. This isn't necessarily helpful but it fits the rest of the design. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* tor-hspow: Big refactor, dissolve this crateWesley Aptekar-Cassels2024-10-091-0/+3
| | | | | | | | | | | | | | | | | My previous strategy here was to try and centralize hspow in one crate, writing it like a self-contained feature. That introduced friction in the data types, prompting the use of simplistic types at the netdoc/cell layers and full-featured types in the optional modules. This changes tactics, dissolving the low-level parts of tor-hspow into tor-hscrypto and the high-level parts into hsclient/hsservice. Full featured types are used everywhere now, but the tradeoff is that compile-time configurability is a lot more pervasive. Anything that knows about PoW types at all needs to be fully configured out. I took this opportunity to try a more complete set of crate features, allowing users to configure individual PoW schemes. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* tor-hsclient: Use the new "restricted discovery" terminology.Gabriela Moldovan2024-10-031-3/+4
| | | | Part of #1476
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* tor-hsclient: Remove client nickname from the client key specifiers (fmt).Gabriela Moldovan2024-02-221-4/+1
|
* tor-hsclient: Remove client nickname from the client key specifiers.Gabriela Moldovan2024-02-221-1/+1
| | | | Closes #1283
* tor-hsclient: Rename HsClientSpecifier to HsClientNickname (fmt).Gabriela Moldovan2024-01-311-2/+2
|
* tor-hsclient: Rename HsClientSpecifier to HsClientNickname.Gabriela Moldovan2024-01-311-1/+1
| | | | | Service nicknames are represented by `HsNickname`, so let's rename `HsClientSpecifier` to `HsClientNickname`.
* tor-hsclient: Derive the KeySpecifier implementation.Gabriela Moldovan2024-01-101-1/+1
| | | | | | | | This addresses a `TODO HSS` about deriving the `KeySpecifier` implementation for client key specifiers. Note that we no longer have a key specifier type for intro auth keys (which are not supported anyway, see #1037).
* hsclient: Rename get_or_launch{connection => circuit}Nick Mathewson2023-10-241-1/+25
| | | | Closes #1078.
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Run cargo +nightly fmt to format many let ... else ...Ian Jackson2023-07-241-2/+3
| | | | | | | | | | | rustfmt has grown opinions about how let ... else ... ought to be formatted. They don't always agree with our previous manual decisions. I think our policy is to always insist on rustfmt. When that version of rustfmt hits stable, our CI will start to fail for everyone. (Right now this discrepancy just causes trouble for contributors who are using nightly by default.)
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* HS configuration: Plumb configuration throughIan Jackson2023-06-281-3/+7
| | | | | Invent a trait a la circmgr config for the hs client connector config. Plumb a suitable value all the way through to the code that will use it.
* tor-hsclient: Add a comment about what run_housekeeping doesIan Jackson2023-06-261-0/+1
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1290#note_2915679
* tor-hsclient: Add a debug message about task exitIan Jackson2023-06-261-0/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1290#note_2915678
* tor-hsclient: Comment explaining why no launch_background_tasksIan Jackson2023-06-261-0/+3
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1290#note_2915676
* tor-hsclient: Say we *mustn't* do housekeeping while dormantIan Jackson2023-06-261-2/+2
| | | | | | | | | This is a change to the API docs, but not to the actual code, since our call site is in arti-client and tied to netdir fetch, which *doesn't* happen when dormant. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1290#note_2915677
* tor-hsclient: Expire old data eventuallyIan Jackson2023-06-231-3/+41
| | | | Otherwise we'll fill up our RAM with junk.
* tor-hsclient: Introduce helper function for locking services tableIan Jackson2023-06-221-2/+14
|
* Merge branch 'stderr' into 'main'Alexander Færøy2023-06-211-0/+2
|\ | | | | | | | | lints: Promote clippy::print_stderr and clippy::print_stdout See merge request tpo/core/arti!1271
| * lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
| |
* | tor-hsclient: Drop most allows that are marked for removalIan Jackson2023-06-211-2/+0
| |
* | tor-hsclient: Drop a large number of unneeded importsIan Jackson2023-06-211-1/+0
|/
* keymgr: Move the HS client and service key specifiers out of tor-keymgr.Gabriela Moldovan2023-06-151-1/+4
| | | | | | The HS `HsClientSpecifier` and `HsClientSecretKeySpecifier` are moved to `tor-hsclient`. The HS service secret key specifier stubs are moved to `tor-hsservice`.
* tor-hsclient: Introduce proto_oneshot, to help with message handlingIan Jackson2023-06-131-0/+1
| | | | | This gets rid of a lot of repeated `oneshot::<...<Result, ...>>` and a bit of repeated functional code, etc.
* tor-hsclient: Implement rendezvous setup, and retry frameworkIan Jackson2023-06-091-0/+2
| | | | | | | | | | | | | | | | | | | | | This contains code to: * Iterate over introduction points * Make multiple attempts to connect * Apply timeouts to the various phases of each attempt * Establish a rendezvous point * Represent errors that occur during the above It provides places to add: * Implementation of the INTRODUCE1/INTRODUCE_ACK handshake * Reception of RENDEZVOUS2 and actual end-to-end circuit establishment * Recording of the outcome of connection attempts via particular IPTs * Using previous IPT outcome information for selecting IPTs to try * Tests of the new code (although more mocking will probably be needed) Much of this code works with a fixed type ClientCirc rather than going via the Mockable traits. That is wrong, and it will be fixed later.
* tor-hsclient: errors: Introduce IntroPtIndexIan Jackson2023-06-091-1/+1
| | | | | | We're going to want to report about rendezvous points in errors. We'll do this by printing the "number" of the intro point in the descriptor.
* tor-hsclient: errors: Introduce RendPtIdentityForErrorIan Jackson2023-06-091-0/+1
| | | | | We're going to want to report about rendezvous points in errors. We'll be using this. And we'll want to convert it from a Relay.
* tor-hsclient: Allow dead code for nowIan Jackson2023-06-091-0/+2
| | | | The dead code warnings are a nuisance while this file is half-written.
* tor-hsclient: export InvalidTargetIan Jackson2023-06-091-0/+1
| | | | It's going to appear in our public errors.
* hsclient: Create a CircTarget from an IntroPointDesc.Nick Mathewson2023-06-071-0/+1
| | | | | The main body of this function is written so that we can later use it to create a CircTarget from an INTRODUCE2 message.
* Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-161-1/+1
| | | | | | | | | | | | Now ClientCirc is no longer `Clone`, and the things that need it to be `Clone` instead return and use an Arc<ClientCirc> We're doing this so that ClientCirc can participate in the RPC system, and so that its semantics are more obvious. Closes #846. Thanks to the type system, this was a much simpler refactoring than I had feared it would be.