| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
This will allow it to be a replacement inside `SignatureHashes`.
Keeping the fields private seems to have been an oversight.
|
| | |
|
| |
|
|
|
| |
This is the whole of the footer section, with docs, appropriate
derives, and so on.
|
| | |
|
| |
|
|
|
| |
Add links to the spec, and delete explanatory text (that ought to be
in the spec, not here).
|
| |
|
|
| |
This matches the spec.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Only SharedRandStatuses was out of place.
|
| | |
|
| |
|
|
| |
This is rather ugly, because the protocol is being ad-hoc again.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3937#note_3405033
Suggested-by: Clara Engler <[email protected]>
|
| | |
|
| |
|
|
|
|
| |
Abolish the terrible macro.
Review with --color-moved-ws=allow-indentation-change --color-moved.
|
| |
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
Now that everything is prepared, we can add the sha1_unnamed field in
the hash accumulator.
|
| |
|
|
|
|
|
| |
In order to handle marked vs unmarked SHA1 correctly, it needs the
original DigestAlgoInSignature.
The only call site is in poc's verification code.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This function is not right, yet. We're going to fix it later.
Review with --color-moved.
|
| |
|
|
|
| |
This is now pretty straightforward. The functions it calls need some
work - we have blocking TODOs for that.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
| |
This doesn't let us do any verification or anything.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
These are complete. Un-gate the RouterStatusMdDigestsVote
implementation, and the export of both.
|
| |
|
|
| |
As per #2492.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This stabilises the parse2 and encode impls of
* Lifetime
* ConsensusMethods
* SharedRandStatus
* ConsensusAuthorityEntry
All of these are complete.
|
| | |
|
| |
|
|
|
|
| |
Tidy the imports, and remove some now-unneeded { }.
We'll run rustfmt in a moment to sort and reindent.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|