summaryrefslogtreecommitdiff
path: root/crates/tor-hsclient/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* HS configuration: Plumb configuration throughIan Jackson2023-06-281-3/+7
| | | | | Invent a trait a la circmgr config for the hs client connector config. Plumb a suitable value all the way through to the code that will use it.
* tor-hsclient: Add a comment about what run_housekeeping doesIan Jackson2023-06-261-0/+1
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1290#note_2915679
* tor-hsclient: Add a debug message about task exitIan Jackson2023-06-261-0/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1290#note_2915678
* tor-hsclient: Comment explaining why no launch_background_tasksIan Jackson2023-06-261-0/+3
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1290#note_2915676
* tor-hsclient: Say we *mustn't* do housekeeping while dormantIan Jackson2023-06-261-2/+2
| | | | | | | | | This is a change to the API docs, but not to the actual code, since our call site is in arti-client and tied to netdir fetch, which *doesn't* happen when dormant. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1290#note_2915677
* tor-hsclient: Expire old data eventuallyIan Jackson2023-06-231-3/+41
| | | | Otherwise we'll fill up our RAM with junk.
* tor-hsclient: Introduce helper function for locking services tableIan Jackson2023-06-221-2/+14
|
* Merge branch 'stderr' into 'main'Alexander Færøy2023-06-211-0/+2
|\ | | | | | | | | lints: Promote clippy::print_stderr and clippy::print_stdout See merge request tpo/core/arti!1271
| * lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
| |
* | tor-hsclient: Drop most allows that are marked for removalIan Jackson2023-06-211-2/+0
| |
* | tor-hsclient: Drop a large number of unneeded importsIan Jackson2023-06-211-1/+0
|/
* keymgr: Move the HS client and service key specifiers out of tor-keymgr.Gabriela Moldovan2023-06-151-1/+4
| | | | | | The HS `HsClientSpecifier` and `HsClientSecretKeySpecifier` are moved to `tor-hsclient`. The HS service secret key specifier stubs are moved to `tor-hsservice`.
* tor-hsclient: Introduce proto_oneshot, to help with message handlingIan Jackson2023-06-131-0/+1
| | | | | This gets rid of a lot of repeated `oneshot::<...<Result, ...>>` and a bit of repeated functional code, etc.
* tor-hsclient: Implement rendezvous setup, and retry frameworkIan Jackson2023-06-091-0/+2
| | | | | | | | | | | | | | | | | | | | | This contains code to: * Iterate over introduction points * Make multiple attempts to connect * Apply timeouts to the various phases of each attempt * Establish a rendezvous point * Represent errors that occur during the above It provides places to add: * Implementation of the INTRODUCE1/INTRODUCE_ACK handshake * Reception of RENDEZVOUS2 and actual end-to-end circuit establishment * Recording of the outcome of connection attempts via particular IPTs * Using previous IPT outcome information for selecting IPTs to try * Tests of the new code (although more mocking will probably be needed) Much of this code works with a fixed type ClientCirc rather than going via the Mockable traits. That is wrong, and it will be fixed later.
* tor-hsclient: errors: Introduce IntroPtIndexIan Jackson2023-06-091-1/+1
| | | | | | We're going to want to report about rendezvous points in errors. We'll do this by printing the "number" of the intro point in the descriptor.
* tor-hsclient: errors: Introduce RendPtIdentityForErrorIan Jackson2023-06-091-0/+1
| | | | | We're going to want to report about rendezvous points in errors. We'll be using this. And we'll want to convert it from a Relay.
* tor-hsclient: Allow dead code for nowIan Jackson2023-06-091-0/+2
| | | | The dead code warnings are a nuisance while this file is half-written.
* tor-hsclient: export InvalidTargetIan Jackson2023-06-091-0/+1
| | | | It's going to appear in our public errors.
* hsclient: Create a CircTarget from an IntroPointDesc.Nick Mathewson2023-06-071-0/+1
| | | | | The main body of this function is written so that we can later use it to create a CircTarget from an INTRODUCE2 message.
* Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-161-1/+1
| | | | | | | | | | | | Now ClientCirc is no longer `Clone`, and the things that need it to be `Clone` instead return and use an Arc<ClientCirc> We're doing this so that ClientCirc can participate in the RPC system, and so that its semantics are more obvious. Closes #846. Thanks to the type system, this was a much simpler refactoring than I had feared it would be.
* hs dirs: Initial cut at descriptor downloadingIan Jackson2023-04-111-1/+1
| | | | | | | | There are many TODOs here. Some are questions; some are straightforward and can be done in followups. With this code, I am able to reach the eprintln! and todo! with curl --socks5-hostname localhost:9150 https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/
* tor-hsclient: Fix a doc link.Nick Mathewson2023-03-301-1/+1
|
* tor-hsconn: Rename ConnError (from HsClientConnError)Ian Jackson2023-03-301-2/+2
| | | | | The old name was unwieldy and other crates can just as well name it by the crate scope.
* tor-client: Pass a netdir for each requestIan Jackson2023-03-301-9/+6
| | | | | This will be more convenient inside tor-hsclient. In arti-client, this mirrors the way TorClient::get_or_launch_exit_circ works.
* Pass HsCircPool to hsclient connect function, not CircMgrIan Jackson2023-03-281-4/+4
| | | | | We separated this out in the circmgr API. This is what the HS client needs. It doesn't want to participate in the general circuit pool.
* tor-hsclient: Have the public API take StreamIsolationIan Jackson2023-03-231-2/+7
|
* tor-hsclient: Document clone-nature of HsClientConnectorIan Jackson2023-03-231-0/+3
|
* hsclient: Discuss HsClientConnector multiplicity/reuseIan Jackson2023-03-011-3/+7
| | | | And delete the associated TODO.
* hsclient: Remove TODOs about circular referencesIan Jackson2023-03-011-10/+0
| | | | | | | | These Arcs are all "downward", referencing items from layers lower in the stack. So they don't cause cycles. There was going to be a cycle involving the `OnionConnector` upcall trait, but we have just abolished that.
* hsclient: Abolish knowledge of HS circuits in circmgrIan Jackson2023-03-011-10/+1
| | | | | | | | | | | Abolish CircMgr::get_or_launch_onion_client and everything to support it. We have decided that `.onion` diversion ccan't/shouldn't occur in tor-circmgr. Probably, it should occur much higher up - arti-client maybe - since it will sometimes need ambient authority (KS_hsc_*). Now all knowledge of HS connections is in tor-hsclient. This gets rid of a layering inversion and the trait needed for tor-circmgr to do the upcall to tor-hsclient.
* hsclient state: Split off MultikeyIsolatedMapIan Jackson2023-03-011-0/+1
|
* hsclient: Clarify period task handle TODOIan Jackson2023-03-011-1/+1
|
* hsclient: Document sharing rulesIan Jackson2023-03-011-0/+4
| | | | | Text largely from https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1034#note_2881638
* hsclient state: Demonstrate that our future is now SendIan Jackson2023-03-011-3/+9
|
* Apply rustfmtIan Jackson2023-03-011-4/+1
|
* hsclient: Use a generic to provide a mock for connect()Ian Jackson2023-03-011-4/+9
| | | | This will allow us to test state.rs.
* hsclient: Apply standard lint blockIan Jackson2023-03-011-1/+37
|
* hsclient: Move dead code allows to specific locationsIan Jackson2023-03-011-1/+1
|
* hsclient: Add vacuous comments as demanded by clippyIan Jackson2023-03-011-0/+1
|
* hsclient: Provide a constructor for HsClientConnectorIan Jackson2023-03-011-10/+16
|
* hsclient: Implement connection attempt tracking state machineIan Jackson2023-03-011-17/+25
| | | | This compiles, but it cannot work yet. Nor can it conveniently be tested.
* hsclient API: Remove notion of ambient keys fromk this layerIan Jackson2023-03-011-5/+0
|
* HS API: Remove HS client keys from circmgr APIIan Jackson2023-03-011-2/+1
| | | | | | | | *If* we're going to retain any HS knowledge in circmgr, it definitely doesn't need to know about per-operation client secrets. (Maybe there might be ambient secrets, used for .onion diversion, but they don't need to be in this API.)
* HS planning: Discuss whether to remove all HS code from circmgrIan Jackson2023-03-011-1/+2
|
* tor-hscrypto: Rename key types to correspond to new spec names.Nick Mathewson2023-02-081-2/+2
|
* Note a needed isolation API.Nick Mathewson2023-01-241-0/+6
|
* Add a new stub hsclient module to connect to onion services.Nick Mathewson2023-01-241-0/+74