summaryrefslogtreecommitdiff
path: root/crates/tor-hsclient
Commit message (Collapse)AuthorAgeFilesLines
* Bump versions for tor-* and arti-* cratesSteven Engler2026-08-031-31/+31
| | | | | | | ```bash readarray -t bump < <(maint/list-crates | grep -P '^tor-|^arti-') for crate in "${bump[@]}"; do cargo set-version --bump minor -p "${crate}"; done ```
* Merge branch 'testdata-export' into 'main'Ian Jackson2026-07-271-1/+1
|\ | | | | | | | | tor-netdoc testdata-live: Export for the benefit of other crates See merge request tpo/core/arti!4229
| * Require derive-deftly 1.11.4Ian Jackson2026-07-231-1/+1
| | | | | | | | | | | | | | | | | | We're about to *use* the fix that was in 1.11.4. We already updated the lockfile in !4228, so this is just Cargo.toml changes (which will prevent the minimal-versions tests failing when we change the code to rely on the fix). git-grep -l '^derive-deftly' |xargs perl -i~ -pe 's{\b\Q1.11.3\E\b}{1.11.4}g'
* | tor-hsclient: connect.rs: Remove a redundant map_errIan Jackson2026-07-231-2/+1
| |
* | HsDesc::parse_decrypt_validate: Don't check validity timeIan Jackson2026-07-232-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function returns a `TimeRangeBound`. That implies a responsibility on the caller to check the time. It doesn't make sense for this function to do the check as well. But, it turns out that in tor-hsclient, the `TimeRangeBound<HsDesc>` is sometimes processed with `.dangerously` on the assumption that it was checked earlier. I considered changing this, and storing plain `HsDesc` and a separate `TimeRange` - but that's not right, because there are places where the `TimeRangeBound<HsDesc>` is used well after it was verified. Instead, in this commit, I (effectively) move the `.check_valid_at` call from `parse_decrypt_validate` to its principal call site. This involves a change to the error representation. Previously, validity time errors ended up as `DescriptorErrorDetail::Descriptor` containing an `HsDescError::OuterValidation` HsDescError:: InnerValidation`, which in turn contains a `tor_netdoc::Error`. (`tor_netdoc::Error` is a rather awkward type.) Now we have our own error variant. The overall behaviour is unchanged.
* | clippy config: Forbid TimeRangeBound::if_valid_nowIan Jackson2026-07-231-0/+1
| |
* | tor-checkable: Rename `TimeBound::check_valid_*` to `if_valid_*`Ian Jackson2026-07-232-3/+3
| | | | | | | | | | | | | | I find these names confusing. To my mind "check" implies a function returning `Result<(), _>`. Some other APIs use `unwrap` here but I think `if` is good.
* | tor-checkable: TimeRangeBound: Rename bounds to bounds_start_endIan Jackson2026-07-231-2/+2
|/ | | | | | | | | | This just returns a tuple. We're going to introduce a new method that returns a `TimeRagne` and will want to be called `bounds`. That method will want to be in the `TimeBound` trait, but for now we add it here. Various call sites will be added in forthcoming commits.
* Use new TimeRangeBound name throughout the treeIan Jackson2026-07-162-6/+6
|
* Use new TimeBound name throughout the treeIan Jackson2026-07-162-2/+2
|
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-2/+0
|
* add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
|
* Removed unnecessary lintpryty262026-07-152-2/+2
| | | | Removed unnecessary lint
* Change HS descriptor sendme_inc into a NonZeroU8Nick Mathewson2026-07-022-2/+2
| | | | | This saves us from having to check whether it is 0, and better represents what the type is allowed to be.
* hs: Add a TODO about #2598 refactoringNick Mathewson2026-07-021-0/+3
|
* Do not incluede negotiate_subproto in subproto_requestNick Mathewson2026-07-021-2/+1
| | | | | | | I had incorrectly thought that this was necessary. Fortunately, @opara looked at the spec. :) We do, however, still need to _advertise_ negotiate_subproto.
* hsclient: Support protocol negotiation for CGO and flowctrl-ccNick Mathewson2026-07-025-13/+196
|
* Upgrade to itertools 0.15.0Nick Mathewson2026-07-011-1/+1
| | | | | | Additionally, fix itertools usage in maybenot_padding.rs The definition of `Position` changed in 0.15.0.
* 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.