summaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src/svc.rs
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'log_hsid_unconditionally' into 'main'Nick Mathewson2023-12-131-14/+20
|\ | | | | | | | | hsservice: Log hsid whether we just generated it or not. See merge request tpo/core/arti!1830
| * tor-hsservice: Retrieve the public hsid for logging purposes.gabi-2502023-12-131-3/+3
| |
| * hsservice: Log hsid whether we just generated it or not.Nick Mathewson2023-12-131-14/+20
| | | | | | | | | | | | With this change you can find your hsid in your logs (if safe logging is off) even if you forgot to notice it the first time around.
* | tor-hsservice: Plumb state dir and its mistrust into ipt_mgrIan Jackson2023-12-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | This is needed for the replay logs. It's a shame that CheckedDir is (i) a bit unergonomic (ii) has an extra bool in it, or we could pass one of those instead of these two arguments. Since HS's might be created after startup, TorClient must have these fields.
* | tor-hsservice tests: replay: Pass nick to create_storage_handles_from_state_mgrIan Jackson2023-12-131-2/+5
| | | | | | | | | | This will allow us to more faithfully model the actual Arti state directory layout.
* | tor-hsservice: Make descriptor publisher wait for shutdown signal.Gabriela Moldovan2023-12-131-0/+1
| | | | | | | | | | | | | | | | The publisher logs a nice `info!` message when it receives the shutdown signal. The publisher can infer that the service is shutting down from the errors received on its various receiver channels (i.e. from the errors that suggest the sender was dropped), but listening for the shutdown signal is nicer.
* | tor-hsservice: Move ShutdownStatus to svc.Gabriela Moldovan2023-12-131-0/+17
|/ | | | | | | This will be used by the descriptor publisher soon (we want to abolish its `ReactorError` altogether, and to do that, we need to get rid of `ReactorError::ShuttingDown`. `ShuttingDown::Terminate` happens to be a suitable replacement).
* Add a "Shutdown" status, and clarify places where status should change.Nick Mathewson2023-12-071-2/+9
|
* Add a status API to OnionService.Nick Mathewson2023-12-071-4/+20
| | | | | | (This doesn't yet send any status events.) Begins work on arti#1083.
* tor-hsservice: Stop the KeystoreSweeper task when the service exits (fmt).Gabriela Moldovan2023-12-051-2/+7
|
* tor-hsservice: Stop the KeystoreSweeper task when the service exits.Gabriela Moldovan2023-12-051-2/+2
|
* tor-hsservice: Make shutdown a broadcast channel.Gabriela Moldovan2023-12-051-3/+3
| | | | | We will soon need another component to be able to subscribe to the shutdown signal.
* tor-hsservice: Add a helper for removing expired keys.Gabriela Moldovan2023-12-051-3/+16
| | | | Closes #1043
* tor-keymgr: Store an owned type instead.Gabriela Moldovan2023-12-051-14/+14
| | | | | | We need this because the key specifier types will soon be owned types too (they will soon grow a From<&KeyPath> impl). We _could_ make them store `Cow`s instead, but I think that's a premature optimization.
* tor-hsservice: ipt_set: Have various methods take a RuntimeIan Jackson2023-12-041-1/+1
| | | | | | | | Actually, a SleepProvider. We will need this for timestamp conversion during loading and saving. channel() needs it to load. note_publication_attempt needs it for saving, as does borrow_for_update.
* tor-hsservice: ipt_set: Have various methods take a Runtime (pre-fmt)Ian Jackson2023-12-041-1/+2
| | | | Whitespace changes that make the next commit less noisy.
* tor-hsservice tests: Break out create_storage_handles_from_state_mgrIan Jackson2023-12-041-2/+9
| | | | We're going to want to reuse this.
* tor-hsservice: ipt_set: Make ::channel() fallibleIan Jackson2023-12-041-1/+1
| | | | This is going to load the state from disk.
* tor-hsservice: Pass and record storage handlesIan Jackson2023-12-041-7/+29
| | | | | | | | | | | | | | | * Introduce type aliases for the Arc<dyn >. Add Send and Sync bounds. * Pass the storage manager to ipt_mgr and the per-key handle to ipt_set. * Store the handles in ipt_mgr::Immutable and IptPublishSet. * Change the ipt mgr storage key to "hs_ipts_{nickname}". This avoids use of "_" as a non-separator, and allows the possibility of other submodules using other storage keys too - and, here, we introduce one. * Provide a dummy struct for the IPT set state, which is needed to define the type alias etc. We'll populate that struct later.
* Merge branch 'semver-breaking-upgrade-of-the-daleks' into 'main'Nick Mathewson2023-11-291-12/+7
|\ | | | | | | | | | | | | Convert to the latest versions of dalek-cryptography Closes #808 See merge request tpo/core/arti!1767
| * llcrypto: Hide the members of ExpandedKeypair.Nick Mathewson2023-11-291-2/+2
| | | | | | | | | | With this change, we no longer expose the ExpandedSecretKey unescorted, which makes it harder to misuse the API.
| * Remove RngCompatExt.Nick Mathewson2023-11-291-2/+1
| | | | | | | | | | | | | | | | | | | | This code was needed with the old version of dalek-cryptography, which wasn't compatible with up-to-date versions of the `rand` crate(s). But now that we've upgraded, we can drop this. (We could have left it around and deprecated it, but we are already making a breaking change to tor-llcrypto by upgrading dalek-cryptography.)
| * Convert to the latest versions of dalek-cryptographyNick Mathewson2023-11-291-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main changes that we have to adjust for are as follows: * In x25519-dalek: * `StaticSecret` is now behind a feature. * `StaticSecret::new` is deprecated in favor of `StaticSecret::random_from_rng`. * StaticSecret no longer does its own clamping. * In ed25519-dalek: * `SecretKey` has (in effect) been renamed to `SigningKey`. The name `SecretKey` is now an alias for `[u8; 32]`. * `SigningKey` is effectively a keypair, since it contains a public key as well. * `PublicKey` has been renamed to `VerifyingKey`. * The functions to extract a signing key and verifying key have been renamed as you might expect. * `ExpandedSecretKey` has been moved to `hasmat` and no longer implements `sign`. * `ExpanededSecretKey` now has as its elements a scalar and a hash prefix. * Various functions that took `&[u8]` now take `&[u8; N]`. * We no longer need a wrapper for older versions of rand. There is a single test in tor-keymgr that does not pass. I've marked it as ignore for now, in hopes that @gabi-250 can help me figure it out. This closes #808. There are several changes I want to make before we merge, however. They are marked with TODO DALEK.
* | tor-hsservice: test_temp_dir: Rename to used_byIan Jackson2023-11-291-1/+1
| | | | | | | | | | | | from obtain_in. As per irc discussion.
* | tor-hsservice: test_temp_dir: Rename to TestTempDirGuardIan Jackson2023-11-291-2/+2
| | | | | | | | | | | | from UsingTempDir. As per irc discussion.
* | tor-hsservice tests: create_keymgr: add a doc commentIan Jackson2023-11-291-0/+1
| |
* | tor-hsservice tests: Make create_keymgr pub(crate)Ian Jackson2023-11-281-2/+2
| | | | | | | | We're going to want this for other tests in this crate.
* | tor-hsservice tests: Change create_keymgr to use TestTempDirIan Jackson2023-11-281-24/+26
|/
* Merge branch 'keymgr-derive-builder' into 'main'gabi-2502023-11-281-2/+7
|\ | | | | | | | | | | | | tor-keymgr: Derive Builder for KeyMgr. Closes #1114 See merge request tpo/core/arti!1760
| * tor-keymgr: Derive Builder for KeyMgr (fmt).Gabriela Moldovan2023-11-271-1/+6
| |
| * tor-keymgr: Derive Builder for KeyMgr.Gabriela Moldovan2023-11-271-2/+2
| | | | | | | | | | | | | | `KeyMgr` is soon going to have more fields, so now is a good time to derive `Builder` for it. Closes #1114
* | tor-hsservice: Remove a done TODOIan Jackson2023-11-271-2/+0
| | | | | | | | This is now in fact plumbed through.
* | tor-hsservice: ipt_set: Make initial state in the constructorIan Jackson2023-11-271-1/+1
|/ | | | | | | | This struct is going to be responsible for loading and storing some persistent state, so it makes sense for it to handle initialisation. This also reduces duplication.
* HSS errors: expose and sort out NetdirProviderShutdown error typeIan Jackson2023-11-201-1/+1
| | | | | | We're going have it in an variant in FatalError. Also make it impl HasKind and have IptError delegate to that.
* tor-hsservice: Define key specifiers using the new helper macro (fmt).Gabriela Moldovan2023-10-301-1/+1
|
* tor-hsservice: Define key specifiers using the new helper macro.Gabriela Moldovan2023-10-301-16/+18
| | | | Closes #1069
* tor-hsservice: Fix hsid being logged inappropriately.Gabriela Moldovan2023-10-191-1/+1
| | | | | | The condition for logging the "generated a new identity.." message was wrong (`generate_with_derive()` returns `Some(())` if it generated a new key, and `None` if the key was already present).
* tor-hsservice: Log newly generated HsIds.Gabriela Moldovan2023-10-191-2/+16
|
* HSS: Add many must_use annotationsIan Jackson2023-10-191-0/+1
|
* tor-hsservice: Give IptManager a KeyMgr.Gabriela Moldovan2023-10-191-0/+1
|
* tor-hsservice: Hoist the key metadata out of HsSvcKeyRole.Gabriela Moldovan2023-10-191-15/+15
| | | | | We will need the string rerpresentation (minus the TimePeriod or any other metadata) of `HsSvcKeyRole`s for building `KeyPathPattern`s.
* tor-hsservice: Narrow some dead code allowsIan Jackson2023-10-161-0/+1
|
* oneshot: Apply deferred rustfmt churnIan Jackson2023-10-111-1/+1
| | | | cargo fmt, precisely.
* oneshot: Use veneer in tor-hsserviceIan Jackson2023-10-111-1/+1
|
* tor-hsservice: Add tests for maybe_generate_hsid.Gabriela Moldovan2023-10-091-0/+189
|
* tor-hsservice: Move hsid generation to a separate function.Gabriela Moldovan2023-10-091-59/+71
|
* tor-hsservice: Make OnionServices auto-generate the hs_id, if it's missing.Gabriela Moldovan2023-10-091-0/+72
|
* Note reconfigure limitations.Nick Mathewson2023-10-051-0/+4
|
* hss: Implement a reconfigure function.Nick Mathewson2023-10-051-3/+17
|
* Merge branch 'configure_onion_service' into 'main'Nick Mathewson2023-10-031-1/+6
|\ | | | | | | | | Initial work on top-level onion service configuration See merge request tpo/core/arti!1638