aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | tor-hsservice: key expiry: clippy followupIan Jackson2024-01-241-3/+2
| | | | | | | | | | These are now the last uses of these values, so they need the "no clone" form.
* | tor-hsservice: key expiry: Do publisher expiry from reactorIan Jackson2024-01-243-131/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In principle there is a small race with doing this in a separate task: the reactor and the sweeper might process the new netdir at different times. For example, if two netdir updates come in quick succession, and the sweeper is slower, the sweeper might still be running with the previous TPs as the publisher is creating keys in the new TPs. Theoretically, the sweeper might delete keys the reactor has just generated. This is also considerably simpler.
* | tor-hsservice: key expiry: Break out KeystoreSweeper::expire_keysIan Jackson2024-01-242-43/+55
| | | | | | | | We're going to change where this is called.
* | tor-netdir: Make hs_dirs_{upload, download} take separate args instead of tuple.Gabriela Moldovan2024-01-242-2/+2
| | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1904#note_2987777
* | tor-netdir, tor-hscrypto: Add function for computing SRV period offset.Gabriela Moldovan2024-01-241-6/+8
| | | | | | | | Part of #1166
* | tor-hsservice: Generate revision counter using the start of SRV period (fmt).Gabriela Moldovan2024-01-241-2/+1
| |
* | tor-hsservice: Generate revision counter using the start of SRV period.Gabriela Moldovan2024-01-241-18/+17
| | | | | | | | Closes #1166
* | tor-netdir: Simplify `hs_dirs_upload` by only returning the `Relay`.Gabriela Moldovan2024-01-242-3/+3
| | | | | | | | | | | | | | | | The publisher is the only user of `hs_dirs_upload`. It turns out it never actually uses the first element of the yielded `Item`s, so we can simplify `hs_dir_upload` to only return the HsDir `Relay`s. Part of #1166
* | tor-hsservice: Store HsDirParams in the publisher's TimePeriodContext.Gabriela Moldovan2024-01-241-10/+19
| | | | | | | | Part of #1166
* | tor-netdir: Make hs_all_time_periods return HsDirParams.Gabriela Moldovan2024-01-242-8/+10
|/ | | | | | | | | The descriptor publisher uses this function to obtain the list of relevant time periods. It will soon also need to know the `srv_lifespan` associated with each time period, so we change this function to return `HsDirParams`. Part of #1166
* tor-hsservice: Move compute_subcredentials to RendRequestContext.Gabriela Moldovan2024-01-223-103/+100
| | | | Part of #1242
* tor-hsservice: Do not store the subcredentials in RendRequestContext.Gabriela Moldovan2024-01-223-21/+22
| | | | | | | | | | | | | | | Previously, the subcredentials were computed in `IptEstablisher::launch` and stored in `RendRequestContext`. This caused long-running services to report errors like: ``` WARN tor_hsservice::helpers: Problem while accepting rendezvous request: error: Could not process INTRODUCE request: Introduction handshake was invalid: Circuit-extension handshake authentication failed ``` for clients using newer subcredentials than the ones the service had at the time the IPT was established. Fixes #1242
* tor-hsservice: Add an error type for subcredential lookup failures.Gabriela Moldovan2024-01-221-0/+5
| | | | | | | | The subcredential lookup will be moved to `IntroRequest::decrypt_from_introduce2`. The error returned on failure is going to be `IntroRequestError::Subcredentials`. Part of #1242
* Merge branch 'shutdown_on_drop' into 'main'gabi-2502024-01-194-14/+26
|\ | | | | | | | | | | | | Clarify shutdown behavior when RemoteOnionService is dropped. Closes #1238 and #1236 See merge request tpo/core/arti!1899
| * Document when (most) spawned tasks will be canceled.Nick Mathewson2024-01-182-0/+6
| |
| * hsservice: Temporarily remove .pause() (formerly stop()).Nick Mathewson2024-01-181-0/+2
| | | | | | | | | | We don't need to implement this for our first release of onion services, but we shouldn't ship a function that calls todo!().
| * Clarify usage and behavior of shutdown_tx.Nick Mathewson2024-01-181-6/+7
| |
| * Clarify IptEstablisher shutdown rulesNick Mathewson2024-01-181-8/+11
| | | | | | | | | | | | There was no actual bug here; just some missing comments. Closes #1236.
* | Merge branch 'tolerant_intro_established' into 'main'gabi-2502024-01-191-17/+12
|\| | | | | | | | | | | | | Do not reject INTRO_ESTABLISHED messages with extensions Closes #1238 See merge request tpo/core/arti!1898
| * Do not reject INTRO_ESTABLISHED messages with extensionsNick Mathewson2024-01-181-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | The spec says that we should ignore unrecognized extensions. Per discussion at torspec#249, this is still correct. Additionally, this commit moves responsibility for checking INTRO_ESTABLISHED messages into IptMsgHandler::handle_msg, to make sure that the circuit is torn down as soon as possible on a bad reply. (There's nothing to check yet, but there will be once we start sending extensions that expect a reply.) Closes #1238.
* | Mark ShutdownStatus as must_useNick Mathewson2024-01-181-0/+1
|/ | | | Followup from !1895.
* Merge branch 'publisher-shut-down' into 'main'Nick Mathewson2024-01-182-7/+13
|\ | | | | | | | | tor-hsservice: The publisher should exit when the IPT manager says so. See merge request tpo/core/arti!1895
| * tor-hsservice: The publisher should exit when the IPT manager says so.Gabriela Moldovan2024-01-182-7/+13
| | | | | | | | | | | | The publisher needs to shut down when `IptPublisherView::sawait_update()` returns `None`, not pause the uploads.
* | Merge branch 'downgrade-todo' into 'main'Nick Mathewson2024-01-181-1/+1
|\ \ | | | | | | | | | | | | | | | | | | tor-hsservice: Reference #1226 instead of #1219 in a TODO. Closes #1219 See merge request tpo/core/arti!1896
| * | tor-hsservice: Reference #1226 instead of #1219 in a TODO.Gabriela Moldovan2024-01-181-1/+1
| |/ | | | | | | | | | | | | | | `note_publication_attempt` can only fail: * due to an internal error, in which case there is no point in retrying * if `PublishIptSet::save` fails, i.e. if we fail to write to persistent storage (this is #1226)
* | tor-hsservice: Store the StateMgr inside OnionServiceState.Gabriela Moldovan2024-01-182-22/+56
| | | | | | | | | | | | This introduces an internal `OnionServiceStateMgr` trait, which enables us to store the `StateMgr` inside the `OnionServiceState` (without having to parameterize `OnionServiceState` on `S: StateMgr`).
* | tor-hsservice: Add a test for OnionService::onion_name.Gabriela Moldovan2024-01-181-0/+31
| |
* | tor-hsservice: Move onion_name() to OnionServiceState.Gabriela Moldovan2024-01-181-55/+60
| | | | | | | | | | | | | | | | Both `OnionService` and `RunningOnionService` have an `onion_name()` function. To reduce code duplication, we can move `onion_name()` to a new `OnionServiceState` struct (which will grow more state management functions int he future), and make both `*OnionService` structs deref to it.
* | tor-hsservice: Add RunningOnionService::onion_name.Gabriela Moldovan2024-01-181-7/+42
| |
* | tor-hsservice: Add a couple of TODOs for #1247.Gabriela Moldovan2024-01-181-0/+2
| |
* | tor-hsservice: Do not store the StateMgr in OnionService.Gabriela Moldovan2024-01-181-7/+3
| | | | | | | | | | | | | | The `StateMgr` is currently only needed in `launch()`, so we don't really need to store it. This allows us to unparameterize OnionService.
* | tor-hsservice: Remove a couple of resolved TODOs.Gabriela Moldovan2024-01-181-3/+0
| |
* | tor-hsservice: Remove unused state module.Gabriela Moldovan2024-01-182-50/+0
| | | | | | | | | | The functionality previously provided by the so-called `StateMgr` is now part of `OnionService`, so we can remove state.rs altogether.
* | tor-hsservice: Move onion_name() to OnionService.Gabriela Moldovan2024-01-181-0/+12
| | | | | | | | | | | | | | This a modified version of `tor_hsservice::state::StateMgr::onion_name`. `tor_hsservice::state::StateMgr` will soon be abolished. Part of #1220, #1227
* | tor-hsservice: Create a separate RunningOnionService type.Gabriela Moldovan2024-01-182-25/+73
| | | | | | | | | | | | | | | | This will enable us to construct non-launched (but configured) `OnionService`s. We need this, for example, for implementing the `arti hss` CLI command. Part of #1227
* | tor-hsservice: Rename stop() to pause().Gabriela Moldovan2024-01-181-1/+1
|/ | | | Part of #1227
* Merge branch 'is_ipt_failure' into 'main'Nick Mathewson2024-01-171-3/+39
|\ | | | | | | | | | | | | Implement is_ipt_failure better. Closes #1234 See merge request tpo/core/arti!1889
| * Add a note about torspec#249.Nick Mathewson2024-01-171-1/+4
| |
| * Implement is_ipt_failure better.Nick Mathewson2024-01-171-2/+35
| | | | | | | | | | Additionally, explain its behavior better, since we cannot always identify an Ipt failure with certainty.
* | hsservice: Document circ lifetime in OpenSession.Nick Mathewson2024-01-172-5/+9
| | | | | | | | | | Closes #1224, by making it more clear that we aren't keeping a circuit alive indefinitely.
* | ipt_mgr: Remove todo-#1211Nick Mathewson2024-01-161-12/+7
|/ | | | | | All appropriate checks here should be in `is_hs_intro_point()`. Closes #1211.
* Typo fixesgabi-2502024-01-151-2/+2
|
* Downgrade a TODO about dropping unlisted ipts to #1239Nick Mathewson2024-01-131-1/+1
|
* hsservice: Replace TODO comment about intro_established checking with #1238.Nick Mathewson2024-01-131-1/+1
|
* Rename IptEstablisher::{new => launch}Nick Mathewson2024-01-132-3/+2
|
* hsservice: Turn TODOs about ipt_establisher error handling to #1237Nick Mathewson2024-01-131-6/+6
|
* hsservice: Remove TODO HSS about a type that is already Arc.Nick Mathewson2024-01-131-2/+0
|
* hsservice: Replace shutdown-TODO HSS with references to #1236Nick Mathewson2024-01-131-2/+2
|
* Downgrade a TODO about wanting a better API.Nick Mathewson2024-01-131-1/+1
|
* hsservice: Remove an erroneous TODONick Mathewson2024-01-131-1/+1
| | | | | k_sid was not redundant with RequestContext: the latter only held the public key, but the reactor here needed the entire keypair.