aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge branch 'publisher-tests' into 'main'gabi-2502023-10-035-159/+658
|\| | | |/ |/| | | | | tor-hsservice: Fix hsdesc publisher bugs, add tests See merge request tpo/core/arti!1634
| * tor-hsservice: Add tests for the descriptor publisher.Gabriela Moldovan2023-10-031-1/+444
| |
| * tor-hsservice: Make the upload fail if the HSDir responds with an error.Gabriela Moldovan2023-10-031-1/+2
| |
| * tor-hsservice: Do not discard the error source.Gabriela Moldovan2023-10-031-3/+3
| | | | | | | | | | We were previously converting the RequestFailedError to a RequestError, which discards the error source.
| * tor-hsservice: Mock the client circ and data stream.Gabriela Moldovan2023-10-031-2/+26
| |
| * tor-hsservice: Abort the upload task if all HSDirs have the latest descriptor.Gabriela Moldovan2023-10-031-0/+5
| |
| * tor-hsservice: Rewrite map() as a for-loop (fmt).Gabriela Moldovan2023-10-031-110/+110
| |
| * tor-hsservice: Rewrite map() as a for-loop.Gabriela Moldovan2023-10-031-8/+2
| | | | | | | | | | This fixes a clippy complexity warning. It also makes the code more readable, IMO.
| * tor-hsservice: Add trace-level logs for the desc publisher.Gabriela Moldovan2023-10-031-0/+10
| |
| * tor-hsservice: Fix deadlock.Gabriela Moldovan2023-10-031-13/+8
| | | | | | | | | | | | | | | | | | When called by `Reactor::upload_all()`, `Reactor::netdir()` deadlocks (`netdir()` needs to acquire the `inner` lock, but `inner` is already held by `upload_all`). Since `netdir()` is only called in `upload_all()`, let's fix the deadlock by inlining it at the callsite.
| * tor-hsservice: Fix publisher state not being updated.Gabriela Moldovan2023-10-031-9/+26
| | | | | | | | | | | | | | | | The publisher was stuck in the `AwaitingIpts` state because of a logic bug in the `update_publisher_state` function. The publisher now breaks out of the `AwaitingIpts` state upon receiving new IPTs from the IPT manager.
| * tor-hsservice: Log a warning if the publisher reactor shuts down.Gabriela Moldovan2023-10-032-3/+8
| |
| * tor-hsservice: Rename the real version of the publisher mockable state.Gabriela Moldovan2023-10-033-15/+7
| | | | | | | | | | This renames `ReactorState` to `Real`, for consistency with `ipt_mgr`, which calls the real version of its mockable state `Real`.
| * tor-hsservice: Make the publisher generic over the mockable state (circpool ↵Gabriela Moldovan2023-10-033-16/+20
| | | | | | | | provider).
| * tor-hsservice: Add more key roles.Gabriela Moldovan2023-10-031-0/+11
| | | | | | | | | | | | This adds a couple of new `HsSvcKeyRoles` for: * `KS_hs_id` keypairs * `KP_hs_blind_id` public keys keys
| * tor-hsservice: Remove unnecessary allow annotations.Gabriela Moldovan2023-10-031-2/+0
| |
* | tor-hsservice: Provide IptsPublisherUploadViewIan Jackson2023-10-031-0/+42
|/
* hss: Remove OnionServiceDataStram type.Nick Mathewson2023-09-272-18/+4
| | | | | | | I think that the reason we added this was in case we needed different behavior from DataStream; but on reflection it does seem that we don't. Having a single type here will make things a bit simpler.
* hss: Implement methodss for StreamRequestNick Mathewson2023-09-271-7/+24
|
* hss: implement HasKind for several errors.Nick Mathewson2023-09-272-1/+50
|
* hss: helper to get a stream of StreamReq from a stream of RendReq.Nick Mathewson2023-09-273-0/+34
| | | | | | This isn't very much code, but given how long it took me to write this and make it typecheck, I suspect that others may find it useful as well.
* hss: actually provide a stream of RendRequest from launch().Nick Mathewson2023-09-271-12/+22
|
* tor-proto: Make allow_stream_requests() not return a ResultNick Mathewson2023-09-272-12/+6
| | | | | | | The function never yields anything but an `Ok`, so we can simplify its type. (Not a stable feature, so no semver entry needed)
* tor-hsservice: Document that time_periods is empty until Reactor::run is called.Gabriela Moldovan2023-09-271-0/+2
|
* tor-hsservice: Remove unused publisher error module.Gabriela Moldovan2023-09-272-45/+0
| | | | | The `Publisher` now returns a `StartupError` if it fails so launch, so we don't need `PublisherError` anymore.
* tor-hsservice: Make Publisher::launch return a StartupError.Gabriela Moldovan2023-09-273-18/+7
| | | | | | This simplifies error handling in `OnionService`. Closes #1052
* tor-hsservice: Make Launchable a non-async trait.Gabriela Moldovan2023-09-271-7/+4
| | | | | This doesn't need to be an async_trait now that `Publisher::launch` is no longer async.
* tor-hsservice: Make Publisher::launch non-async.Gabriela Moldovan2023-09-273-12/+6
| | | | | | Fixes #1052 See also the discussion in !1616
* tor-hsservice: Initialize netdir in Reactor::run.Gabriela Moldovan2023-09-271-16/+44
| | | | This will enable us to make `Publisher::launch` non-async.
* tor-hsservice: Specify the expiry for the hs_desc_sign_cert.Gabriela Moldovan2023-09-271-3/+4
| | | | | | | Like the other certificates, the descriptor signing key certificate should have a lifetime of `HS_DESC_CERT_LIFETIME_SEC` seconds (at least, this is what C-Tor does. See build_desc_signing_key_cert() in feature/hs/hs_service.c).
* tor-hsservice: Make HsSvcKeySpecifier borrow the nickname.Gabriela Moldovan2023-09-272-9/+9
| | | | This helps avoid cloning the nickname unnecessarily.
* tor-hsservice: Use the nickname from the OnionServiceConfig.Gabriela Moldovan2023-09-271-3/+3
| | | | | The publisher can just read the nickname of the service from its `OnionServiceConfig`.
* Merge branch 'service-api' into 'main'Nick Mathewson2023-09-272-2/+16
|\ | | | | | | | | arti-client: sketch out an initial "launch an onion service" API. See merge request tpo/core/arti!1620
| * hss: Implement HasKind for StartupErrorNick Mathewson2023-09-261-1/+15
| |
| * hss: Make launch() non-consuming.Nick Mathewson2023-09-261-1/+1
| | | | | | | | | | We want to still have the OnionService kicking around, so we can use it as a handle.
* | Merge branch 'worst-case-end' into 'main'Nick Mathewson2023-09-271-34/+85
|\ \ | | | | | | | | | | | | or-hsservice: Set a timeout for desc upload tasks. See merge request tpo/core/arti!1623
| * | tor-hsservice: Set a timeout for the upload task.Gabriela Moldovan2023-09-271-19/+48
| | | | | | | | | | | | | | | | | | | | | The IPT manager needs to know how long the publication attempt will take in the worst case, so we add a timeout for the upload task. Part of #1050
| * | tor-hsservice: Explain how note_publication_attempt is not called in the ↵Gabriela Moldovan2023-09-271-0/+23
| | | | | | | | | | | | right place.
| * | tor-hsservice: Fix descriptor reactor lifetime bugs.Gabriela Moldovan2023-09-271-20/+14
| | | | | | | | | | | | | | | The problem was that several variables were borrowed in the spawned async block.
| * | tor-hsservice: Describe the lifetime bug from Reactor::upload_all.Gabriela Moldovan2023-09-271-0/+5
| |/
* / tor-hsservice: Remove unnecessary TODO.Gabriela Moldovan2023-09-261-8/+3
|/ | | | | `Ipt` _is_ `IntroPointDesc`, so we don't need `build_intro_point_desc()` at all.
* Merge branch 'pad_intro2' into 'main'Nick Mathewson2023-09-251-3/+4
|\ | | | | | | | | | | | | Accept and transmit padding in introduce2 plaintexts Closes #1031 See merge request tpo/core/arti!1602
| * HSS: accept padding at the end of an introduce2 encrypted payloadNick Mathewson2023-09-181-3/+4
| | | | | | | | | | According to rend-spec, we intentionally accept and discard extra bytes here.
* | tor-hsservice: Add TODO about MissingKeys errors.Gabriela Moldovan2023-09-222-0/+31
| |
* | tor-hsservice: Make keys.rs a top-level module.Gabriela Moldovan2023-09-225-5/+4
| |
* | tor-hsservice: Make the caller of build_sign calculate `now()`.Gabriela Moldovan2023-09-222-6/+7
| |
* | tor-hsservice: Add TODO regarding the KeySpecifier::ctor_path()s of service ↵Gabriela Moldovan2023-09-221-0/+5
| | | | | | | | keys.
* | tor-hsservice: Use "hs" instead of "service" the ArtiPaths of services.Gabriela Moldovan2023-09-221-1/+1
| |
* | tor-hsservice: Add some derives for HsSvcKeySpecifier.Gabriela Moldovan2023-09-221-0/+1
| |
* | tor-hsservice: Remove unnecessary placeholder struct.Gabriela Moldovan2023-09-221-15/+0
| | | | | | | | | | | | This cert should've an Ed25519Cert anyway (but the descriptor publisher doesn't need to worry about the `intro_{auth, enc}_key_cert` certs because they will be generated internally by `HsDescBuilder`.