aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/routerdesc.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-netdoc: Return copy in RouterDesc::rsa_identity()Clara Engler2026-05-121-2/+3
| | | | | | | | | | | This change might seem pointless for now but it will be required and unavoidable later on, because we will have to change RouterDesc::fingerprint from RsaIdentity to Option<SpFingerprint> which will make it impossible to be used inside the getter anymore. With this change, our only resort is to obtain the RSA identity from the signing key but we can only return a copy then because that RSA identity is created ad-hoc then.
* tor-netdoc: Rename RouterDesc real items to their real nameClara Engler2026-05-121-19/+19
| | | | | | | | | | | | | | This commit changes the name of all (except accept/reject) real items in RouterDesc to their proper name as found in the spec. This is a breaking change and semver.md has been updated properly. In the instanciation of RouterDesc in the legacy parser, we now use a "weird" syntax of some fields using a different name throughout the code, but that is ok. Changing this would make the diff way larger at the risk of breaking things, especially because many variables such as identity_cert get shadowed countless times within the function, making it harder and error prone to change.
* tor-netdoc: Add fancy rustdoc to real RouterDesc itemsClara Engler2026-05-121-22/+64
|
* tor-netdoc: Reorder real RouterDesc itemsClara Engler2026-05-121-41/+41
| | | | | | | | | | | | | | This commit reorders the real RouterDesc items according to the spec. Unfortunately, the names of those are not real yet, meaning that verifying this is somewhat hard. Personally, I recommend to verify that this commit does not add/remove lines using --color-moved. The correct order is probably easier to verify with the next commit applied that adds nice rustdoc comments explaining to which fields in the spec the respective items belong. This is a bit of a chicken egg situation but if I would have added the nice rustdoc comments first, this diff would have been awful to review, because the hunks of reordering the nice rustdoc comments included are awful to review, so please bear with me for the next commit.
* tor-netdoc: Reorder RouterDesc into virtual and real itemsClara Engler2026-05-121-10/+26
| | | | | | | | This commit reorders the RouterDesc struct into virtual and real items, with real items being items that actually exist (although potentially under a different name) in router descriptors. Virtual items on the other hand do not exist this way in router descriptors and have to be removed at one point or another.
* tor-netdoc: Add spacing to RouterDescClara Engler2026-05-121-0/+19
| | | | Makes this much nicer to read.
* tor-netdoc: Un-gate parse2 in doc/routerdesc.rsIan Jackson2026-04-281-1/+0
| | | | This is just one cfg, for RelayPlatform.
* tor-netdoc: Add RouterDescSignatures typeClara Engler2026-04-231-1/+24
| | | | | This commit implements the RouterDescSignatures type that carries the signatures for the yet to be derived RouterDescUnverified.
* tor-netdoc: Add spec link to RouterDescClara Engler2026-04-221-0/+4
| | | | This commit adds a specification link to the RouterDesc struct.
* tor-netdoc: ItemArgumentParseable for RelayPlatformClara Engler2026-04-221-0/+12
| | | | | This commit implements ItemArgumentParseable for RelayPlatform which we will need in the parse2 version of RouterDesc eventually.
* tor-netdoc: Make Nickname have its own parsing error typeIan Jackson2026-04-201-1/+5
| | | | | | | | This will let us use it in more places, more sensibly. Sadly it means a lot of syntactic vinegar at many of the call sites in the old parser, which has very janky ideas about how errors should work.
* tor-netdoc: Add ExtraInfoDigest type aliasClara Engler2026-03-121-0/+3
| | | | Accidentally left out in the previous commit.
* tor-netdoc: RSA: rename helper type to RsaPublicParse1HelperIan Jackson2026-01-061-2/+2
| | | | | | This is used by the old parsing code, apparently as a thing to hang the checking methods off. It is confusing to have so many different RSA types! Let's at least rename this one.
* netdoc: Remove protocol interning.Nick Mathewson2025-12-031-9/+7
| | | | (It's now done in tor_protover.)
* tor-netdoc: Split off Keyword::to_str into its own traitIan Jackson2025-11-181-1/+1
| | | | | My planned encoding derive macro is not going to use `decl_keyword!` but will need to call `NetdocEncoder::item`.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* tor-netdoc: Abolish `dangerous-expose-struct-fields`; always expose, insteadIan Jackson2025-10-011-66/+27
| | | | Fixes #2192
* tor-netdoc: rs: Introduce and use DOC_DIGEST_LENIan Jackson2025-08-181-1/+4
| | | | Part of making ns.rs and md.rs largely identical.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-4/+4
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-netdoc: Removed dependency on `once_cell`hashcatHitman2025-06-141-5/+5
| | | | | | - Replaced `once_cell::sync::Lazy` with `std::sync::LazyLock`. Signed-off-by: hashcatHitman <[email protected]>
* netdoc: Make some parsing init functions fallible.Nick Mathewson2025-03-171-5/+5
| | | | | | | I'm about to make our parsers reject some strings at construction time, so it makes sense to have these functions become fallible. This is a breaking change.
* netdoc: Add "family-cert" entries to routerdesc parserNick Mathewson2025-02-251-3/+79
|
* Merge branch 'expose-annotated' into 'main'Nick Mathewson2024-07-221-0/+15
|\ | | | | | | | | | | | | tor-netdoc: Dangerously expose annotation fields Closes #1469 See merge request tpo/core/arti!2213
| * tor-netdoc: Dangerously expose annotation fieldsClara Engler2024-06-211-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | This commit exposes the fields of `routerdesc::AnnotatedRouterDesc` and `routerdesc::RouterAnnotation` with the enabled feature `dangerous-expose-struct-fields`. On one side, it achieves a greater consistency among the other structures found within this module; On the other side it makes the already public API (assuming the feature above is enabled) useable. Fixes #1469
* | Make TAP keys optional when parsing documents.Nick Mathewson2024-06-271-20/+42
|/ | | | | This is the client-side part of phase 1 for proposal 350, which will eventually remove TAP completely from the Tor network.
* Add exception for cfg(fuzzing) in tor-netdocNick Mathewson2024-05-071-1/+2
| | | | | The use of cfg(fuzzing) here is reasonable and localized, but we need to permit it to avoid a warning from #1395.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Upgrade to latest signature.Gabriela Moldovan2024-02-281-2/+0
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Replace usage of KeyUnknownCert::check_key.Nick Mathewson2023-05-161-2/+2
|
* netdoc: Rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`.Gabriela Moldovan2023-05-101-1/+1
| | | | | | | | | | | `ParseErrorSource` was originally meant to represent a parsing error, this enum has since gained some variants that aren't really parsing related (`Signature`, `CertSignature`, `UntimelyDescriptor`). Since this error type is now used for general-purpose netdoc errors, let's rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`. Signed-off-by: Gabriela Moldovan <[email protected]>
* Merge branch 'doc-iter' into 'main'Nick Mathewson2023-02-171-14/+14
|\ | | | | | | | | | | | | tor-netdoc: Abolish PauseAt in favour of using itertools Closes #760 See merge request tpo/core/arti!1021
| * tor-netdoc: Remove many needless calls to .iter() and .into_iter()Ian Jackson2023-02-151-5/+5
| |
| * tor-netdoc: Replace use of PauseAt::new_pred()Ian Jackson2023-02-151-9/+9
| | | | | | | | | | | | | | We can just make a new PauseAt, since it can take the inner peekable iterator by mutable reference. This seems to tidy the code up a bit too.
* | Expire routerdescs as soon as any of their expiries expireIan Jackson2023-02-151-1/+1
|/ | | | Fixes #772
* Merge branch 'authcert_bug' into 'main'eta2023-02-071-8/+15
|\ | | | | | | | | | | | | Fix AuthCert behavior on unrecognized tokens, and prevent bug from recurring elsewhere. Closes #752 See merge request tpo/core/arti!1006
| * netdoc: Require that unrecognized tokens be handled explicitly.Nick Mathewson2023-02-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we require that, for all `SectionRules`, either the caller say how to handle unrecognized tokens (using `.add(UNRECOGNIZED...)`), or that they explicitly reject unrecognized tokens (using `reject_unrecognized`()`.) This solution uses an assert!() rather than an Error to indicate failure. I say that's fine, since 1. This is a crate-internal API. 2. We never dynamically construct SectionRules according to different behavior: they are always prefabricated in a fixed code block. Thus, if we test a parser at all, we will make sure that its SectionRules are well-formed. I considered and explicitly rejected a solution where the builder had to be finalized with separate methods `build_strict()` or `build_tolerant()`: It's too easy IMO for the caller to forget what these call means. Prevents further recurrences of #752. Closes #752.
| * netdoc: Switch SectionRules building to use a Buidler pattern.Nick Mathewson2023-02-031-8/+8
| | | | | | | | No new behavior yet.
* | netdoc: Use Signature::from to construct ed25519 sigs.Nick Mathewson2023-02-071-3/+4
|/
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Merge branch 'test-lints' into 'main'eta2023-01-061-0/+8
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | Tackling issue #663 (Use humantime in tests)coral2022-12-121-1/+1
|/
* netdoc: Add a test for routerdesc family parsing.Nick Mathewson2022-11-171-0/+9
|
* netdoc: Correct and test some tricky routerdesc errorsNick Mathewson2022-11-171-2/+31
| | | | These required hex-editing identity certificates :P
* netdoc: Add tests for routerdesc accessors.Nick Mathewson2022-11-171-1/+31
|
* Netdoc: use a different desc in tests.Nick Mathewson2022-11-171-4/+3
| | | | This is from Akka, which ahf runs.
* Remove a `TODO pt-client` in netdoc.Nick Mathewson2022-11-151-2/+0
| | | | This issue is now torspec!94.
* netdoc: Allow empty lines at the end of a router descriptor.Nick Mathewson2022-11-151-3/+10
|