| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
This commit changes the tpye of `RouterDesc::identity_ed25519` to be of
EmbeddedCert.
Using the inner keys as the verified values is fine because the legacy
parser continues to verify the legacy cert, as it extracts its timestamp
and signature to the Vec it verifies in the end.
|
| | |
|
| |
|
|
|
| |
The new encoding impls are feature = "incomplete" so don't need to be
here.
|
| |
|
|
|
|
|
|
| |
When we are generating documents that need to be stable, we need to
generate the same document regardless of what subset of digest names
we understand.
So order DigestName by its string representation.
|
| | |
|
| |
|
|
|
|
|
| |
This item is no longer required because we can extract it from
family_cert.
Unfortunately it requires a breaking change to the getter.
|
| |
|
|
| |
We will need it in the next commit.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit adds the family_cert field to RouterDesc using EmbeddedCert
logic.
Unfortunately, it requires some code gymnastics similar to the (not yet
merged) identity-ed25519 certificates, which we also outlined in a
comment of a previous commit in the branch. Long story short: The
legacy parser and parse2 do not like to co-exist in the same scope due
to the self-consuming tor-cert verification chain of which the legacy
parser makes heavy use.
|
| |\
| |
| |
| |
| | |
tor-netdoc: encoding support for `w` line in routerstatus
See merge request tpo/core/arti!3991
|
| | | |
|
| | |
| |
| |
| |
| | |
Convert the from_net_params constructor into a TryFrom. Retain the
bespoke method for the benefit of the old parser.
|
| | | |
|
| | |
| |
| |
| |
| | |
Not just NetParams<i32>. We're going to want it for NetParams<u32> in
a moment.
|
| | | |
|
| | |
| |
| |
| | |
Call the existing string encoding code.
|
| | |
| |
| |
| |
| | |
This seems trivial enough I don't feel the need to mark it
"incomplete" even though there is no test case.
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes the data type of RouterDesc::or_address from
Option<(net::IPv6Addr, u16)> to Vec<net::SocketAddr>.
This is the correct behavior according to the spec, meaning I will not
give a lengthy explanation on why this is better.
Reviewers might now be questioning whether the spec is wrong and/or if
this is a dangerous change, as Arti used to only extract the first IPv6
address and CTor doing a similar thing.
Following an IRC discussion with nickm@, we came to the conclusion that
both implementation techniques are right. It is okay for the document
to hold multiple addresses, it is okay for the implementation to ignore
all but the first (IPv6 address). What is not okay however, is for an
implementation to reject documents with multiple addresses.
Besides, router descriptors are not used in the existing code for
selecting the address of a relay, meaning this change has very little
practical meaning.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As pointed out in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413185
this was a duplicate.
The new NoFurtherArguments
* Implements encoding
* Implements more traits
* Is in the right module (types::misc - it's not just for parsing)
* Has a slightly better name
* Had an open-coded parsing impl (which we now replace)
* Had minor differences to docs (so we add a line to NoFurtherArguments)
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413184
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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 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().
|
| | |
|
| | |
|
| |
|
|
|
| |
This will let us use them in types in ordered lists in netdocs,
without fuss.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
| |
We're going to use this for `directory-signature`'s hash algorithm,
which the current code always treats as a string!
|
| | |
|
| |
|
|
|
| |
Make the operation of disregarding the possible existence of
already-discarded information, more explicit.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|