aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src/ipt_mgr.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* | Remove RngCompatExt.Nick Mathewson2023-11-291-2/+2
| | | | | | | | | | | | | | | | | | | | 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-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 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-2/+7
| |
| * 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
* | Merge branch 'hss-debug-serde' into 'main'Ian Jackson2023-11-281-2/+27
|\ \ | | | | | | | | | | | | tor-hsservice: improve Debug and serde See merge request tpo/core/arti!1765
| * | tor-hsservice: Bespoke Debug impl for IptRelayIan Jackson2023-11-271-2/+27
| |/ | | | | | | | | I found myself wanting to dump the IPT manager state in debug output and the default Rust output was far too verbose.
* | tor-hsservice: import_new_expiry_times: Add another xrefIan Jackson2023-11-271-0/+5
| |
* | tor-hsservice: ipt_mgr: Split out start_establisherIan Jackson2023-11-271-13/+46
| | | | | | | | We're going to need to call this on startup to reestablish existing IPTs.
* | tor-hsservice: Make import_new_expiry_times not take &mut IptManager (fmt)Ian Jackson2023-11-271-3/+1
| |
* | tor-hsservice: Make import_new_expiry_times not take &mut IptManagerIan Jackson2023-11-271-5/+3
| | | | | | | | | | We are going to want to call this during startup, when we don't have an IptManager yet.
* | tor-hsservice: Soup up plumbing for ipt_relay_rotation_timeIan Jackson2023-11-271-10/+1
| | | | | | | | | | This will mean if we refer to it in more places, we'll still only have one place to change it.
* | tor-hsservice: ipt_mgr: Move nascent state records into mod persistIan Jackson2023-11-271-27/+2
| | | | | | | | | | Let's avoid cluttering the core algorithm file with this, which is going to expand.
* | tor-hsservice: Use Instant for planned_retirementIan Jackson2023-11-271-6/+4
| | | | | | | | We're going to use time_store, which works nicely with Instants.
* | tor-hsservice: Mockable: Don't pass an explicit keymgr any more (fmt)Ian Jackson2023-11-271-5/+1
| |
* | tor-hsservice: Mockable: Don't pass an explicit keymgr any moreIan Jackson2023-11-271-7/+2
| | | | | | | | There's a keymgr in imm now, so just use that.
* | tor-hsservice: ipt_mgr: Move KeyMgr to ImmutableIan Jackson2023-11-271-7/+6
| | | | | | | | As per the TODO.
* | tor-hsservice: ipt_set: Change last_descriptor_expiry_including_slop (fmt)Ian Jackson2023-11-271-3/+3
| | | | | | | | Mandatory format degradation.
* | tor-hsservice: ipt_set: Change last_descriptor_expiry_including_slopIan Jackson2023-11-271-16/+43
| | | | | | | | Prepare for persistence.
* | tor-hsservice: ipt_set: Make PublishIptSet a structIan Jackson2023-11-271-8/+8
| | | | | | | | | | We're going to add another field here. No functional change, just much churn.
* | 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: pipe config watchers into ipt_establish.Nick Mathewson2023-11-201-8/+9
| | | | | | We want the configuration, at least, so that we can see our DoS settings. I expect we'll also want the watcher so that we can see _changes_ in the DoS settings.
* hss::svc::ipt_establish: Resolve suppressed warnings.Nick Mathewson2023-10-241-10/+6
|
* tor-hsservice: Fix downcastIan Jackson2023-10-191-1/+1
| | | | | | | Downcasting is tricksy. We need to try the downcast on a type-erased &IptEstablisher, not &Box<dyn Any>, and if we don't dereference nothing tells us it's wrong since &Box<dyn Any> also implements and we end up with &Box<dyn Any> as &dyn Any.
* tor-hsservice: Add a TODO for logging HS statusIan Jackson2023-10-191-0/+6
|
* tor-hsservice: Adjust log level of IPT relay choice failureIan Jackson2023-10-191-6/+15
| | | | | | If it's due to lack of useable netdir, that's normal during startup, so don't log it. Hopefully something else somewhere will log if a consensus can't be obtained.
* tor-hsservice: Bump log level of main termination messageIan Jackson2023-10-191-2/+2
|
* tor-hsservice: impl HasKind for ChooseIptErrorIan Jackson2023-10-191-1/+14
| | | | We want to pass one of these to info_report!, which demands HasKind.
* Merge branch 'hs-fixes-2' into 'main'Alexander Færøy2023-10-191-21/+30
|\ | | | | | | | | tor-hsservice: ipt_mgr: Track notional estab started for faulty IPTs See merge request tpo/core/arti!1686
| * tor-hsservice: ipt_mgr: Track notional estab started for faulty IPTs (fmt)Ian Jackson2023-10-181-8/+10
| |
| * tor-hsservice: ipt_mgr: Track notional estab started for faulty IPTsIan Jackson2023-10-181-12/+19
| | | | | | | | An IPT can go from Faulty to Good.
| * tor-hsservice: ipt_mgr: Prepare for TS::Faulty to contain dataIan Jackson2023-10-181-4/+4
| |
* | tor-hsservice: Add TODO about putting keymgr in the immutable state.Gabriela Moldovan2023-10-191-0/+1
| |
* | tor-hsservice: Pass the service nickname to IptEstablisher.Gabriela Moldovan2023-10-191-1/+7
| |
* | tor-hsservice: Pass the service nickname to IptEstablisher (fmt).Gabriela Moldovan2023-10-191-1/+1
| | | | | | | | The nickname is needed for retrieving keys from the keystore.
* | tor-hsservice: Give IptManager a KeyMgr.Gabriela Moldovan2023-10-191-4/+70
|/
* tor-hsservice: ipt_mgr: Tolerate complexity warning for nowIan Jackson2023-10-161-0/+1
| | | | And add a TODO HSS for improving it.
* tor-hsservice: Apply mandatory code formatting worseningIan Jackson2023-10-161-16/+46
|
* tor-hsservice: ipt_mgr: Add a test caseIan Jackson2023-10-161-0/+169
| | | | | This doesn't test all the code paths, but it does test the main path of execution (and detected a couple of bugs).
* tor-hsservice: ipt_mgr: Adjust API for mock RNGIan Jackson2023-10-161-4/+4
| | | | | We're want to be able to return a mutable borrow of a field in the mock state. This means we must make `Rng` a GAT.
* tor-hsservice: ipt_mgr: Improve waiting publish messageIan Jackson2023-10-161-10/+18
| | | | | | This involves plumbing the duration through. Also it involved breaking out the multiplication by two into an addition, since if we were to change the factor we'd want to print the scaled value.
* tor-hsservice: ipt_mgr: Add several debug/trace messagesIan Jackson2023-10-161-4/+22
| | | | | We're going to improve the "establishing_very_recently" one in a moment.
* tor-hsservice: ipt_mgr: Fix a message styleIan Jackson2023-10-161-1/+2
| | | | | Add a colon. This is going to be the style for our trace and debug output.
* tor-hsservice: ipt_mgr: Avoid looping with a zero timeoutIan Jackson2023-10-161-0/+3
| | | | | If the time we're supposed to wait is zero, something has gone wrong. We'd probably just go round again and loop indefinitely.
* tor-hsservice: ipt_mgr: Apply a limit to loopingIan Jackson2023-10-161-0/+10
| | | | This is a backstop to stop us just spinning. Instead, we crash.
* tor-hsservice: ipt_mgr: Actually wait for (fast-ish) IPTsIan Jackson2023-10-161-0/+4
| | | | | We never called the `started_establishing_very_recently` machinery. Do so.
* tor-hsservice: ipt_mgr: Remove vestigial expiry time code (2)Ian Jackson2023-10-161-10/+1
| | | | | lifetime is passed in the IptSet and doesn't want to be made absolute here.
* tor-hsservice: ipt_mgr: Remove vestigial expiry time codeIan Jackson2023-10-161-4/+0
| | | | | | | This calculation is now done elsewhere: the addition of IPT_PUBLISH_EXPIRY_SLOP happens in IptSet::note_publication_attempt and the storage in the manager's data structure is done by IptManager::import_new_expiry_times.
* tor-hsservice: ipt_mgr: Mark an argument as unusedIan Jackson2023-10-161-1/+1
|
* hss: use Arc to avoid copying on k_hss_ntor.Nick Mathewson2023-10-121-10/+3
| | | | (We try to avoid making tons and tons of copies of a secret key.)