aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-hsservice: ipt_mgr: Prepare for nonfatal IPT creation errorsIan Jackson2023-12-042-5/+42
| | | | | | | | | Previously IPT creation could only fail due to key generation failures or other kinds of internal error, which were very unlikely and treated as fatal. But with key persistence, IPT creation will be able to fail due to eg disk full.
* tor-hsservice: Define key specifiers for IPT keysIan Jackson2023-12-041-1/+57
|
* tor-hsservice: ipt_set: Store publication timesIan Jackson2023-12-041-16/+101
|
* tor-hsservice: ipt_mgr: Save and load IPT relays etc. (fmt)Ian Jackson2023-12-041-6/+3
|
* tor-hsservice: ipt_mgr: Save and load IPT relays etc.Ian Jackson2023-12-042-10/+155
| | | | | | | | Store the IPT manager's data structure to the provided storage manager. Keys are not persistent yet! And we must save the publication IPT set since it can have the only record of IPT publication times.
* tor-hsservice: ipt_set: Have various methods take a RuntimeIan Jackson2023-12-045-16/+29
| | | | | | | | 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-044-6/+19
| | | | Whitespace changes that make the next commit less noisy.
* tor-hsservice: ipt_set: Provide IptManagerView::borrow_for_read()Ian Jackson2023-12-041-2/+10
| | | | | | | We're about to make borrow_for_update() take a runtime parameter, which will be a bit annoying. borrow_for_read() doesn't need one. Call sites will come on a moment.
* tor-hsservice tests: Use a real storage manager for IPT manager testsIan Jackson2023-12-041-2/+8
|
* 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 tests: Break out MockedIptManager state structIan Jackson2023-12-041-18/+45
| | | | | | | And therefore, break out the IPT manager startup, into a MockedIptManager::start. We can have it borrow the TempDir, legitimising the _untracked call.
* tor-hsservice tests: Use a real keystore for IPT manager testsIan Jackson2023-12-041-54/+4
| | | | | | IPT persistence tests will need to actually save things. We'll fix up the `.into_untracked()` wrinkle shortly.
* tor-hsservice tests: publish: Make run_test take a runtimeIan Jackson2023-12-041-2/+3
| | | | | We're about to need to arrange to have the same runtime earlier, so run_test needs to accept one from the caller.
* tor-hsservice tests: test_temp_dir: Make macro not assume importIan Jackson2023-12-041-1/+1
|
* tor-hsservice: ipt_set: Make ::channel() fallibleIan Jackson2023-12-044-8/+10
| | | | This is going to load the state from disk.
* tor-hsservice: Pass and record storage handlesIan Jackson2023-12-045-13/+75
| | | | | | | | | | | | | | | * 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.
* tor-hsservice: Provide StartupError variants for failed state readsIan Jackson2023-12-041-0/+26
|
* tor-hsservice: Introduce IptStoreErrorIan Jackson2023-12-045-8/+72
| | | | | | | | | | If we can't store IPT details, we mustn't publish the corresponding IPT. But that's not fatal; maybe we can store later. So introduce a new IptStoreError type, and change the return value from some functions that are going to be able to fail that way. This introduces a new TODO HSS: we need the publisher to be able to retry after such a failure.
* Merge branch 'publisher-bug' into 'main'gabi-2502023-12-041-28/+58
|\ | | | | | | | | | | | | tor-hsservice: Measure last_uploaded from when the upload was initiated. Closes #1142, #1130, and #1132 See merge request tpo/core/arti!1787
| * tor-hsservice: Add more details to the last_uploaded docs.Gabriela Moldovan2023-12-041-0/+9
| |
| * tor-hsservice: If upload_all fails, retry after 5min.Gabriela Moldovan2023-12-041-13/+33
| | | | | | | | Fixes #1132
| * tor-hsservice: Update a handful of publisher logs.Gabriela Moldovan2023-12-041-2/+5
| | | | | | | | This promotes some logs to `debug!` and adds some new trace-level logs.
| * tor-hsservice: Remove unnecessary TODO HSS.Gabriela Moldovan2023-12-041-3/+0
| | | | | | | | | | | | | | I don't think we need to do this (rate-limiting/debouncing the uploads in upload_all should be sufficient). Closes #1130
| * tor-hsservice: Rename upload_rate_lim_ to reattempt_upload.Gabriela Moldovan2023-12-041-6/+6
| | | | | | | | | | We're about to use this for retrying failed uploads too (so let's give it a more generic name).
| * tor-hsservice: Reduce the upload rate limit threshold.Gabriela Moldovan2023-12-041-1/+1
| |
| * tor-hsservice: Measure last_uploaded from when the upload was initiated.Gabriela Moldovan2023-12-041-3/+4
| | | | | | | | | | | | | | | | This also fixes an incorrect duration calculation (it should be `now.duration_since(last_uploaded)` rather than `last_uploaded.duration_since(now)`). Fixes #1142
* | tor-hsservice: test_temp_dir: Create the directory in .used_byIan Jackson2023-12-041-1/+10
| | | | | | | | | | The existing callers all use create_dir_all but new callers shouldn't ahve to, eg if they just want a single file.
* | tor-hsservice: Add a TODO about state_dir reconfigurationIan Jackson2023-12-041-0/+3
|/
* Merge branch 'hss-notes' into 'main'Ian Jackson2023-11-303-0/+118
|\ | | | | | | | | hssvc-ipt-algorithms.md: Move and fix up some text See merge request tpo/core/arti!1777
| * tor-hsclient: ipt_establisher: Fix a broken rustdoc linkIan Jackson2023-11-301-1/+1
| | | | | | | | | | | | This rune RUSTDOCFLAGS="-Dwarnings --cfg docsrs" nailing-cargo +nightly doc --all-features --document-private-items --no-deps is clean now.
| * hssvc-ipt-algorithms.md: Fix moved text syntaxIan Jackson2023-11-291-2/+2
| | | | | | | | | | Fixes a rustdoc warning. This was already wrong in the .md file but nothing checked it there.
| * hssvc-ipt-algorithms.md: Move some text to ipt_setIan Jackson2023-11-292-0/+72
| | | | | | | | | | This is describing the detailed algorithm in compute_iptsetstatus_publish. Move it there (and add an xref).
| * hssvc-ipt-algorithms.md: Move some text to ipt_mgrIan Jackson2023-11-292-0/+37
| | | | | | | | | | This is describing the detailed algorithm in idempotently_progress_things_now. Move it there (and add an xref).
| * hssvc-ipt-algorithms.md: Delete rendundant textIan Jackson2023-11-292-0/+9
| | | | | | | | | | | | | | | | This is describing our data structures and IPT states. But we have this documented elsewhere, largely. There are a few sentences here that can usefully be replaced with a bit of extra text in the data structure docs.
* | Merge branch 'semver-breaking-upgrade-of-the-daleks' into 'main'Nick Mathewson2023-11-296-29/+21
|\ \ | | | | | | | | | | | | | | | | | | 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-294-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-296-20/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 'persist-tempdir' into 'main'Ian Jackson2023-11-293-25/+353
|\ \ \ | |/ / |/| | | | | | | | tor-hsservice tests: Introduce new test_temp_dir helper module See merge request tpo/core/arti!1762
| * | tor-hsservice: test_temp_dir: Fix comment syntaxNick Mathewson2023-11-291-1/+1
| | |
| * | tor-hsservice: test_temp_dir: Rename to used_byIan Jackson2023-11-292-4/+4
| | | | | | | | | | | | | | | | | | from obtain_in. As per irc discussion.
| * | tor-hsservice: test_temp_dir: Rename to TestTempDirGuardIan Jackson2023-11-292-6/+6
| | | | | | | | | | | | | | | | | | from UsingTempDir. As per irc discussion.
| * | tor-hsservice: test_temp_dir: Expand on the TODO (fmt)Ian Jackson2023-11-291-1/+0
| | | | | | | | | | | | Mandatory whitespace degradation.
| * | tor-hsservice: test_temp_dir: Expand on the TODOIan Jackson2023-11-291-1/+3
| | |
| * | tor-hsservice test_temp_dir: Add commentary about why do thisIan Jackson2023-11-291-0/+25
| | |
| * | tor-hsservice test_temp_dir: Add more docs about in_obtainIan Jackson2023-11-291-0/+5
| | |
| * | tor-hsservice test_temp_dir: Add docs about early deletion hazardIan Jackson2023-11-291-0/+19
| | |
| * | tor-hsservice test_temp_dir: Make a lifetime explicit (fmt)Ian Jackson2023-11-291-1/+5
| | |
| * | tor-hsservice test_temp_dir: Make a lifetime explicitIan Jackson2023-11-291-1/+1
| | |
| * | tor-hsservice tests: create_keymgr: add a doc commentIan Jackson2023-11-291-0/+1
| | |