aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | tor-netdoc: impl SignatureItemParseable for netstatus::SignatureIan Jackson2026-04-291-1/+14
| | | | | | | | | | | | | | | This is now pretty straightforward. The functions it calls need some work - we have blocking TODOs for that.
| * | tor-netdoc: Introduce DirectorySignaturesHashesAccu::update_fromIan Jackson2026-04-292-16/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This now contains the hashing code that was in poc. In poc it was entangled with the signature type, mostly because once upon a time the hash was inside the signature. In the real code we can make it a standalone method. It takes DigestAlgoInSignature so that it will be able to handle the explicit vs implicit sha1 anomaly correctly - but it can't do that yet because the necessary field doesn't exist yet. Also, we are going to want to make it a bit lazier - preserve the MR-blocking todo for that. A handful of lines are being actually moved verbatim, so --color-moved may help a bit.
| * | tor-netdoc: Promote poc's DirectorySignaturesHashesAccu to prodIan Jackson2026-04-292-29/+41
| | | | | | | | | | | | | | | | | | | | | There are definitely some things wrong with this, but they all have MR-blocking TODOs so we can promote this type now. Largely code motion. Review with --color-moved.
| * | tor-netdoc: Make some items temporarily pub(crate)Ian Jackson2026-04-291-2/+4
| | |
| * | tor-netdoc: Temporary conversions between the two DirectorySignatureHashAlgosIan Jackson2026-04-291-0/+20
| | | | | | | | | | | | | | | | | | Because we have two DirectorySignatureHashAlgo types because of the macrology problem, we need to introduce temporary conversions, to let us move code from poc to prod.
| * | tor-netdoc: netstatus signature hashing: Add TODO re wasted workIan Jackson2026-04-291-0/+1
| | |
| * | tor-netdoc: netstatus signature hashing: Add TODO re unnamed sha1Ian Jackson2026-04-291-0/+16
| | | | | | | | | | | | | | | We're going to fix this in this branch, as part of promoting the poc code to prod.
| * | tor-netdoc: netstatus signing algorithms: Improve a doc commentIan Jackson2026-04-291-1/+1
| | | | | | | | | | | | There isn't a "this" here; self is DirectorySignaturesHashesAccu.
| * | tor-netdoc: derive ItemValue parsing/encoding for SignatureIan Jackson2026-04-292-4/+10
| | | | | | | | | | | | This doesn't let us do any verification or anything.
| * | tor-netdoc: impl parsing/encoding for AuthCertKeyIds in directory-signatureIan Jackson2026-04-291-1/+68
| | | | | | | | | | | | | | | This module will be used when we derive ItemValueParseable on Signature.
| * | tor-netdoc: Introduce DigestAlgoInSignature parsing/encoding typeIan Jackson2026-04-291-3/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And change the type of the field in Signature. We are going to abandon the almost completely manual parsing approach taken in poc's NdiDirectorySignature. That parsing approach was heavily influenced by poc's struct layout, which in turn was influenced by the way that previously, hashes were inside signatures. Instead we'll derive ItemValueParseable from Signature, and semi-manually implement the hash update. This type is the one that embodies the `directory-signature` item's parsing strangeness: the optional initial positional argument.
| * | tor-netdoc: Unify authcert test modules (fmt)Ian Jackson2026-04-291-313/+308
| | |
| * | tor-netdoc: Unify authcert test modulesIan Jackson2026-04-291-32/+18
| | | | | | | | | | | | | | | | | | | | | | | | Abolish the parse2_test and encode_test modules. These mostly existed because of cfg gates. Now, we can unify the test module namespace, and also remove an indentation level (that will come next, with rustfmt).
| * | tor-netdoc: derive Display for DirectorySignatureHashAlgoIan Jackson2026-04-291-1/+1
| | |
| * | tor-netdoc: netsatus: glob import from types, not types::miscIan Jackson2026-04-291-1/+1
| | | | | | | | | | | | | | | | | | This way we import via the public names, which is more sensible, and we include things that aren't in misc. The whole of types is pretty good as a glob import here.
| * | tor-netdoc: types.rs: Add a missing exportIan Jackson2026-04-291-0/+1
| | |
| * | tor-netdoc: parse2: Improve another error span for missing trait implIan Jackson2026-04-291-1/+1
| | |
| * | tor-netdoc: parse2: Add missing ItemObjectParseable to prelude (fmt)Ian Jackson2026-04-291-2/+2
| | |
| * | tor-netdoc: parse2: Add missing ItemObjectParseable to preludeIan Jackson2026-04-292-3/+1
| | | | | | | | | | | | And remove a then-unneeded import in a using module.
* | | Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-127-21/+19
| |/ |/| | | | | | | | | | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* | 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.
* | Merge branch 'combine-hex' into 'main'Clara Engler2026-05-121-11/+11
|\ \ | | | | | | | | | | | | tor-netdoc: Combine two hex encoding loops into a function See merge request tpo/core/arti!3947
| * | tor-netdoc: Combine two hex encoding loops into a functionIan Jackson2026-05-051-11/+11
| | |
* | | netdoc: Adjust dead_code attrs on IndexInfoGabriela Moldovan2026-05-071-2/+2
| | | | | | | | | | | | The `revision` field is no longer dead code.
* | | netdoc: Add an accessor for revision counter of the HsDescGabriela Moldovan2026-05-071-0/+5
|/ /
* | Merge branch 'directory-signature-hash-algo' into 'main'Clara Engler2026-04-309-25/+118
|\| | | | | | | | | Unknown keyword handling fixes; use a more principled type for directory signature hash algo See merge request tpo/core/arti!3923
| * tor-netdoc: Use poc's DirectorySignatureHashAlgoIan Jackson2026-04-291-7/+15
| | | | | | | | | | | | | | | | | | This type is now directly suitable for use in directory signatures. While we're changing its type, rename the digest algorithm name field from `digestname` to `digest_algo`. (The spec says `algorithm` but I don't think we're going to reuse `direcctory-signature` for non-RSA signatures so this is just the hash algorithm.)
| * tor-netdoc: Promote DirectorySignatureHashAlgo from poc as nasty macroIan Jackson2026-04-292-12/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We want DirectorySignatureHashAlgo for prod's directory Signature type. However, for complex cfg gate and macro scoping reasons, we can't just move the definition out of poc. Hence this rather unpleasant intermediate state. This will go away, and become normal again, when we can abolish poc's signatures and have poc use a prod signature type. Review with git show --color=always --color-moved-ws=allow-indentation-change --color-moved
| * tor-netdoc: poc: make DirectorySignatureHashAlgo serialise properlyIan Jackson2026-04-291-0/+1
| |
| * tor-netdoc: Introduce KeywordOrStringIan Jackson2026-04-292-0/+47
| | | | | | | | | | We're going to use this for `directory-signature`'s hash algorithm, which the current code always treats as a string!
| * tor-netdoc: Improvement to Unknown API: make it exhaustiveIan Jackson2026-04-291-1/+1
| |
| * tor-netdoc: Improvement to Unknown API: make disregarding more explicitIan Jackson2026-04-292-1/+17
| | | | | | | | | | Make the operation of disregarding the possible existence of already-discarded information, more explicit.
| * tor-netdoc: Move FromStr and Display from NormalItemArgument to implsIan Jackson2026-04-293-5/+7
| | | | | | | | | | | | | | | | | | | | | | This allows implementing NormalItemArgument for types that can only be parsed, or only displayed - or other combinations. I noticed this restriction while inventing a type I later decided was unnecessary. I still think it's a good change. There is no practical impact elsewhere, since in practice downstream code implements NormalItemArgument rather than relying on it.
* | tor-netdoc: Un-gate every cfg feature = "hsdesc-inner-docs"Ian Jackson2026-04-304-15/+7
| | | | | | | | Part of #2492 phase 2.
* | tor-cert: Ed25519CertBuilder: do builder fn renameIan Jackson2026-04-293-4/+4
|/ | | | | | Change all call sites. This completes the rename.
* tor-netdoc: Gate vote-related incomplete code with "incomplete" (fmt)Ian Jackson2026-04-281-4/+1
|
* tor-netdoc: Gate vote-related incomplete code with "incomplete" (tidy)Ian Jackson2026-04-281-4/+5
|
* tor-netdoc: Gate vote-related incomplete code with "incomplete"Ian Jackson2026-04-285-11/+11
| | | | | | | | | | | Change "ns-vote" gates to "incomplete": * `vote` modules, and in the variety macro. (And make a TODO more likely to be found.) Change "parse2" gates to "incomplete": * VoteAuthoritySection
* tor-netdoc: Un-gate test2 moduleIan Jackson2026-04-281-1/+1
| | | | Everything that this needs is un-gated now.
* tor-netdoc: Un-gate RouterStatusMdDigestsVote and SoftwareVersionIan Jackson2026-04-282-2/+0
| | | | | These are complete. Un-gate the RouterStatusMdDigestsVote implementation, and the export of both.
* tor-netdoc: Un-gate "plain-consensus" cargo featureIan Jackson2026-04-287-27/+9
| | | | As per #2492.
* tor-netdoc: Un-gate "routerdesc" cargo featureIan Jackson2026-04-284-20/+1
| | | | As per #2492.
* tor-netdoc: Un-gate top-level NetdocBuilderIan Jackson2026-04-281-2/+0
| | | | | This is only used for hsdescs right now. But it doesn't need to be gated behind encode.
* tor-netdoc: Un-gate parse2 and encode loose impls under doc/netstatus (tidy)Ian Jackson2026-04-284-21/+10
|
* tor-netdoc: Un-gate parse2 and encode loose impls under doc/netstatusIan Jackson2026-04-285-29/+21
| | | | | | | | | | | | | | | This stabilises the parse2 and encode impls of consensus tyepe: * {plain, md}::{Preamble, RouterStatus, RouterStatusIntroItem} It also un-gates the parse2 and encode impls of some vote types. * VoteAuthorityEntry - this type has been completed. * RouterStatusMdDigestsVote - whole type still gated with ns-vote Re the remaining vote types (vote::*): although each_variety.rs doesn't have a cfg itself, there is a feature gate in the variety macrology.
* tor-netdoc: Un-gate parse2 and encode loose impls in doc/netstatus.rs (rewrap)Ian Jackson2026-04-281-14/+4
|