summaryrefslogtreecommitdiff
path: root/crates/tor-hsclient
Commit message (Collapse)AuthorAgeFilesLines
* Version bumps for 2.5.0Nick Mathewson2026-06-301-36/+36
| | | | | | | | | | | | | Closes #2617. We've lucked out this time, and it turns out that every one of our published crates gets a minor bump. So this was generated with: ``` for cr in $(./maint/list-crates); do cargo set-version -p $cr --bump minor done ```
* Bump MSRV to 1.91Clara Engler2026-06-151-1/+1
| | | | | | | | | | | | | | | | | | | This commit bumps the MSRV to 1.91 which was released on 2025-10-30. The Cargo.toml files were updated as follows: ```sh git ls-files | \ grep ".*Cargo\.toml$" | \ xargs sed -i '' 's/^rust-version = "1\.89"$/rust-version = "1\.91"/g' ``` The following files were updated manually: ``` modified: .gitlab-ci.yml modified: README.md modified: flake.nix modified: maint/docker-android/Dockerfile ```
* Merge branch 'clippy-string-slice' into 'main'Nick Mathewson2026-06-104-0/+5
|\ | | | | | | | | Lint for clippy::string_slice See merge request tpo/core/arti!4086
| * maint: Run maint/add_warning to deny string slicesClara Engler2026-06-094-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* | Bump derive-deftly to 1.11.3Ian Jackson2026-06-091-1/+1
|/ | | | New beta semver policy means we should pin the patchlevel.
* Upgrade tokio to LTS 1.47.1Neel Chauhan2026-06-031-1/+1
| | | | Closes #2137.
* Bump all the unstable tor- and arti- crates to 0.43.0Gabriela Moldovan2026-06-011-31/+31
| | | | | | | | | | Done using: ``` for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.43.0 done ```
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-122-2/+2
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* hsclient: s/cur_revision/stored_revision for clarityGabriela Moldovan2026-05-071-4/+4
| | | | "Stored" is more accurate than "current".
* hsclient: Compare the time periods instead of the blinded HsIdsGabriela Moldovan2026-05-071-6/+7
| | | | | | | The blinded HsIds were used a proxy for the time periods, but it's better to just compare the TPs directly. Part of #966
* hsclient: Store the current time period in a variable (fmt)Gabriela Moldovan2026-05-071-2/+1
|
* hsclient: Store the current time period in a variableGabriela Moldovan2026-05-071-3/+4
| | | | This will soon need to be copied into `HsDescForTp`.
* hsclient: Fix an off-by-one checkGabriela Moldovan2026-05-071-1/+1
| | | | | | We no longer consider the HsDir rate-limited if its `requery == now`. This was caught by the new tests.
* hsclient: Add test for introduction retries after intro NACKGabriela Moldovan2026-05-071-5/+113
|
* hsclient: Add scope around mutex guard (fmt)Gabriela Moldovan2026-05-071-8/+8
|
* hsclient: Add scope around mutex guardGabriela Moldovan2026-05-071-0/+2
| | | | | This needs to be dropped before the next test (because the test will try to acquire the lock inside the `Mocks` impl).
* hsclient: Move test descriptor parsing and decryption to a new functionGabriela Moldovan2026-05-071-18/+21
|
* hsclient: Move HsClientDescEncKeypair building to a new functionGabriela Moldovan2026-05-071-6/+8
| | | | | | We need to build this twice per test (because keypairs aren't `Clone`). I find that putting boilerplate like this in a separate function makes the tests more legible.
* hsclient: Move test netdir setup to a new functionGabriela Moldovan2026-05-071-6/+9
| | | | | I'm trying to reduce the cognitive load of the test a bit, because I will soon extend it so it will grow even more complex.
* hsclient: Make the mock introduce ACKs configurableGabriela Moldovan2026-05-071-6/+17
|
* hsclient: Replace fully-qualified paths with import aliasGabriela Moldovan2026-05-071-13/+11
| | | | I find very long paths a bit hard to read..
* hsclient: Remove no longer applicable commentGabriela Moldovan2026-05-071-2/+0
| | | | The line the comment is referring to for no longer exists.
* hsclient: Unwrap the connect result in testGabriela Moldovan2026-05-071-1/+1
| | | | To ensure it's actually `Ok(())` like we expect.
* hsclient: Remove no longer needed clippy allows in testsGabriela Moldovan2026-05-071-4/+0
|
* hsclient: Remove no longer needed panic handling logic (fmt)Gabriela Moldovan2026-05-071-2/+1
|
* hsclient: Remove no longer needed panic handling logicGabriela Moldovan2026-05-071-4/+2
| | | | `connect()` no longer panics, so we don't need it anymore.
* hsclient: Implement some more of the mock test implsGabriela Moldovan2026-05-071-8/+47
|
* hsclient: Mock the rendezvous handshakeGabriela Moldovan2026-05-071-13/+59
| | | | | Doing this means we wont't need to go through the trouble of building a valid `Rendezvous2` cell in the tests.
* hsclient: Remove unused test functionGabriela Moldovan2026-05-071-9/+0
| | | | | This is used, and is getting in the way a little bit, so I am removing it.
* hsclient: Only compare revision counters for the same TPGabriela Moldovan2026-05-071-20/+8
| | | | | | | If the blinded id has changed since we cached our descriptor, it means the TP has changed, and so we can assume the new descriptor is fresher. Part of #966
* hsclient: Store the HsBlindId alongside the HsDescGabriela Moldovan2026-05-071-4/+23
| | | | | | This enables us to tell whether a newly fetched descriptor's revision counter can be compared with the revision counter of our cached descriptor.
* circmgr,hsclient: s/requery_period/requery_intervalGabriela Moldovan2026-05-071-4/+4
| | | | C Tor calls this a "period", but "interval" is more accurate.
* hsclient: Retain the rust bug link for the borrowck issuesGabriela Moldovan2026-05-071-0/+5
|
* hsclient: Address a clippy suggestion (fmt)Gabriela Moldovan2026-05-071-10/+8
|
* hsclient: Address a clippy suggestionGabriela Moldovan2026-05-071-3/+2
|
* hsclient: Remove TODO suggesting a wrong changeGabriela Moldovan2026-05-071-5/+0
| | | | | | As David mentioned in a review comment, we don't want to refetch the descriptor unless *all* introduction attempts have failed. See https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3925#note_3402810
* hsclient: Reach out to all HsDirs if we have no descriptorGabriela Moldovan2026-05-071-3/+10
| | | | | | | | | | | | | | | If the client doesn't have a timely cached descriptor, then ignore the requery period and reach out to all the HsDirs of the service. This can, in theory, cause the client to unnecessarily query the HsDirs when its cached descriptor has expired, but this would be a very rare event, because the descriptor is long lived. I'm carving out this exception to the usual rate-limiting behavior, because I suspect having the client more eagerly reattempt the connection will be better for UX, (by the time the client's descriptor expires, the service, assuming it's still online, is expected to have published a new one, so IMO it makes sense to try to fetch it).
* hsclient: Rate-limit HsDir re-querying (fmt)Gabriela Moldovan2026-05-071-9/+11
|
* hsclient: Rate-limit HsDir re-queryingGabriela Moldovan2026-05-072-9/+76
| | | | | | | | | | | | Because we now refetch HsDirs on introduce NACK, we need some type of rate-limiting to prevent clients from hammering the HsDirs if the service is offline. This rate-limiting is per-HsDir: the client will avoid querying the same HsDir more frequently than `hs_dir_requery_period`. The HsDir requery info is stored in the new `DataHsDirs` map. Part of #966
* hsclient: Rename intro_target to ids (fmt)Gabriela Moldovan2026-05-071-3/+1
|
* hsclient: Rename intro_target to idsGabriela Moldovan2026-05-071-4/+4
| | | | This is no longer an `&OwnedChanTarget`, so I'm renaming it accordingly.
* hsclient: Make RelayIdFor impl generic over T: HasRelayIdsGabriela Moldovan2026-05-071-2/+2
| | | | | | | The new `RelayIdFor` type alias I'm about to add will need to call `RelayIdFor::{for_lookup, for_store}` with a type that isn't `&OwnedChanTarget`, so I will need these functions to take a generic `HasRelayIds`.
* hsclient: Add a generic RelayIdFor for storing relay informationGabriela Moldovan2026-05-071-5/+29
| | | | | | | | This refactors `RelayIdForExperience` into a more generic `RelayIdFor` type. `RelayIdFor` will serve the basis for another key type that will be used for storing `HsDir` information.
* hsclient: Update comment about hsdesc caching, add TODOGabriela Moldovan2026-05-071-3/+21
|
* hsclient: Use Option<> combinators to get rid of branching (fmt)Gabriela Moldovan2026-05-071-8/+11
|
* hsclient: Use Option<> combinators to get rid of branchingGabriela Moldovan2026-05-071-4/+2
| | | | | | I find having too many of these nested `else { None }` branches makes the overall logic harder to follow, so I changed this to use `Option<>` combinators instead.
* hsclient: Only replace the hsdesc with a more recent one (fmt)Gabriela Moldovan2026-05-071-11/+9
|
* hsclient: Only replace the hsdesc with a more recent oneGabriela Moldovan2026-05-071-6/+36
| | | | | | | | | | | | | This avoids us replacing our cached hsdesc with one that has a lower revision counter. This was not a problem before, because we'd only ever fetch a new descriptor when our cahced one expired, but now that we refetch the descriptor on introduction NACK, we need to make sure the new descriptor is actually more recent than the one we have. The implementation is a bit convoluted because I had to avoid retaining a reference to the known-timely cached `desc` so as not to anger borrowck.
* hsclient: Move HsDesc extraction hack to a closureGabriela Moldovan2026-05-071-7/+11
| | | | This will soon need to be called from two places, unfortunately.
* hsclient: Replace bool with Option<RefetchDescriptor> (fmt)Gabriela Moldovan2026-05-071-1/+5
|