| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |\ \
| |/
|/|
| |
| | |
Add ntor onion key cross certificate to RouterDesc
See merge request tpo/core/arti!4109
|
| | |
| |
| |
| |
| | |
This commit adds ntor_onion_key_crosscert to RouterDesc as well as
integrating it into the legacy parser.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/
|
|
|
| |
ItemArgumentParseable does not make much sense because the field is
effectively a free-form field similar to ContactInfo.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This commit adds the NtorOnionKeyCrossCert data type; a data type
implementing ItemValueParseable, intended for use within RouterDesc and
parse2.
This type wraps around the previously added Ed25519NtorCrossCert type in
a fashion that honors the `bit` argument.
|
| |
|
|
|
|
|
| |
This would let us use `.parse_arg::<String>()` in old parsing code.
I wanted this for recommended versions, and then didn't use it, but it
seems useful anyway.
|
| |\
| |
| |
| |
| | |
tor-netdoc: routerstatus: add missing fields
See merge request tpo/core/arti!4061
|
| | | |
|
| | |
| |
| |
| |
| | |
Adds RouterDesc::hidden_service_dir as well as an accompanying ZST
token.
|
| |/
|
|
|
|
|
|
| |
This commit modifies RouterDesc to replace all occurrences of `bool`
with `Option<ItemPresent<T>>` while adding respective ZST tokens for the
respective items.
In this case, it adjusts caches_extra_info and tunnelled_dir_server.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds the Ed25519NtorCrossCert type for use with
EmbeddedCert.
So far, this certificate may not be used directly tet, because of the
non-trivial X25519 -> Ed25519 conversion which is explained in a doc
comment.
The next commits will add more parse2-like types for actually parsing
it, by honoring the `bit` found in `ntor-onion-key-crosscert` items.
A unit test will be added in the immediate next commit.
|
| |
|
|
|
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4070#note_3422637
We must allow it in poc, but poc is a thing we're trying to
abolish/replace, so that's OK.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
TimerangeBound is reasonably nice and this will fit in better when we
want to verify votes.
Adjust the one non-test call site (in tor-dirserver) using .and_then.
In the tests:
* Where we expected success, call .check_valid_at and add another .unwrap().
* Where we expected signature verification failure, delete the time parameters.
* Where we expected timeliness failure, call .check_valid_at and map the error.
* With nontrivial tolerance, add calls to `extend_[pre_]tolerance`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
All of the pieces are in place for this now.
Some of the pieces are not entirely complete or correct at this point:
that's sorted out by other MRs already open.
Currently there is no encoding, no verification functdion, and no
tests. Encoding depends on another oustanding MR (arti!4058).
Verification depends on the rework in arti!4065.
Tests are still to come.
|
| |
|
|
|
| |
The actual item field isn't in the struct yet, because that would
produce conflicts with other outstanding work in this same struct.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds the ItemPresent type, which is intended for token types
where the mere presence implies a truthful value, such as
`tunnelled-dir-server`.
For now, it lives in `ignored_impls` because it does in fact ignore
(actually rejects) everything around the item except the keyword.
The type implements ItemValueParseable and ItemValueEncodable; both
implementations being very minimal and only parsing/emitting the
keyword.
A test will be added within the next commit.
|
| | |
|
| |
|
|
| |
This field is taken from the spec.
|
| |
|
|
| |
This commit adds the contact field to RouterDesc.
|
| |
|
|
| |
This commit adds support for the overload-general field to RouterDesc.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The NetdocParseableUnverified derive macro implements this
trait (amongst other things). Traits and derive macros should have
aligned names.
This is only used for parsing, so let's keep the "Parseable" part of
the name.
I don't think the effort of deprecated alias, for downstream
compatibility, is worth it, our compatibility policy notwithstanding.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This commit changes RelayPlatform::TorVersion to store the platform to
an Option<String> instead of a String because storing a missing/not
present platform as the empty String feels wrong in my opinion.
Besides, we will soon need to add encoding for this type, making now a
good time to change it.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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`.
|