aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/netstatus.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-netdoc: use DirectorySignaturesHashesAccu in SignatureGroupIan Jackson2026-05-271-6/+9
| | | | | | This will let us (re)use the existing signature checking code with the parse2 type, since we'll be able to make a SignatureGroup out of a parse2'd UnverifiedNetworkStatus.
* tor-netdoc: Make fields of DirectorySignaturesHashesAccu publicIan Jackson2026-05-271-2/+2
| | | | | This will allow it to be a replacement inside `SignatureHashes`. Keeping the fields private seems to have been an oversight.
* tor-netdoc: SignatureGroup: add some notes to the docsIan Jackson2026-05-271-0/+4
|
* tor-netdoc: Replace poc's NddDirectoryFooter with new FooterIan Jackson2026-05-271-1/+1
| | | | | This is the whole of the footer section, with docs, appropriate derives, and so on.
* tor-netdoc: ConsensusFooterFields: Constructor, parse, encodeIan Jackson2026-05-271-3/+12
|
* tor-netdoc: ConsensusFooterFields: Tidy docsIan Jackson2026-05-271-4/+4
| | | | | Add links to the spec, and delete explanatory text (that ought to be in the spec, not here).
* tor-netdoc: ConsensusFooterFields: Rename weights field to bandwidth_weightsIan Jackson2026-05-271-3/+3
| | | | This matches the spec.
* tor-netdoc: Rename Footer to ConsensusFooterFieldsIan Jackson2026-05-271-5/+7
| | | | | | | | | | | This will allow us to include this, conditionally, in the new per-variety footer types for consensuses, without too much disruption to the existing code. We don't leave a compatibility alias because we're going to want a Footer in each_variety.rs which is the actual sub-document. This old struct isn't suitable because it doesn't have the intro item and is just for consensuses.
* tor-netdoc: NetworkStatusVersion, replacing poc's with FixedStringIan Jackson2026-05-271-0/+13
|
* tor-netdoc: SharedRandStatuses: Use proper Constructor non-exhaustive patternIan Jackson2026-05-131-1/+5
|
* tor-netdoc: SharedRandParticipate: Add TODO re "presence" typeIan Jackson2026-05-131-0/+2
|
* tor-netdoc: SharedRandCommitV1: Improve type of revealIan Jackson2026-05-131-1/+4
|
* tor-netdoc: SharedRandCommitV1: Improve type of commitIan Jackson2026-05-131-1/+7
| | | | | | | Use FixedB64 since it is in fact fixed length. While we're here, add the docs link I had to follow to figure this out.
* tor-netdoc: VoteAuthorityEntry: reorder fields to spec orderIan Jackson2026-05-131-4/+4
| | | | Only SharedRandStatuses was out of place.
* tor-netdoc: vote authority entry: declare it completeIan Jackson2026-05-131-3/+0
|
* tor-netdoc: vote authority entry: parse shared-rand-commitIan Jackson2026-05-131-2/+89
| | | | This is rather ugly, because the protocol is being ad-hoc again.
* tor-netdoc: vote authority entry: parse shared-rand-participateIan Jackson2026-05-131-1/+21
|
* tor-netdoc: vote authority entry: parse legacy-dir-keyIan Jackson2026-05-131-1/+6
|
* tor-netdoc: Add shared-rand-*-status to VoteAuthorityEntryIan Jackson2026-05-131-4/+4
|
* tor-netdoc: Break out SharedRandStatuses, and remove it from votesIan Jackson2026-05-131-0/+19
|
* tor-netdoc: Replace an IEFE with use of .and_then() (fmt)Ian Jackson2026-05-051-6/+5
|
* tor-netdoc: Replace an IEFE with use of .and_then()Ian Jackson2026-05-051-3/+4
| | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3937#note_3405033 Suggested-by: Clara Engler <[email protected]>
* tor-netdoc: Apply deferred rustfmt churnIan Jackson2026-04-291-5/+7
|
* tor-netdoc: Turn DirectorySignatureHashAlgo back into a normal structIan Jackson2026-04-291-2/+12
| | | | | | Abolish the terrible macro. Review with --color-moved-ws=allow-indentation-change --color-moved.
* tor-netdoc: re-privatise some methodsIan Jackson2026-04-291-6/+4
| | | | | hash_slice_for_verification is still needed by code in poc, that we're not replacing in this MR. So that TODO gets downgraded, instead.
* tor-netdoc: directory-signature: don't re-hash unnecessarilyIan Jackson2026-04-291-3/+4
|
* tor-netdoc: Fix handling of explicit vs implicit dir sig SHA1 hashIan Jackson2026-04-291-6/+2
| | | | | Now that everything is prepared, we can add the sha1_unnamed field in the hash accumulator.
* tor-netdoc: Fix signature of hash_slice_for_verificationIan Jackson2026-04-291-5/+8
| | | | | | | In order to handle marked vs unmarked SHA1 correctly, it needs the original DigestAlgoInSignature. The only call site is in poc's verification code.
* tor-netdoc: Fix signature of hash_slice_for_verification (pre-fmt)Ian Jackson2026-04-291-1/+4
|
* tor-netdoc: Abolish poc's netstatus signature typeIan Jackson2026-04-291-0/+1
| | | | | | | | | | | | | | Use prod's Signature instead. This gets rid of: * The old parsing code. We have a new approach based on ItemValueParseable, KeywordOrString and and DigestAlgoInSignature. * The duplicate DirectorySignaturesHashesAccu and its temporary conversions. poc's verify_timeless function needs a little adjustment for the new struct layout.
* tor-netdoc: Promote hash_slice_for_verification to prodIan Jackson2026-04-291-0/+12
| | | | | | This function is not right, yet. We're going to fix it later. Review with --color-moved.
* 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-291-3/+41
| | | | | | | | | | | | | | | | | | 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-291-1/+39
| | | | | | | 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: derive ItemValue parsing/encoding for SignatureIan Jackson2026-04-291-3/+10
| | | | This doesn't let us do any verification or anything.
* 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: 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: 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: Gate vote-related incomplete code with "incomplete"Ian Jackson2026-04-281-5/+5
| | | | | | | | | | | 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 RouterStatusMdDigestsVote and SoftwareVersionIan Jackson2026-04-281-1/+0
| | | | | These are complete. Un-gate the RouterStatusMdDigestsVote implementation, and the export of both.
* tor-netdoc: Un-gate "plain-consensus" cargo featureIan Jackson2026-04-281-15/+4
| | | | As per #2492.
* tor-netdoc: Un-gate parse2 and encode loose impls under doc/netstatus (tidy)Ian Jackson2026-04-281-4/+1
|
* tor-netdoc: Un-gate parse2 and encode loose impls under doc/netstatusIan Jackson2026-04-281-3/+3
| | | | | | | | | | | | | | | 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
|
* tor-netdoc: Un-gate parse2 and encode loose impls in doc/netstatus.rsIan Jackson2026-04-281-12/+12
| | | | | | | | | | | This stabilises the parse2 and encode impls of * Lifetime * ConsensusMethods * SharedRandStatus * ConsensusAuthorityEntry All of these are complete.
* tor-netdoc: Un-gate parse2 and encode mods in doc/netstatus.rs (fmt)Ian Jackson2026-04-281-12/+12
|
* tor-netdoc: Un-gate parse2 and encode mods in doc/netstatus.rs (tidy)Ian Jackson2026-04-281-19/+7
| | | | | | Tidy the imports, and remove some now-unneeded { }. We'll run rustfmt in a moment to sort and reindent.
* tor-netdoc: Un-gate parse2 and encode mods in doc/netstatus.rsIan Jackson2026-04-281-16/+5
| | | | | | | | | | | | | | | | | | | | | | This stabilises the parse2 and encode impls of * NetParams<i32> * ProtoStatuses It also stabilises the parse2 impls of the following types which do not currently have any encode impls: * RelayWeight * rs::SoftwareVersion * IgnoredPublicationTimeSp As for TODOs and incomplete code: the things we're stabilising here are very simple, or fully formed. Implementing encoding for IgnoredPublicationTimeSp looks impossible, but we can cross that bridge when we come to it. We un-cfg-gate the parse2 and encode imports too.
* tor-netdoc: Upgrade a TODO re NetworkStatusUnverifiedVoteIan Jackson2026-04-281-1/+1
|
* tor-netdoc: Remove two now-otiose use'sIan Jackson2026-04-271-2/+2
|