| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | |
|
| |/
|
|
|
| |
ItemArgumentParseable does not make much sense because the field is
effectively a free-form field similar to ContactInfo.
|
| |
|
|
|
| |
Adds RouterDesc::hidden_service_dir as well as an accompanying ZST
token.
|
| |
|
|
| |
No functional change.
|
| |
|
|
|
|
|
|
| |
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 changes the legacy parser to make use of the just added
.verify_inner() method.
For this, we replace the part that extracts crosscert_cert to only
extract the inner signature and expiry timestamp, because this is what
will be used ultimately. Inside this extraction, we change the parser
to only obtain the KeyUnknownCert without any further checks, after
which we will pass it to .verify_inner() to store the signatures and
expiry date.
Following this change, we now only change the places where the previous
crosscert_cert was used to extract signatures and expiration dates to
use the just extracted cc_sig and cc_expiry instead.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit creates a new method, Ed25519NtorCrossCert::verify_inner(),
which in essence represents a copying of the verification logic for ntor
cross certificates from the legacy parser into parse2 logic, with the
eventual goal to unify these two.
Unfortunately, a 1:1 move using --color-moved was not possible, because
the legacy parser uses edcert::UnvalidatedEdCert for this, which is a
very legacy parser specific type, as it contains a Pos in its inner
items.
Instead, I encourage reviewers to review the functional equality between
these two implementations using the following approach:
1. Open the .verify_inner() in one pane.
2. Open routerdesc.rs below the position where this commit introduces
the "XXX" comment in another pane next to it; this is the lion's
share of the legacy implementation of it.
3. Ensure that the properties that the legacy implementation achieves is
also achieved by .verify_inner(). This may require you to take a
look at UnvalidatedEdCert::check_cert_type() and similar methods and
verify that the if statements in .verify_inner() are equivalent.
As outlined above, we cannot make use of these methods directly
ourselves inside .verify_inner().
Keep in mind that the legacy parser only returns a
tor_cert::UncheckedCert, whereas .verify_inner() returns a gated type.
This is okay because UncheckedCert contains these gated types inside it
anyways.
|
| |\
| |
| |
| |
| | |
tor-netdoc: Remove accidential TODO left-over
See merge request tpo/core/arti!4081
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit removes an accidential TODO left-over related to eventdns,
which now appears as it would refer to caches-extra-info.
I must have forgotten to rebase this out after we decided to not include
eventdns in arti!4006, but looking at torspec!498, it is obvious that
the comment refers to eventdns and not caches-extra-info.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This commit adds #[allow(clippy::string_slice)] to all functions in the
code where string slices are used, alongside a TODO comment.
We do this add the function header to have it consistent, as things like
expression based allow's are still experimental.
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
This commit executes maint/add_warning with the just added change to
deny string slices except in tests.
I recommend auditing this by checking out the previous commit followed
by running the script yourself and then verifying that the diff is
identical to this commit.
This commit makes cargo clippy fail. We will add exceptions in the next
commit.
|
| | |
|
| |
|
|
|
|
| |
It is weird to have three possible states for truthiness here.
This commit removes the Option in favor of the inner type while adding a
TODO comment to somehow find a way to skip this during encoding.
|
| | |
|
| |
|
|
| |
Adds a TODO for using ConstantString for overload_general.
|
| |
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
No functional change, just rustfmt.
|
| |
|
|
|
|
|
|
|
| |
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 refactors the RelayPlatform test to store the test vectors in an
array and iterate over it, comparing it with the expected output. This
is a lot better than the current version, where there is not just a lot
of copy and pasted code but also some tests that only check for an okay
value.
Unfortunately, there is not an easy way to review this with
--color-moved or something. Personally, I would recommend to review
each original test vector (i.e. a line starting with `let p =` followed
by a string literal) and verify that the exact same string literal is
still present within the new test vector. Afterwards, verifying the
assertion logic should be easy, as it is a one-liner.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Just rustfmt.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Just rustfmt.
|
| |
|
|
|
|
|
|
|
| |
This commit modifies the legacy parser code in an ugly way to also
return a copy of the KeyUnknown certificate, which will be required for
an EmbeddedCert<> construction.
This is not nice but unavoidable in a setup that makes use of the
self-consuming tor_cert certificate chain, like the legacy parser code.
|
| | |
|
| |
|
|
| |
No functional change.
|
| |
|
|
|
| |
Removes a comment about the virtual/real distinguishment in RouterDesc
as there are no virtual items left anymore.
|
| |
|
|
|
|
|
| |
This item is no longer required because we can extract it from
family_cert.
Unfortunately it requires a breaking change to the getter.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This commit modifies the legacy happy families extractor to also return
KeyUnknownCert while adding a comment explaining on why this will be
required.
|
| |
|
|
|
|
|
|
|
| |
This commit splits the inner .map() function of the happy families
extractor in the legacy parser.
In the next commit, we will return both of these variables separately,
but for now this change has no functional change and only looks
redundant.
|
| |
|
|
|
| |
We will change the type in the next commit and this will make auditing
the next commits easier.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
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().
|
| | |
|
| |
|
|
|
| |
Will be required and unavoidable as we will change fingerprint to
Option<SpFingerprint> in the next commit.
|