| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
| |
Replacing poc's. The new define_fixed_string macro is really helping
here.
|
| |
|
|
|
| |
Defining a struct gives us a place to hang the documentation, and
avoids an accidentally-exhaustive tuple.
|
| |
|
|
|
|
|
| |
This is more code than the poc version but much of the extra is
documentation, and it seems much less magical this way.
We still need a handwritten parser for plain consensuses, sadly.
|
| |
|
|
|
|
|
|
| |
The order of arguments of poc's ns_type macro is different to that of
the real code. This is very confusing!
However, the type is correct, once we've added the singleton signature
for votes.
|
| |
|
|
|
|
| |
We're going to need this for type-driven parsing of the
necessarily-absent flavour argument in a vote's
`network-status-version`.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
We're going to want quite a lot of this for eg network-status-version.
|
| |\
| |
| |
| |
| | |
Add Bandwidth support to Router Descriptors
See merge request tpo/core/arti!4005
|
| | |
| |
| |
| |
| |
| | |
This commit adds the bandwidth field to the RouterDesc struct as it is
found within the spec. The legacy parser will not support it, hence why
we do default values there.
|
| | |
| |
| |
| |
| | |
This commit adds the bandwidth struct for router descriptors which is
present in the `bandwidth` item.
|
| |\ \
| |/
|/|
| |
| | |
tor-netdoc: Implement encoding for referenced doc digest in rs entries
See merge request tpo/core/arti!3989
|
| | |
| |
| |
| |
| | |
This is not tested yet. It will be tested when we add round-trip
tests for votes.
|
| | |
| |
| |
| | |
This doesn't parse the keyword, only the value.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
* Rename it so that it doesn't mention parse2, because we're going to
want to encode too.
* Remove the indirection: rename the one in md.rs to be the name
that's used in `with = `. (Previously, things were more complicated
so the extra layer of indirection was helpful.)
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
FixedB64 is the right type for these, when they are present.
This abolishes some ad-hoc boilerplate. Sadly we still need a bit of
that for Reasons.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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*.
|
| | | |
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | | |
Implement Elliptic Curve Certificates for Router Descriptors
See merge request tpo/core/arti!3939
|
| | | |
| | |
| | |
| | |
| | |
| | | |
This commit removes the Ed25519 round-trip verifciation in certificate
creation because it reduces the code complexity and is pretty uncommon
in cryptographic code.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
This commit tests an invalid certified key type by adding a test that
does not use CertifiedKey::Ed25519.
|
| | | |
| | |
| | |
| | | |
No functional change.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit adjusts the tests to make it possible to add a test for a
non-matching certified key type.
For this, we simply store the certified key as a CertifiedKey and not as
an Ed25519Identity. Inevitably, this requires us to "force" create such
an identity on the fly in order to test the mismatch, which is fine
because it is an edge-case anyways.
|
| | | |
| | |
| | |
| | |
| | | |
Fixes the numbering due to a recently added additional check.
Review using --word-diff=color.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit properly verifies the certified key type by not returning a
bug but rather invalid data in the case of the certified key not being
an Ed25519 key.
Tests and number adjustments will follow.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit adds a new type, Ed25519FamilyCert, which works very similar
to Ed25519IdentityCert, except that it supports family certificates.
A notable difference is, that the identity key must be provided during
verification because it does not make sense to verify these certificates
without it.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit implements the Ed25519IdentityCert type using EmbeddableCert
logic that was introduced recently. These certificates contain the
identity key and the signing key of a relay and the type provides two
methods: .verify() for verification and .new_signed() for construction.
Besides, edcert::* is now made public as this is required now given that
it contains public types.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit adds the test utilities required for testing the
yet-to-be-implemented Ed25519IdentityCert and Ed25519FamilyCert types,
whose interface largely overlaps, making a test "framework" useful to
avoid code duplication.
Their interfaces consist of two functions:
* `.verify(Ed25519Identity, KeyUnknownCert, Duration, SystemTime)`
* Verifies a KeyUnknownCert whether it is valid, given a SystemTime
plus post valid tolerance alongside a well-known identity key in
the case of family certificates.
* `.new_signed(&ed25519::Keypair, Ed25519Identity, SystemTime)`
* Creates a new certificate from a signing keypair plus a certified
key alongside a SystemTime at when this certificate will expire.
The commit introduces a testing trait that will be implemented for both
types once added. Then, there are two generic tests that test the
generation and verification of a valid random one as well as a test that
tests violation of various constraints common to these certificates.
The generic trait is most notable for the .new_signed() and .verify()
method which we are roughly documented. Please see the next commit for
a concrete example if understanding is hard.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit moves the documentation for FromIterator<RelayFamilyId> for
RelayFamilyIds to the type level documentation of RelayFamilyIds. It
also rephrases the comment to fit in there more nicely grammatically and
contextually, as a pure motion of the comment would not have been
helpful to have there in any circumstance.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Adds a TODO with regard to .sort() and .dedup() in FromIterator in
RelayFamilyIds and the fact that it is slightly weird. This is not a
new problem with the type but stems from the fact that it tries to
emulate a BTreeSet inside a Vec which is not nice.
|
| | | |
| | |
| | |
| | | |
While already here, do this change, in case it becomes useful later on.
|
| | | |
| | |
| | |
| | |
| | | |
This makes working with this more comfortable as those calls are
generally required anyways.
|
| | | |
| | |
| | |
| | |
| | | |
RsaIdentity implements Copy itself so it makes sense to derive it on
those wrappers too.
|
| | | |
| | |
| | |
| | | |
Helpful in tests instead of Deref.
|
| | | |
| | |
| | |
| | | |
Fixes an outstanding TODO.
|
| |/ /
| |
| |
| |
| | |
We will need an inverse of the existing From implementation so that
derivation makes sense because we will obtain it for free then.
|
| | | |
|
| | |
| |
| |
| | |
No functional change.
|
| | |
| |
| |
| | |
This commit deserves no explanation, it should be the default.
|