summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | relay: Remove docs type link that are outside scopeDavid Goulet2026-05-281-5/+5
| | | | | | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
| * | | relay: Recompute valid_until cache in view constructorDavid Goulet2026-05-283-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recompute of the valid_until cache is done now in the constructor of FullKeyView so the view is directly usable once built. Else, the caller always need to call the recompute function which is error prone especially when used as a throwaway view. Also, without this change, building the view and then attempting to log the public keys would fail. Signed-off-by: David Goulet <[email protected]>
| * | | relay: Introduce src/task/crypto/keys.rsDavid Goulet2026-05-283-694/+745
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move all key related action function to keys.rs in order to alleviate crypto.rs. The Reactor will get more functionnalities soon so cleanup. No behavior change, just code movement. Related to #2548
| * | | relay: Rename try_rotate_keys_no_lock()David Goulet2026-05-281-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | Remove the _no_lock() since no more locks now. Signed-off-by: David Goulet <[email protected]>
| * | | relay: Make FullKeyView pub(super)David Goulet2026-05-282-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | Now, the FullKeyView is officially only seen by the crypto task. Signed-off-by: David Goulet <[email protected]>
| * | | relay: Remove locking of FullKeyViewDavid Goulet2026-05-282-114/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No need for the valid_until cache locking that used to ensure coherent view accross tasks. As we move towards having the FullKeyView be solely owned by the crypto task, no need for locking. Future commit will introduce a control command channel which will be used to get keys for other tasks. The valid_until cache is kept though because it helps with key lookups to avoid walking all keys each time. Signed-off-by: David Goulet <[email protected]>
| * | | relay: Rename try_generate_keys()David Goulet2026-05-282-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename it to init_keys() so it capture the semantic of initialization especially that now it returns a InitKeyMaterial. This is so we don't use this function outside initialization in the future. Signed-off-by: David Goulet <[email protected]>
| * | | relay: Make FullKewView solely owned by the crypto taskDavid Goulet2026-05-283-61/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves commit makes it that FullKewView is not visible outside the crypto task. For this, we need to keep the KeyMgr in the inert tor relay struct until it is passed to the crypto task. The public keys logging is moved to the run() function of the crypto task and the try_generate_keys() now returns an InitKeyMaterial struct which contains the channel authentication key material (for ChanMgr) and the Ntor keys for the CREATE2 handler. This way, we cut the need of the FullKeyView in the main thread. Related to #2548 Signed-off-by: David Goulet <[email protected]>
* | | | Merge branch 'fslock-guard-android' into 'main'Nick Mathewson2026-05-282-7/+88
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | fslock-guard: Provide specialized android impls. Closes #2544 See merge request tpo/core/arti!4030
| * | | fslock-guard: Provide specialized android impls.Nick Mathewson2026-05-282-5/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need these because `File::lock()` and `File::try_lock()` claim not to work on Android, and have to be emulated with flock. For more information, see <https://github.com/rust-lang/rust/issues/148325>. Closes #2544. Based on code by @syphyr. Co-Authored-By: syphyr <[email protected]>
| * | | fslock-guard: Extract calls to {try_,}lockNick Mathewson2026-05-281-2/+18
| | | | | | | | | | | | | | | | We're about to provide android-only versions of these.
* | | | Merge branch 'patch-1' into 'main'David Goulet2026-05-282-1/+5
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | feat: Make KeystoreEntry::new() public See merge request tpo/core/arti!3288
| * | | | feat: Make KeystoreEntry::new() publicAaron Dewes2025-09-292-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 6958b6c8 changed the way the `Keystore` trait works. The `list` method must now return a `KeystoreEntry`. Before this change, it was essentially impossible to implement keystores outside of `tor-keymgr`. For 3rd party users of the Arti API that want to implement a custom keystore, it became essentially impossible to do so. To make this work again, this commit makes KeystoreEntry::new() public, if the experimental-api feature is enabled.
* | | | | Merge branch 'stream-docs' into 'main'David Goulet2026-05-283-4/+4
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | proto: Replace outdated references to RawCellStream See merge request tpo/core/arti!4036
| * | | | proto: Replace outdated references to RawCellStreamGabriela Moldovan2026-05-283-4/+4
| | |_|/ | |/| | | | | | | | | | | | | | `RawCellStream` was removed long ago, in c559754116678866eabe525f5b189b50cc78b5cc.
* | | | Merge branch 'windows-fileid-check' into 'main'Nick Mathewson2026-05-282-24/+46
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | fslock-guard: Use windows-sys and GetFileInformationByHandleEx. See merge request tpo/core/arti!3974
| * | | | fslock-guard: Use windows-sys and GetFileInformationByHandleEx.Nick Mathewson2026-05-122-24/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike winapi, windows-sys is maintained (by microsoft), and supports more APIs. We use it elsewhere in our tree, but this was our largest usae of winapi. The GetFileInformationByHandleEx variant includes an explicit buffer size to make errors harder, and enables us to get a 128-bit file identifier, which is (supposedly) even more unique than the 64-bit identifiers we were looking at before.
* | | | | tor-netdoc: semver: document Ord implsIan Jackson2026-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The new encoding impls are feature = "incomplete" so don't need to be here.
* | | | | tor-netdoc: implement encoding for votes' `m` itemsIan Jackson2026-05-281-0/+1
| | | | |
* | | | | tor-netdoc: implement encoding for consensus in votes' `m` itemsIan Jackson2026-05-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | We will test this when we test round trip parsing/encoding of votes. For now, mark it as incomplete.
* | | | | tor-netdoc: derive Ord for RouterStatusMdDigestsVoteIan Jackson2026-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sorting by the applicable consensus methods set seems reasonable. The spec doesn't state the order for this. I think that's fine. We can't expect to repro the same consensus with different software, and we will produce stable output.
* | | | | tor-netdoc: derive Ord for IdentifiedDigestIan Jackson2026-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | The upshot is that we will sort digests by alg name.
* | | | | tor-netdoc: derive Ord for ConsensusMethodsIan Jackson2026-05-281-1/+1
| | | | |
* | | | | tor-netdoc: Fix Ord impl for DigestNameIan Jackson2026-05-282-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we are generating documents that need to be stable, we need to generate the same document regardless of what subset of digest names we understand. So order DigestName by its string representation.
* | | | | tor-netdoc: Break out DigestName as AsRef::<str>Ian Jackson2026-05-282-4/+10
| | | | |
* | | | | tor-proto: remove `use asynchronous_codec as futures_codec` in ↵Neel Chauhan2026-05-271-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `/channel/handler.rs` Closes #1690.
* | | | | tor-netdoc: Run rustfmtClara Engler2026-05-271-18/+11
| | | | | | | | | | | | | | | | | | | | No functional change.
* | | | | tor-netdoc: Remove virtual/real distinguishmentClara Engler2026-05-271-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Removes a comment about the virtual/real distinguishment in RouterDesc as there are no virtual items left anymore.
* | | | | tor-netdoc: Remove family_ids from RouterDescClara Engler2026-05-272-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This item is no longer required because we can extract it from family_cert. Unfortunately it requires a breaking change to the getter.
* | | | | tor-netdoc: Add From<Ed25519Identity> for RelayFamilyIdClara Engler2026-05-272-0/+7
| | | | | | | | | | | | | | | | | | | | We will need it in the next commit.
* | | | | tor-netdoc: Add family-cert to RouterDescClara Engler2026-05-272-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the family_cert field to RouterDesc using EmbeddedCert logic. Unfortunately, it requires some code gymnastics similar to the (not yet merged) identity-ed25519 certificates, which we also outlined in a comment of a previous commit in the branch. Long story short: The legacy parser and parse2 do not like to co-exist in the same scope due to the self-consuming tor-cert verification chain of which the legacy parser makes heavy use.
* | | | | tor-netdoc: Return KeyUnknownCert for happy familiesClara Engler2026-05-271-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit modifies the legacy happy families extractor to also return KeyUnknownCert while adding a comment explaining on why this will be required.
* | | | | tor-netdoc: Split inner happy families mapClara Engler2026-05-271-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit splits the inner .map() function of the happy families extractor in the legacy parser. In the next commit, we will return both of these variables separately, but for now this change has no functional change and only looks redundant.
* | | | | tor-netdoc: Move typespec in legacy parserClara Engler2026-05-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | We will change the type in the next commit and this will make auditing the next commits easier.
* | | | | Merge branch 'relay-weight' into 'main'Ian Jackson2026-05-2711-58/+287
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | tor-netdoc: encoding support for `w` line in routerstatus See merge request tpo/core/arti!3991
| * | | | | tor-netdoc: semver.md: document RelayWeightsItem changeIan Jackson2026-05-271-0/+1
| | | | | |
| * | | | | tor-netdoc: More explanation about RelayWeightsItem parsingIan Jackson2026-05-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3991#note_3413169
| * | | | | tor-netdoc: Rename RelayWeights to RelayWeightsItemIan Jackson2026-05-276-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3991#note_3413168
| * | | | | tor-netdoc: Apply deferred rustfmt churn to use linesIan Jackson2026-05-271-2/+2
| | | | | |
| * | | | | tor-netdoc: RelayWeights: implement encodingIan Jackson2026-05-271-0/+17
| | | | | |
| * | | | | tor-netdoc: RelayWeights: provide some constructorsIan Jackson2026-05-271-2/+42
| | | | | | | | | | | | | | | | | | | | | | | | In the form of trait impls.
| * | | | | tor-netdoc: RelayWeights: put code in a more sane orderIan Jackson2026-05-271-23/+21
| | | | | |
| * | | | | tor-netdoc: Introduce RelayWeights and use it in RouterStatusIan Jackson2026-05-276-31/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For encoding, we need to represent the raw parameters. This change is carefully arranged so that when the retain unknown feature is disabled (ie, in clients), the per-router data structure remains the same.
| * | | | | tor-netdoc: Introduce RelayWeights and use it in RouterStatus (pre)Ian Jackson2026-05-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Minor change which will make the next diff clearer.
| * | | | | tor-netdoc: use TryFrom impl in RelayWeight parserIan Jackson2026-05-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the error handling a bit more regular. It will also make the code suit our further parsing changes better.
| * | | | | tor-netdoc: impl TryFrom<&NetParams<u32>> for RelayWeightIan Jackson2026-05-272-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the from_net_params constructor into a TryFrom. Retain the bespoke method for the benefit of the old parser.
| * | | | | tor-netdoc: Unknown: provide into_retained even when retained disabledIan Jackson2026-05-272-1/+2
| | | | | |
| * | | | | tor-netdoc: impl encoding and parsing for NetParams<T>Ian Jackson2026-05-272-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not just NetParams<i32>. We're going to want it for NetParams<u32> in a moment.
| * | | | | tor-netdoc: NetdocParseableFields: Pass ItemStream to finishIan Jackson2026-05-275-8/+24
| | | | | |
| * | | | | tor-netdoc: implement encoding for rs::SoftwareVersionIan Jackson2026-05-272-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Call the existing string encoding code.