| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| |
| |
| |
| |
| | |
Previously, this was't possible because derive-deftly wanted a string.
But now it can take a type, and types can contain macro calls inside
their generics etc.
This makes the code much more local and direct.
|
| | |
| |
| |
| | |
This is router *status* not router *descriptor*.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
No functional change.
|
| | |
| |
| |
| | |
This commit deserves no explanation, it should be the default.
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
| |
This commit introduces `RouterDesc::router` using `RouterDescIntroItem`
by moving `nickname`, `orport`, `dirport`, and `ipv4addr` into it.
A notable change is that ipv4addr is no longer stored in an `Option`.
I have no idea why this was the case because it has always been
mandatory and never None anyways, but I suspect it was to be able to
treat it as an iterator, something we can also achieve using
iter::once().
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
| |
Preamble now doesn't contain anything that's *wrong*. It is missing a
couple of fields that will be wanted when we generate votes.
|
| |
|
|
|
| |
This isn't needed for the arti dirauth consensus method, but it will
be needed for arti dirauth vote calculator.
|
| | |
|
| | |
|
| |\
| |
| |
| |
| | |
Store fingerprint in Option<SpFingerprint>
See merge request tpo/core/arti!3978
|
| | | |
|
| | |
| |
| |
| |
| | |
Will be required and unavoidable as we will change fingerprint to
Option<SpFingerprint> in the next commit.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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: Sort out netstatus signatures
See merge request tpo/core/arti!3937
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | | |
This module will be used when we derive ItemValueParseable on
Signature.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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).
|
| | | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | | |
And remove a then-unneeded import in a using module.
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|