aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc
Commit message (Collapse)AuthorAgeFilesLines
...
| * | tor-netdoc: Remove accidential TODO left-overClara Engler2026-06-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes an accidential TODO left-over related to eventdns, which now appears as it would refer to caches-extra-info. I must have forgotten to rebase this out after we decided to not include eventdns in arti!4006, but looking at torspec!498, it is obvious that the comment refers to eventdns and not caches-extra-info.
* | | tor-netdoc: authcert: use TimerangeBound for UnverifiedAuthCert::verify (fmt)Ian Jackson2026-06-101-94/+44
| | | | | | | | | | | | Precisely the result of rustfmt.
* | | tor-netdoc: authcert: use TimerangeBound for UnverifiedAuthCert::verifyIan Jackson2026-06-101-37/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TimerangeBound is reasonably nice and this will fit in better when we want to verify votes. Adjust the one non-test call site (in tor-dirserver) using .and_then. In the tests: * Where we expected success, call .check_valid_at and add another .unwrap(). * Where we expected signature verification failure, delete the time parameters. * Where we expected timeliness failure, call .check_valid_at and map the error. * With nontrivial tolerance, add calls to `extend_[pre_]tolerance`.
* | | tor-netdoc: authcert tests: add some parenthesesIan Jackson2026-06-101-4/+4
| | |
* | | tor-netdoc: authcert tests: insist on return value typeIan Jackson2026-06-101-5/+5
| | | | | | | | | | | | | | | | | | | | | We're about to make UnverifiedAuthCert::verify return a TimerangeBound, not an AuthCert. For the success cases, declare the expected return type.
* | | Merge branch 'clippy-string-slice' into 'main'Nick Mathewson2026-06-1019-0/+22
|\ \ \ | | | | | | | | | | | | | | | | Lint for clippy::string_slice See merge request tpo/core/arti!4086
| * | | everywhere: Add #[allow(clippy::string_slice)]Clara Engler2026-06-095-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds #[allow(clippy::string_slice)] to all functions in the code where string slices are used, alongside a TODO comment. We do this add the function header to have it consistent, as things like expression based allow's are still experimental.
| * | | maint: Run maint/add_warning to deny string slicesClara Engler2026-06-0917-0/+17
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* | | tor-netdoc: Fix a doc comment formatting botchIan Jackson2026-06-091-1/+1
| | |
* | | tor-netdoc: Introduce toplevel NeteworkStatus typeIan Jackson2026-06-094-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the pieces are in place for this now. Some of the pieces are not entirely complete or correct at this point: that's sorted out by other MRs already open. Currently there is no encoding, no verification functdion, and no tests. Encoding depends on another oustanding MR (arti!4058). Verification depends on the rework in arti!4065. Tests are still to come.
* | | tor-netdoc: impl EncodeOrd for SignatureIan Jackson2026-06-091-1/+8
| | | | | | | | | | | | This will let us encode consensus signatures sections.
* | | tor-netdoc: impl EncodeOrd for RouterStatusIan Jackson2026-06-092-1/+10
| | | | | | | | | | | | This defines ordering of routerstatus items.
* | | tor-netdoc: derive encoding for RouterStatusIan Jackson2026-06-092-1/+1
| | |
* | | tor-netdoc: derive encoding for RouterStatusIntroItemIan Jackson2026-06-091-0/+1
|/ / | | | | | | | | | | This is a nontrivial type with much weirdness to do with publication times etc., so let's mark this as incomplete until we have a round trip test.
* | Merge branch 'netdoc-small-fixes' into 'main'Clara Engler2026-06-092-3/+4
|\ \ | | | | | | | | | | | | tor-netdoc: minor fixes arising from netstatus work See merge request tpo/core/arti!4055
| * | tor-netdoc: {required,recommended}-*-protocols: change orderingIan Jackson2026-06-031-2/+2
| | | | | | | | | | | | This matches C Tor and the spec.
| * | tor-netdoc: {required,recommended}-*-protocols: fix encodingIan Jackson2026-06-031-1/+1
| | | | | | | | | | | | We need to use `-`, not `_`. So use concat! stringify!.
| * | tor-netdoc: SoftwareVersion: fix Display implIan Jackson2026-06-031-0/+1
| |/ | | | | | | Now it round-trips.
* | Merge branch 'portpolicy-split-ws' into 'main'Clara Engler2026-06-031-0/+6
|\ \ | | | | | | | | | | | | tor-netdoc: Avoid use of string slices in PortPolicy See merge request tpo/core/arti!4062
| * | tor-netdoc: Test for UTF-8 port policy edge case52252252026-06-031-0/+6
| |/ | | | | | | | | | | | | This commit adds a tor-netdoc test for checking for an edge case related to UTF-8 symbols found within netdocs. See arti#2566
* | Merge branch 'no-result' into 'main'Clara Engler2026-06-033-38/+37
|\ \ | |/ |/| | | | | tor-netdoc: No longer import crate::Result in doc::netstatus See merge request tpo/core/arti!4050
| * tor-netdoc: netstatus: Abolish StdResult aliasIan Jackson2026-06-022-13/+12
| |
| * tor-netdoc: netstatus: No longer use crate::ResultIan Jackson2026-06-022-24/+24
| |
| * tor-netdoc: Change one call to use try_collect()Ian Jackson2026-06-021-1/+1
| | | | | | | | This is a clearer.
* | tor-netdoc: Add TODO for eventdnsClara Engler2026-06-031-0/+1
| |
* | tor-netdoc: Change Option<NumericBoolean> to NumericBooleanClara Engler2026-06-031-1/+2
| | | | | | | | | | | | It is weird to have three possible states for truthiness here. This commit removes the Option in favor of the inner type while adding a TODO comment to somehow find a way to skip this during encoding.
* | tor-netdoc: Replace some item docs with spec linksClara Engler2026-06-031-6/+3
| |
* | tor-netdoc: Add TODO for overload_generalClara Engler2026-06-031-0/+1
| | | | | | | | Adds a TODO for using ConstantString for overload_general.
* | tor-netdoc: Add extra_info_digest to RouterDescClara Engler2026-06-031-0/+8
| | | | | | | | This field is taken from the spec.
* | tor-netdoc: Add contact to RouterDescClara Engler2026-06-031-0/+8
| | | | | | | | This commit adds the contact field to RouterDesc.
* | tor-netdoc: Add overload_general to RouterDescClara Engler2026-06-031-0/+8
| | | | | | | | This commit adds support for the overload-general field to RouterDesc.
* | tor-netdoc: Add hibernating field to RouterDescClara Engler2026-06-031-0/+8
| |
* | Merge branch 'netdoc-unverified-trait-name' into 'main'Clara Engler2026-06-032-2/+2
|\ \ | | | | | | | | | | | | tor-netdoc Rename NetdocUnverified trait to NetdocParseableUnverified See merge request tpo/core/arti!4043
| * | tor-netdoc: Rename NetdocUnverified trait to NetdocParseableUnverifiedIan Jackson2026-06-022-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | 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: 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: 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-021-0/+11
|
* 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-021-7/+7
| | | | | | | | | 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.
* 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-011-4/+11
| | | | | | | | | 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-011-2/+11
|