aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Change HS descriptor sendme_inc into a NonZeroU8Nick Mathewson2026-07-022-7/+10
| | | | | | | | | | | | | | | This saves us from having to check whether it is 0, and better represents what the type is allowed to be.
| * | netdoc: Add new capability negotiation pieces to hsdesc.Nick Mathewson2026-07-024-5/+174
| | | | | | | | | | | | | | | | | | | | | | | | The "flow-control" item is documented in proposal 324 section 9.1; there's a ticket (torspec#418) to document it. The "proto" item is documented at https://spec.torproject.org/rend-spec/hsdesc-encrypt.html#item:proto
* | | tor-netdoc: rangemap_mutate_range: Adjust a plaintive commentIan Jackson2026-07-021-1/+1
| | |
* | | tor-netdoc: rangemap_mutate_range: New functionIan Jackson2026-07-023-0/+324
|/ / | | | | | | This will be used for exit port summary calculations.
* | tor-netdoc: Remove Eq on various typesClara Engler2026-07-023-4/+4
| | | | | | | | | | This reverts the Eq derives added in !4150 while keeping the PartialEq, in order to support including this in Unknown.
* | tor-netdoc: Derive encoding for RouterSignatureClara Engler2026-07-021-9/+6
| |
* | tor-netdoc: Add TODO for .encode_sign()Clara Engler2026-07-021-0/+1
| |
* | tor-netdoc: Change concept of test_parse2Clara Engler2026-07-021-4/+4
| | | | | | | | | | | | | | This test is now called test_parse2_simple and intended to test simple parse2 and encode round-trip functionality without edge-cases and such. More edge tests will be added once we have a proper verification logic.
* | tor-netdoc: Round-trip encoding testClara Engler2026-07-021-1/+23
| | | | | | | | | | | | This commit adds a round-trip encoding test to test_parse2 that encodes the decoded results and decodes them again in order to verify that the again decoded result is equal to the original one.
* | tor-netdoc: Adjust test_parse2 to keep signaturesClara Engler2026-07-021-4/+5
| | | | | | | | | | | | | | Required for round trip encode testing which we will add in the next commit. We only keep the actual RouterDescSignatures because then we can do Eq.
* | tor-netdoc: NetdocEncodable for RouterDescClara Engler2026-07-021-5/+7
| |
* | tor-netdoc: NetdocEncodable for RouterDescSignaturesClara Engler2026-07-021-1/+1
| |
* | tor-netdoc: ItemValueEncodable for RouterSignatureClara Engler2026-07-021-0/+7
| | | | | | | | Needed for encoding.
* | tor-netdoc: Improve Debug for PortRangeIan Jackson2026-07-011-1/+2
| | | | | | | | | | This appears in a lot of debug output and the `... lo: ... hi: ...` formulation is very noisy.
* | tor-netdoc: AddrPolicy::rules provides a DoubleEndedIteratorIan Jackson2026-07-011-1/+1
| |
* | tor-netdoc: Make PortRange CopyIan Jackson2026-07-011-1/+1
| | | | | | | | | | | | | | | | | | This type consists of, and will always consist of, two u16. Making it Copy is convenient. This will preclude us making it contain a RangeInclusive because std::ops::RangeInclusive is not Copy (due to API design blunder in std), and std::range is still unstable. I think that's OK.
* | tor-netdoc: Add conversions between PortRange and RangeInclusiveIan Jackson2026-07-011-0/+13
| |
* | tor-netdoc: Add (private) PortPolicy::from_allowed_ranges constructorIan Jackson2026-07-011-0/+8
|/ | | | | | | | | | Callers in policy.rs's sub-modules should not be required to open-code constructing this, even though they can. (PortRanges is module-private, so this is too.) This is without prejudice to possible rationalisation of the types in this area.
* tor-netdoc: AddrPolicy: Improve docs including spec xrefIan Jackson2026-07-011-2/+8
|
* tor-netdoc: IpPattern: Explain difference between `*` and `0.0.0.0/0`Ian Jackson2026-07-011-1/+4
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4141#note_3430551
* tor-netdoc: AddrPolicy: Provide rules accessorIan Jackson2026-07-011-0/+7
|
* tor-netdoc: AddrPortPattern: Improve APIIan Jackson2026-07-011-1/+6
|
* tor-netdoc: AddrPortPattern: Expose contents, exhaustivelyIan Jackson2026-07-011-2/+7
|
* tor-netdoc: AddrPortPattern: Rename pattern field to addrsIan Jackson2026-07-011-8/+8
| | | | | "Pattern" is wrong. Everything here is a pattern. This field is the *address* pattern as opposed to the *ports* pattern.
* tor-netdoc: AddrPortPattern: Improve formatting a bitIan Jackson2026-07-011-3/+2
|
* tor-netdoc: IpPattern: Expose publiclyIan Jackson2026-07-012-4/+7
|
* tor-netdoc: IpPattern: Improve APIIan Jackson2026-07-011-2/+2
| | | | impl From<IpNet>, Copy, Hash
* tor-netdoc: IpPattern: Improve docsIan Jackson2026-07-011-0/+5
|
* tor-netdoc: Derive Eq on RouterDescSignaturesClara Engler2026-06-291-1/+1
|
* tor-netdoc: Derive Eq on RouterDescClara Engler2026-06-291-1/+1
|
* tor-netdoc: Derive Eq on (embedded) certificate typesClara Engler2026-06-292-2/+2
|
* tor-netdoc: Remove redundant .clone() callClara Engler2026-06-291-1/+1
| | | | No longer required because it implements Copy.
* tor-netdoc: Fix Ed25519NtorCrossCert rangeClara Engler2026-06-291-11/+4
| | | | | | | | | | This commit fixes the range to NOT include SystemTime::UNIX_EPOCH. This is because TimerangeBound makes a difference between a lower bound being Some or None. This was discovered later during test and is crucial to properly detect a minimum in the yet-to-be-merged .verify() method for router descriptors.
* Merge branch 'expanded-keypair-ntor' into 'main'Ian Jackson2026-06-291-3/+3
|\ | | | | | | | | tor-netdoc: ExpandedKeypair for Ed25519NtorCrossCert::new_signed() See merge request tpo/core/arti!4155
| * tor-netdoc: ExpandedKeypair for Ed25519NtorCrossCert::new_signed()Clara Engler2026-06-251-3/+3
| | | | | | | | | | | | | | This commit changes Ed25519NtorCrossCert::new_signed() to accept an ExpandedKeypair instead of a Keypair, because when converting the ntor key using convert_curve25519_to_ed25519_public(), only the ExpandedKeypair is returned, which is a one-way conversion from Keypair.
* | 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.
* | Merge branch 'trivial-encode-string-slice' into 'main'Clara Engler2026-06-251-2/+1
|\ \ | | | | | | | | | | | | tor-netdoc: Replace trivial string slice See merge request tpo/core/arti!4143
| * | tor-netdoc: Replace trivial string sliceClara Engler2026-06-241-2/+1
| | |
* | | 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-basic-utils: Add GloballyInternable::into_intern()Clara Engler2026-06-243-4/+4
| | | | | | | | As a shorthand for T::intern_cache().intern(value).
* | tor-netdoc: Wrap port policies in InternClara Engler2026-06-243-12/+8
| | | | | | | | This commit wraps the port policies in an Intern.
* | tor-netdoc: Wrap family in InternClara Engler2026-06-243-10/+9
| | | | | | | | This commit wraps the relay family in an Intern instead of an Arc.
* | tor-netdoc: Implement encode traits for Intern wrappersClara Engler2026-06-241-0/+35
| | | | | | | | Just a boilerplate implementation.
* | tor-netdoc: Implement parse2 traits for Intern wrappersClara Engler2026-06-242-1/+18
| | | | | | | | | | This commit implements ItemValueParseable and ItemArgumentParseable for Intern<T> types. This should be sufficient for the time being.
* | tor-netdoc: GloballyInternable for PortPolicyClara Engler2026-06-241-10/+6
| |