summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | tor-dirclient: Avoid copying bytes that we want to POST.Nick Mathewson2026-05-125-31/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This required a change to the hsservice tests, which previously assumed that we'd perform one write per request.
| * | | | | | | | | tor-dirclient: Introduce a new RequestBody type.Nick Mathewson2026-05-125-28/+139
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm going to use this to avoid copying when uploading large documents.
* | | | | | | | | tor-netdoc: Rename RouterDesc real items to their real nameClara Engler2026-05-122-19/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the name of all (except accept/reject) real items in RouterDesc to their proper name as found in the spec. This is a breaking change and semver.md has been updated properly. In the instanciation of RouterDesc in the legacy parser, we now use a "weird" syntax of some fields using a different name throughout the code, but that is ok. Changing this would make the diff way larger at the risk of breaking things, especially because many variables such as identity_cert get shadowed countless times within the function, making it harder and error prone to change.
* | | | | | | | | tor-netdoc: Add fancy rustdoc to real RouterDesc itemsClara Engler2026-05-121-22/+64
| | | | | | | | |
* | | | | | | | | tor-netdoc: Reorder real RouterDesc itemsClara Engler2026-05-121-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reorders the real RouterDesc items according to the spec. Unfortunately, the names of those are not real yet, meaning that verifying this is somewhat hard. Personally, I recommend to verify that this commit does not add/remove lines using --color-moved. The correct order is probably easier to verify with the next commit applied that adds nice rustdoc comments explaining to which fields in the spec the respective items belong. This is a bit of a chicken egg situation but if I would have added the nice rustdoc comments first, this diff would have been awful to review, because the hunks of reordering the nice rustdoc comments included are awful to review, so please bear with me for the next commit.
* | | | | | | | | tor-netdoc: Reorder RouterDesc into virtual and real itemsClara Engler2026-05-121-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reorders the RouterDesc struct into virtual and real items, with real items being items that actually exist (although potentially under a different name) in router descriptors. Virtual items on the other hand do not exist this way in router descriptors and have to be removed at one point or another.
* | | | | | | | | tor-netdoc: Add spacing to RouterDescClara Engler2026-05-121-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes this much nicer to read.
* | | | | | | | | Merge branch 'combine-hex' into 'main'Clara Engler2026-05-121-11/+11
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | tor-netdoc: Combine two hex encoding loops into a function See merge request tpo/core/arti!3947
| * | | | | | | | tor-netdoc: Combine two hex encoding loops into a functionIan Jackson2026-05-051-11/+11
| | | | | | | | |
* | | | | | | | | Merge branch 'fslock-redux' into 'main'Nick Mathewson2026-05-118-138/+173
|\ \ \ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | Update code to actually eliminate fslock *and* the LockFile type. See merge request tpo/core/arti!3954
| * | | | | | | | fslock-guard: add a fileapi feature dep for winapiNick Mathewson2026-05-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With dropping the fslock crate, we lost this feature flag from _its_ use of winapi.
| * | | | | | | | fslock-guard: Fix up documentation a bit.Nick Mathewson2026-05-062-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mainly amounts to clarifying some of our windows desiderata, and removing the final refrences to fslock.
| * | | | | | | | fslock-guard: Compile on wasm.Nick Mathewson2026-05-061-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't actually open a file on wasm-unknown-unknown, but it's more convenient for us if we don't have to conditionally compile this crate every place that uses it.
| * | | | | | | | fslock-guard: Remove fslock dependency.Nick Mathewson2026-05-062-25/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can do this since our msrv is now 1.89.0, where File::lock is supported.
| * | | | | | | | Remove users of fslock other than fslock-guard.Nick Mathewson2026-05-065-106/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two that relied on the the ability to have a lock in an unlocked state. Instead, we replace those with Option<LockFileGuard> or its equivalent.
* | | | | | | | | 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.
* | | | | | | | | proto: Derive PartialEq for MetaCellDispositionGabriela Moldovan2026-05-071-1/+1
| | | | | | | | |
* | | | | | | | | 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-072-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.