aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc
Commit message (Collapse)AuthorAgeFilesLines
...
* | | tor-netdoc: Add hibernating field to RouterDescClara Engler2026-06-032-0/+9
|/ /
* | Merge branch 'netdoc-unverified-trait-name' into 'main'Clara Engler2026-06-038-22/+23
|\ \ | | | | | | | | | | | | tor-netdoc Rename NetdocUnverified trait to NetdocParseableUnverified See merge request tpo/core/arti!4043
| * | tor-netdoc: Add crate:: to docs xrefs to avoid broken linksIan Jackson2026-06-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, it is only correct to write [`NetdocParseableUnverified`](derive_deftly_template_NetdocParseableUnverified), *after* the definition of that template. Before then, the macro isn't in scope. Worse, rustdoc just treats it as a filename and doesn't spot the link, so you don't get any kind of warning. I think this is an upstream bug, https://github.com/rust-lang/rust/issues/157304 I found rustdoc's behaviour capricious. I don't intend to go through the arti tree right now looking for similar patterns. Instead let's hope the upstream bug gets fixed, and in the meantime do this crate:: thing when we notice we need it.
| * | tor-netdoc: Rename NetdocUnverified trait to NetdocParseableUnverified (fmt)Ian Jackson2026-06-022-6/+6
| | |
| * | tor-netdoc: Rename NetdocUnverified trait to NetdocParseableUnverifiedIan Jackson2026-06-028-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NetdocParseableUnverified derive macro implements this trait (amongst other things). Traits and derive macros should have aligned names. This is only used for parsing, so let's keep the "Parseable" part of the name. I don't think the effort of deprecated alias, for downstream compatibility, is worth it, our compatibility policy notwithstanding.
| * | tor-netdoc: Fix two references to NetdocUnverified d-d templateIan Jackson2026-06-021-2/+2
| |/ | | | | | | | | | | | | The trait is called NetdocUnverified, but the template is NetdocParseableUnverified. This fixes a dead docs link (which somehow isn't spotted by rustdoc, but is instead taken to refer to a nonexistent file).
* | tor-netdoc: ns_variety_definition_macros: Use coherent orderingIan Jackson2026-06-021-7/+7
| | | | | | | | | | | | | | | | At some earlier point in the development of this scheme, the ordering was different (as it is in poc). Update all the references in the docs, to the various varieties, so that they are always plain, md, vote, like ns_type! et al take.
* | tor-netdoc: ns_variety_definition_macros: Minor grammar fixIan Jackson2026-06-021-1/+1
| |
* | tor-netdoc: Remove a TODO that we've doneIan Jackson2026-06-021-1/+0
|/ | | | We do now support encoding.
* tor-netdoc: Add spec link for RelayPlatformClara Engler2026-06-021-0/+3
|
* tor-netdoc: Round-trip test for RelayPlatform encodingClara Engler2026-06-021-0/+7
|
* tor-netdoc: Implement Display for RelayPlatformClara Engler2026-06-022-0/+12
|
* tor-netdoc: Store platform of TorVersion in Option (fmt)Clara Engler2026-06-021-1/+3
| | | | No functional change, just rustfmt.
* tor-netdoc: Store platform of TorVersion in OptionClara Engler2026-06-022-7/+8
| | | | | | | | | This commit changes RelayPlatform::TorVersion to store the platform to an Option<String> instead of a String because storing a missing/not present platform as the empty String feels wrong in my opinion. Besides, we will soon need to add encoding for this type, making now a good time to change it.
* tor-netdoc: Refactor RelayPlatform testsClara Engler2026-06-021-21/+28
| | | | | | | | | | | | | | | This refactors the RelayPlatform test to store the test vectors in an array and iterate over it, comparing it with the expected output. This is a lot better than the current version, where there is not just a lot of copy and pasted code but also some tests that only check for an okay value. Unfortunately, there is not an easy way to review this with --color-moved or something. Personally, I would recommend to review each original test vector (i.e. a line starting with `let p =` followed by a string literal) and verify that the exact same string literal is still present within the new test vector. Afterwards, verifying the assertion logic should be easy, as it is a one-liner.
* Remove semver.md files post-releaseGabriela Moldovan2026-06-011-44/+0
|
* Bump all the unstable tor- and arti- crates to 0.43.0Gabriela Moldovan2026-06-011-13/+13
| | | | | | | | | | Done using: ``` for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.43.0 done ```
* tor-netdoc: Use spec comment for identity-ed25519Clara Engler2026-06-011-2/+1
|
* tor-netdoc: Small spelling fixClara Engler2026-06-011-1/+1
|
* tor-netdoc: Fix RouterDesc::ed_identity expect msgClara Engler2026-06-011-1/+1
|
* tor-netdoc: Store identity_ed25519 in EmbeddedCert logic (fmt)Clara Engler2026-06-011-1/+2
| | | | Just rustfmt.
* tor-netdoc: Store identity_ed25519 in EmbeddedCert logicClara Engler2026-06-012-4/+12
| | | | | | | | | This commit changes the tpye of `RouterDesc::identity_ed25519` to be of EmbeddedCert. Using the inner keys as the verified values is fine because the legacy parser continues to verify the legacy cert, as it extracts its timestamp and signature to the Vec it verifies in the end.
* tor-netdoc: Extract KeyUnknownCert for identity cert (fmt)Clara Engler2026-06-011-8/+6
| | | | Just rustfmt.
* tor-netdoc: Extract KeyUnknownCert for identity certClara Engler2026-06-011-4/+17
| | | | | | | | | This commit modifies the legacy parser code in an ugly way to also return a copy of the KeyUnknown certificate, which will be required for an EmbeddedCert<> construction. This is not nice but unavoidable in a setup that makes use of the self-consuming tor_cert certificate chain, like the legacy parser code.
* tor-netdoc: Add master-key-ed25519Clara Engler2026-06-012-2/+12
|
* 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-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.