aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc
Commit message (Collapse)AuthorAgeFilesLines
...
| * | tor-netdoc: addr policy: Fix /0 handling bugIan Jackson2026-06-181-16/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ADDR/0 is not the same as *, because it specifies the IP version. Turning 0.0.0.0/0 into * is wrong, because * accepts IPv6 too. Do this by abolishing the V4Star and V6Star variants. Sadly Rust thinks that u32 << 32 is an overflow, not zero, so we do still need a special case for a zero prefix length. (But we're about to delete this code.) Fixes #2589.
| * | tor-netdoc: addr policy tests: Add test case for IPv4 /0Ian Jackson2026-06-181-0/+1
| | | | | | | | | | | | This is, also, wrong.
| * | tor-netdoc: addr policy tests: Rename check/check1/check2Ian Jackson2026-06-181-11/+11
| | | | | | | | | | | | | | | We should privilege the "is the same" case. Rename check to check2 and check1 to check.
| * | tor-netdoc: addr policy tests: Avoid repeating where string isn't changedIan Jackson2026-06-181-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | This allows us to easily distinguish by eye, the cases where things changed (ie, where the input string was canonical), from the ones where they didn't. One of these cases is a bug.
| * | tor-netdoc: addr policy tests: Improve a few panic messagesIan Jackson2026-06-181-2/+2
| | |
| * | tor-netdoc: addr policy: Correct terminologyIan Jackson2026-06-182-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | A "mask" is a bitmask, eg 255.255.0.0 in 192.168.0.0/255.255.0.0. These are all prefix lengths. Using the word "mask" to refer to a prefix length is quite bad, because prefix lengths are numbers and sometimes masks are too. Using one as the other would be a bug.
* | | Merge branch 'rd-derive-parse' into 'main'Ian Jackson2026-06-232-2/+52
|\ \ \ | |_|/ |/| | | | | | | | 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-222-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: relay families: Add TODO re overhaul/removal of type(s)Ian Jackson2026-06-221-0/+7
| | |
* | | tor-netdoc: relay families: Move TODO out of rustdocIan Jackson2026-06-221-2/+2
| | |
* | | tor-netdoc: Microdesc: derive ConstructorIan Jackson2026-06-223-2/+12
| | |
* | | tor-netdoc Micordesc: Make intro item type publicIan Jackson2026-06-222-6/+7
| | | | | | | | | | | | | | | 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: encode derive: New default(skip) featureIan Jackson2026-06-224-0/+72
| | | | | | | | | | | | This lets us skip fields which have the default values.
* | | tor-netdoc: encode derive: New default(skip) feature (pre-fmt)Ian Jackson2026-06-221-3/+7
| | |
* | | tor-netdoc: derive encoding for microdescriptorsIan Jackson2026-06-223-4/+5
| | | | | | | | | | | | | | | | | | | | | 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: Make regsub take a ReplacerIan Jackson2026-06-221-1/+1
| | | | | | | | | | | | This will let us do more exciting munging more clearly.
* | | 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-223-1/+85
| | |
* | | tor-netdoc: Implement verification for votesIan Jackson2026-06-222-3/+139
|/ /
* | tor-netdoc: Use format_args! instead of format!Clara Engler2026-06-181-1/+1
| |
* | tor-netdoc: Use chain!() instead of pushClara Engler2026-06-181-6/+7
| | | | | | | | Replaces a push by using the chain!() macro from itertools.
* | tor-netdoc: Add test for default deny encoding of AddrPolicyClara Engler2026-06-181-0/+28
| |
* | tor-netdoc: Round-trip encoding test for AddrPolicyClara Engler2026-06-181-1/+8
| |
* | tor-netdoc: Derive NetdocEncodable in unit testClara Engler2026-06-181-1/+1
| |
* | tor-netdoc: Replace Ignored with () in AddrPolicy testClara Engler2026-06-181-5/+2
| | | | | | | | () implements encodable which we will derive soon.
* | tor-netdoc: Add NetdocEncodableFields for AddrPolicyClara Engler2026-06-182-0/+36
| | | | | | | | | | This commit implements NetdocEncodableFields for AddrPolicy in a non-trivial fashion. A unit test will be added in a moment.
* | tor-netdoc: Make some policy methods constClara Engler2026-06-182-3/+3
|/ | | | | | This commit makes some policy related constructor functions constant, so we can use them in const expressions, which will be required for the next commit.
* Merge branch 'msrv-1.91' into 'main'gabi-2502026-06-181-1/+1
|\ | | | | | | | | Bump MSRV to 1.91 See merge request tpo/core/arti!4105
| * 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 'derive-depr' into 'main'Clara Engler2026-06-182-0/+5
|\ \ | | | | | | | | | | | | tor-netdoc: derives: allow handling deprecated fields See merge request tpo/core/arti!4118
| * | tor-netdoc: constructor derive: allow setting deprecated fieldsIan Jackson2026-06-161-0/+1
| | | | | | | | | | | | We must generally set such a field to the default.
| * | tor-netdoc: parse2 derive: allow setting deprecated fieldsIan Jackson2026-06-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to derive from a struct with deprecated fields, without triggering the warning. This doesn't yet treat encoding as yet, because the only deprecated field I encountered was `skip` which means the derived encoder never mentions it.
* | | tor-netdoc: votes: use EmbeddedCert for the authhcertIan Jackson2026-06-172-2/+6
| | |