summaryrefslogtreecommitdiff
path: root/crates/tor-hsclient
Commit message (Collapse)AuthorAgeFilesLines
* Bump crate versions in preparation for v1.1.5 release.Nick Mathewson2023-06-011-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generated with the following commands: ``` cargo set-version --bump minor -p tor-cell cargo set-version --bump minor -p tor-linkspec cargo set-version --bump minor -p tor-proto cargo set-version --bump minor -p tor-netdoc cargo set-version --bump minor -p tor-circmgr cargo set-version --bump patch -p tor-cert cargo set-version --bump patch -p tor-basic-utils cargo set-version --bump patch -p tor-rpcbase cargo set-version --bump patch -p tor-llcrypto cargo set-version --bump patch -p tor-hscrypto cargo set-version --bump patch -p tor-checkable cargo set-version --bump patch -p tor-async-utils cargo set-version --bump patch -p caret cargo set-version --bump patch -p fs-mistrust cargo set-version --bump patch -p safelog cargo set-version --bump patch -p retry-error cargo set-version --bump patch -p tor-error cargo set-version --bump patch -p tor-config cargo set-version --bump patch -p tor-events cargo set-version --bump patch -p tor-units cargo set-version --bump patch -p tor-rtcompat cargo set-version --bump patch -p tor-rtmock cargo set-version --bump patch -p tor-protover cargo set-version --bump patch -p tor-bytes cargo set-version --bump patch -p tor-socksproto cargo set-version --bump patch -p tor-consdiff cargo set-version --bump patch -p tor-netdir cargo set-version --bump patch -p tor-congestion cargo set-version --bump patch -p tor-persist cargo set-version --bump patch -p tor-chanmgr cargo set-version --bump patch -p tor-ptmgr cargo set-version --bump patch -p tor-guardmgr cargo set-version --bump patch -p tor-dirclient cargo set-version --bump patch -p tor-dirmgr cargo set-version --bump patch -p tor-hsclient cargo set-version --bump patch -p tor-hsservice cargo set-version --bump patch -p arti-client cargo set-version --bump patch -p arti-rpcserver cargo set-version --bump patch -p arti-config cargo set-version --bump patch -p arti-hyper cargo set-version --bump patch -p arti cargo set-version --bump patch -p arti-bench cargo set-version --bump patch -p arti-testing ```
* tor-hsclient: Mockable: Do concrete calls with UFCSIan Jackson2023-05-231-2/+2
| | | | | | | | | | | | Method dispatch rules mean that if the receiver type of the actual function changes, `self.call()` can turn into a purely-recursive call which overflows the stack. Async Rust doesn't have the usual warning for this situation :-(. UFCS is clumsier but doesn't have that problem because it involves much less magical dispatch. Instead of generating a recursive call which overflows the stack, it fails to compile.
* tor-hsclient: Fix MockableClientCirc for ClientCirc changesIan Jackson2023-05-231-3/+3
| | | | | | ClientCirc::begin_dir_stream now takes Arc<Self>. Method resolution rules mean that this code would just recurse, leading to a stack overflow.
* Fix a docs reference to refer to HsClientIntroAuthKeypairIan Jackson2023-05-221-1/+1
| | | | | | | | Fixes warning from cargo -o doc --document-private-items --all-features --workspace This was evidentlhy overlooked during recent replacement of unescorted private keys in the code.
* netdoc, hsclient: Update remaining ed25519::SecretKey usersNick Mathewson2023-05-182-5/+7
| | | | | | Fortunately, these are all in experimental code. Closes #798
* Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-163-16/+18
| | | | | | | | | | | | 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.
* Reformat Cargo.toml files.Nick Mathewson2023-05-151-4/+19
|
* Run fixup-features --no-annotate for initial Cargo.toml fixes.Nick Mathewson2023-05-151-0/+1
| | | | | | | | | This does the following: - Gives every crate a `full`. - Cause every `full` to depend on `full` from the lower-level crates. - Makes every feature listed _directly_ in `experimental` depend on `__is_experimental`.
* hsclient: descriptor_ensure no longer wraps the descriptor in TimerangeBound.Gabriela Moldovan2023-05-131-2/+5
| | | | | | | `descriptor_fetch_attempt` now returns a `TimerangeBound<HsDesc>` (and so does `parse_descript_validate`). Signed-off-by: Gabriela Moldovan <[email protected]>
* hsclient: Compute HsDesc validity time from the TimerangeBounds of its layers.Gabriela Moldovan2023-05-131-25/+13
| | | | | | | This makes `descriptor_ensure` refetch the descriptor if either of its layers (inner or outer) expires. Signed-off-by: Gabriela Moldovan <[email protected]>
* hsclient: Build cached descriptor TimerangeBounds from descriptor lifetime.Gabriela Moldovan2023-05-131-17/+33
| | | | | | | This makes `descriptor_ensure` refetch the descriptor if it has been cached for longer than `descriptor-lifetime` minutes. Signed-off-by: Gabriela Moldovan <[email protected]>
* hsclient: Rename import alias to reflect new name.Gabriela Moldovan2023-05-111-2/+2
| | | | | | A `NetdocErrorKind` is a `NEK` rather than a `PEK`. Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Rename parse_error_kind() to netdoc_error_kind().Gabriela Moldovan2023-05-111-1/+1
| | | | | | | `ParseErrorKind` was renamed to `NetdocErrorKind`, so we need to rename this acccessor too. Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`.Gabriela Moldovan2023-05-101-1/+1
| | | | | | | | | | | `ParseErrorSource` was originally meant to represent a parsing error, this enum has since gained some variants that aren't really parsing related (`Signature`, `CertSignature`, `UntimelyDescriptor`). Since this error type is now used for general-purpose netdoc errors, let's rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`. Signed-off-by: Gabriela Moldovan <[email protected]>
* fix a couple clippy lintstrinity-1686a2023-05-081-1/+1
|
* tor-netdir: Shuffle the list of HS dirs used for downloading descriptors.Gabriela Moldovan2023-05-042-6/+27
| | | | | | | | We'll probably need the hsdir list to be shuffled deterministically for testing purposes (this might be desirable, for example, when we write a test for HS descriptor download retries). Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-netdir: Update tests to parse the descriptor, make test consensus ↵Gabriela Moldovan2023-05-032-9/+61
| | | | | | lifetime configurable. Signed-off-by: Gabriela Moldovan <[email protected]>
* hsclient: Use a real HsDesc instead of an unparsed string.Gabriela Moldovan2023-05-033-18/+43
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* Upgrade tracing to 0.1.36.Nick Mathewson2023-05-031-1/+1
| | | | | | This is the first version to impl Value for String. With luck, this will get minimal_versions CI passing.
* Increment crate versions.Nick Mathewson2023-05-031-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of the errorkind bumps, we're calling this a breaking change in everything lower-level than `arti`. Generated with: ``` cargo set-version -p tor-basic-utils --bump minor cargo set-version -p tor-async-utils --bump minor cargo set-version -p caret --bump minor cargo set-version -p fs-mistrust --bump minor cargo set-version -p safelog --bump minor cargo set-version -p retry-error --bump minor cargo set-version -p tor-error --bump minor cargo set-version -p tor-config --bump minor cargo set-version -p tor-events --bump minor cargo set-version -p tor-units --bump minor cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-rtmock --bump minor cargo set-version -p tor-rpcbase --bump minor cargo set-version -p tor-llcrypto --bump minor cargo set-version -p tor-protover --bump minor cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-hscrypto --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-checkable --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-linkspec --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump minor cargo set-version -p tor-consdiff --bump minor cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-congestion --bump minor cargo set-version -p tor-persist --bump minor cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-ptmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump minor cargo set-version -p tor-dirclient --bump minor cargo set-version -p tor-dirmgr --bump minor cargo set-version -p tor-hsclient --bump minor cargo set-version -p tor-hsservice --bump minor cargo set-version -p arti-client --bump minor cargo set-version -p arti-rpcserver --bump minor cargo set-version -p arti-config --bump minor cargo set-version -p arti-hyper --bump minor cargo set-version -p arti --bump patch cargo set-version -p arti-bench --bump patch cargo set-version -p arti-testing --bump patch ```
* tor-hsclient: Add an allow to this incomplete codeIan Jackson2023-04-121-0/+1
| | | | Fixes CI warning.
* Apply ProtocolViolation renaming to hs connector codeIan Jackson2023-04-121-2/+2
| | | | | | | | | | | !1121 renamed *ProtocolFailed to *ProtocolViolation. !1118 introduced a new reference to a *ProtocolFailed I rebased !1118 onto main and enabled automerge. That tested the tip of !1118. I assume a similar thing happened to !1121. The possibility of such regressions is a property of our workflow. It's rather surprising it doesn't happen more often.
* Use bool::then_some() as appropriateNick Mathewson2023-04-111-1/+1
| | | | | | Now that we require a version of Rust that allows `b.then_some(v)`, clippy complains about our use of `b.then(|| v)`.
* Increment MSRV to 1.65 in every crate.Nick Mathewson2023-04-111-1/+1
|
* hs connect: Improve a todo and refer to #813Ian Jackson2023-04-111-2/+1
|
* hs connect: Add TODOs re improving testsIan Jackson2023-04-111-0/+3
| | | | | Aa per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1118#note_2894467
* hs connect: Add TODO re multiple parallel hsdir requestsIan Jackson2023-04-111-0/+2
|
* hs connect: Improve docs for descriptor_ensureIan Jackson2023-04-111-1/+7
|
* hs connect: Clarify clientness of ContextIan Jackson2023-04-111-1/+1
|
* hs connect tests: check that we asked exactly one relayIan Jackson2023-04-111-6/+6
|
* hs connect tests: derive Default for MocksGlobal, and use itIan Jackson2023-04-111-2/+2
|
* hs connect: Test descriptor downloadIan Jackson2023-04-112-0/+123
|
* hs connect: Do circuitry etc. via mocks traitIan Jackson2023-04-111-7/+59
| | | | | This doesn't change the text of the functional code, but now the methods are indirected via the Mock* traits.
* hs dirs: Initial cut at descriptor downloadingIan Jackson2023-04-114-11/+315
| | | | | | | | 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/
* hs desc: Record a Timebound<HsDesc> (but not really for now)Ian Jackson2023-04-112-6/+11
| | | | | | | | | We have a local alias of `HsDesc = String` which needs to be got rid of. But, right now the alternative would be to implement all the code for signature checking and decryption of an `HsDesc`, before we can make a test case for the downloader part.
* hs connect: Introduce ContextIan Jackson2023-04-111-13/+91
| | | | | This will be convenient as the common context for the descriptor download work, and also for testing.
* Remove "publish = false" from tor-hsclient.arti-v1.1.3Nick Mathewson2023-03-311-2/+0
| | | | It is now a (conditional, experimental) dependency of arti-client.
* Patchlevel bumps for crates whose dependencies just changed.Nick Mathewson2023-03-311-1/+1
| | | | | | | | | | | | | | | | These crates had no changes until just a moment ago. But since we updated the versions on some of their dependents, they have now changed themselves. Thus they get patchlevel bumps. ``` tor-rtmock tor-protover tor-socksproto tor-consdiff tor-chanmgr tor-dirclient tor-hsservice ```
* Bump crate versions that have breaking changesNick Mathewson2023-03-311-1/+1
| | | | | | | | | | These crates have had breaking changes. They are pre-1.0, so they get a minor bump. ``` tor-basic-utils tor-config ```
* Bump patchlevel on crates with non-breaking changesNick Mathewson2023-03-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For these crates, the changes are nontrivial, so we _do_ bump the versions on which their dependent crates depend. Fortunately, since they are all pre-1.0, we don't need to distinguish semver-additions from other changes. (Except for arti, which _is_ post-1.0, but gets a patchlevel bump anyway.) These are unstable crates with breaking changes: ``` tor-hscrypto tor-hsclient ``` These have new or extended APIs: ``` safelog tor-bytes tor-cell tor-linkspec tor-llcrypto tor-proto tor-cert arti-client ``` These have new unstable APIs or features: ``` tor-netdoc tor-circmgr (also broke some unstable APIs) arti (is post-1.0) ``` These have bugfixes only: ``` caret tor-dirmgr ```
* tor-hsclient: Fix a doc link.Nick Mathewson2023-03-301-1/+1
|
* Run rustfmtIan Jackson2023-03-301-13/+14
| | | | Apply this churn, which I deferred for ease of review.
* tor-hsconn: Rename ConnError (from HsClientConnError)Ian Jackson2023-03-304-19/+19
| | | | | 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-303-15/+24
| | | | | This will be more convenient inside tor-hsclient. In arti-client, this mirrors the way TorClient::get_or_launch_exit_circ works.
* Pass HS identity to hsclient connection functionIan Jackson2023-03-282-2/+10
| | | | Obviously it will need this!
* Pass HsCircPool to hsclient connect function, not CircMgrIan Jackson2023-03-282-5/+6
| | | | | 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-proto: Split off send-control-msg featureIan Jackson2023-03-231-1/+1
|
* tor-hsclient: Have the public API take StreamIsolationIan Jackson2023-03-231-2/+7
|
* tor-hsclient: impl HasKind for errorsIan Jackson2023-03-231-1/+20
|
* tor-hsclient: Swap errors so Bug comes lastIan Jackson2023-03-231-4/+4
| | | | This seems more consistent with the way it's done elsewhere.