summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc
Commit message (Collapse)AuthorAgeFilesLines
* tor-netdoc: Derive Eq on RouterDescSignaturesClara Engler2026-06-291-1/+1
|
* tor-netdoc: Derive Eq on RouterDescClara Engler2026-06-291-1/+1
|
* Merge branch 'microdesc-sha' into 'main'Clara Engler2026-06-252-48/+65
|\ | | | | | | | | tor-netdoc: Remove document hash from Microdesc struct (and add MicrodescAndHash for that) See merge request tpo/core/arti!4138
| * Apply deferred rustfmt churnIan Jackson2026-06-222-9/+2
| |
| * tor-netdoc: Break Microdesc up into Microdesc and MicrodescAndHashIan Jackson2026-06-222-28/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | The Microdesc type having a copy of the document hash was always weird, and it's weirder now that there's all these parse2 types that don't have it and parse2 derives on Microdesc that don't touch it. Make a new type for the descriptor and its hash. Use deref to arrange that the new type works almost like the old one. Adjust the use lines in the dependencies to temporarily import MicrodescAndHash as Microdesc.
| * tor-netdoc: Move some Microdesc methodsIan Jackson2026-06-221-20/+23
| | | | | | | | | | Code motion, plus adding a new impl block, to make the next commit clearer.
* | tor-netdoc: Replace string slices with str::get() in doc (fmt)Clara Engler2026-06-243-5/+19
| | | | | | | | No functional change, just reformatting.
* | tor-netdoc: Replace string slices with str::get() in docClara Engler2026-06-245-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | This commit replaces the use of string slices with str::get() in all document related code. While this is not a perfect replacement for it, the relevant parts in the code heavily depend upon the byte offsets returned by the low level (legacy) parser where changing it would lead to a very big refactoring. Nonetheless, this approach is better because returning a bug is better than crashing.
* | tor-netdoc: Fix rs.rs cache commentsClara Engler2026-06-241-1/+1
| | | | | | | | Removes a blocking comment and replaces it with a TODO DIRAUTH.
* | tor-netdoc: Wrap port policies in InternClara Engler2026-06-242-7/+5
| | | | | | | | This commit wraps the port policies in an Intern.
* | tor-netdoc: Wrap family in InternClara Engler2026-06-242-4/+6
| | | | | | | | This commit wraps the relay family in an Intern instead of an Arc.
* | Use Intern<T> (fmt)Clara Engler2026-06-241-1/+3
| | | | | | | | No functional change.
* | Use Intern<T>Clara Engler2026-06-241-1/+2
| | | | | | | | | | This commit modifies the codebase to actually return Intern<T> in InternCache<T> and adds calls to .into() accordingly.
* | Merge branch 'rd-derive-parse' into 'main'Ian Jackson2026-06-231-2/+51
|\ \ | |/ |/| | | | | Derive NetdocParseableUnverified for RouterDesc See merge request tpo/core/arti!4134
| * tor-netdoc: Add TODOClara Engler2026-06-231-1/+1
| |
| * tor-netdoc: Replace assume_wellsigned() with unwrap_unverified()Clara Engler2026-06-231-10/+3
| |
| * tor-netdoc: Add small RouterDesc parse2 testClara Engler2026-06-221-0/+35
| | | | | | | | | | | | | | | | | | This adds a very small RouterDesc parse2 test only verifying whether the testdata2 gets properly parsed, with a minimal length verification alongside two identity related fields. Once we have encoding and verification support, we have to extend this test of course.
| * tor-netdoc: Add test only RouterDesc verifyClara Engler2026-06-221-1/+8
| | | | | | | | | | Only for testing, just returns the inner body. Will be removed once we have a proper verify method.
| * Derive NetdocParseableUnverified for RouterDescClara Engler2026-06-221-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Finally! 🎉 This commit derives NetdocParseableUnverified for RouterDesc by adding the respective derive_deftly attributes to the top-level definition as well as the member fields that require it. A .verify() method as well as unit tests will be added in the next commits. Encoding still depends on a few tiny papercuts but will otherwise be added shortly too, although in a different branch.
* | tor-netdoc: Microdesc: derive ConstructorIan Jackson2026-06-222-2/+11
| |
* | tor-netdoc Micordesc: Make intro item type publicIan Jackson2026-06-221-6/+6
| | | | | | | | | | We don't need the type to be private. Indeed, we'd like it not to be to make Microdesc construction with Constructor regular
* | tor-netdoc Micordesc: rename the intro item typeIan Jackson2026-06-221-3/+3
| | | | | | | | | | "OnionKeyIntro" is particularly odd. Mostly people won't need to refer to this, anyway.
* | tor-netdoc test: Add a round-trip test for microdescriptorsIan Jackson2026-06-221-1/+12
| |
* | tor-netdoc: Avoid encoding default values in microdescsIan Jackson2026-06-221-4/+4
| |
* | tor-netdoc: derive encoding for microdescriptorsIan Jackson2026-06-221-2/+2
| | | | | | | | | | | | | | All these types already have parsing derives. The encoding isn't quite right yet. It's legal, but doesn't match C Tor as well as we'd like.
* | tor-netdoc: Add a TODO for use of include_strIan Jackson2026-06-221-0/+2
| |
* | tor-netdoc: embedded auth certs: Use real vote type, not poc (fmt)Ian Jackson2026-06-221-3/+1
| |
* | tor-netdoc: embedded auth certs: Use real vote type, not pocIan Jackson2026-06-221-3/+1
| |
* | tor-netdoc tests: test vote roundtrip with testdata2Ian Jackson2026-06-222-27/+83
| | | | | | | | | | | | | | | | | | | | | | Use roundtrip_netstatus, which does nearly all of the work for us. But for it to round-trip, we must do a bunch of fudging. This replaces the old parse2 vote test case (which used the poc type). The test case has some adjustments to cope with missing fields. Move the TODOs for those fields to the test case, so that they're on lines that will be deleted when the fields are implemented.
* | tor-netdoc tests: Adjust `m` placement in routerdescIan Jackson2026-06-221-0/+12
| |
* | tor-netdoc tests: Adjust shared-rand-* base64 paddingIan Jackson2026-06-221-0/+13
| | | | | | | | | | | | Right now we're working on votes, but the same issue arises in consensuses; we just haven't noticed yet because the testdata2 consensus doesn't have an SRV.
* | tor-netdoc tests: Make adjust_exp into a trait method (fmt)Ian Jackson2026-06-221-25/+25
| |
* | tor-netdoc tests: Make adjust_exp into a trait methodIan Jackson2026-06-221-9/+33
| | | | | | | | | | | | | | | | In the future (not quite yet in this branch), there will be tests that want to use roundtrip_netstatus for other test files. We'll want to be able to reuse the per-document-specific munging. So make that into a trait. And document roundtrip_netstatus.
* | tor-netdoc tests: roundtrip_netstatus: Improve an error messageIan Jackson2026-06-221-1/+1
| |
* | tor-netdoc tests: roundtrip_netstatus: Add a useful debug boundIan Jackson2026-06-221-1/+1
| |
* | tor-netdoc tests: netstatus round trips: allow adjusting nowIan Jackson2026-06-221-1/+5
| | | | | | | | | | The vote test files are for the next consensus interval, so we need to verify them at a slightly future time.
* | tor-netdoc tests: Test verification of votes, error casesIan Jackson2026-06-222-1/+84
| |
* | tor-netdoc: Implement verification for votesIan Jackson2026-06-222-3/+139
|/
* tor-netdoc: votes: use EmbeddedCert for the authhcertIan Jackson2026-06-171-1/+1
|
* Merge branch 'consensus-roundtrip' into 'main'Ian Jackson2026-06-174-15/+301
|\ | | | | | | | | Implement encoding and verification for consensuses, and add a round trip test See merge request tpo/core/arti!4100
| * tor-netdoc: consensus_threshold: return a RangeFromIan Jackson2026-06-172-8/+14
| |
| * tor-netdoc: tests: ns parse2 test: Round trip an md consensusIan Jackson2026-06-171-9/+17
| |
| * tor-netdoc: tests: ns parse2 test: Make roundtrip test generic (fmt)Ian Jackson2026-06-171-19/+16
| |
| * tor-netdoc: tests: ns parse2 test: Promote a fudgeIan Jackson2026-06-171-7/+8
| | | | | | | | Microdescriptor consensuses are affected by this same anomaly.
| * tor-netdoc: tests: ns parse2 test: Make roundtrip test genericIan Jackson2026-06-171-15/+42
| | | | | | | | This will let us test microdescriptors and votes with the same code.
| * tor-netdoc: tests: ns parse2 test: Round trip a plain consensusIan Jackson2026-06-172-2/+43
| |
| * tor-netdoc: tests: ns parse2 test: Mess with authcerts in a block (fmt)Ian Jackson2026-06-171-10/+10
| |
| * tor-netdoc: tests: ns parse2 test: Mess with authcerts in a blockIan Jackson2026-06-171-2/+4
| | | | | | | | | | This avoids rebinding file and text and input to the authcerts. We're going to want to use at least some of those values later.
| * tor-netdoc: tests: ns parse2 test: enable UnknownIan Jackson2026-06-171-1/+2
| |
| * tor-netdoc: tests: ns parse2 test: Use real document type (fmt)Ian Jackson2026-06-171-3/+2
| |