| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| |
| | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4065#note_3423331
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This avoids passing the threshold around as a bare usize, separated
out from the list of trusted authorities.
Roughly as discussed in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4065#note_3423775
But, VGTA::HazardouslyAssumeAllAuthCertsAreRealAuthorities contains
n_authorities, not the thtreshold. That's what its user has, and that
allows us to centralise the threshold calculation somewhat.
The situation with votes in poc is a bit odd now: we pass one cert and
then there's one authority so the threshold of 1 is calculated rather
than literal. That's OK, but also we perhaps aren't going to use
verify_general for votes in the production.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
No functional change with the existing caller.
|
| | |
| |
| |
| |
| |
| |
| | |
Introduce ConsensusVerifiabilityError.
No functional change with the existing callere, which discards the
error value.
|
| | |
| |
| |
| |
| |
| | |
Now the caller can use .map_err rather than if .ok().
No functional change.
|
| | |
| |
| |
| | |
No functional change.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Move the body of check_signature into verify_general.
check_signature was the only thing that returned SigCheckResult.
No functional change.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
And split check_signature into signature_to_verify which obtains a
ConsensusSignatureToVerify, and then a call to .verify().
The return values are still a bit janky.
No functional change.
|
| | |
| |
| |
| |
| |
| |
| | |
Previously this was arguably needed for clarity. With the new hash
finding arrangements, much less so.
No functional change.
|
| | |
| |
| |
| |
| |
| |
| | |
Use an exhaustive pattern. This allows us to spot any fields which
we omit to look at, which would be an indication of a possible bug.
No functional change.
|
| | |
| |
| |
| | |
No functional change with the current caller.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This does not fix the bug with the old parser. The old parser always
uses the `sha1` field in `hashes` even when `sha1_unnamed` would be
right. But it also always sets `sha1`.
Or to put it another way, because the old parser parses an unspecified
algorithm as if it were explicitly `sha1`, it then both sets the
digest_algo to DigestAlgoInSignature(Some(...)), and writes the hash
to the `sha1` field.
So this does not have an overall functional change with the old
parser, and nothing else calls this.
I'm fixing this here, now, so that the new parser doesn't inherit the
bug. The new parser will set `digest_algo` correctly, and correctly
write the hash to `sha1` or `sha1_unnamed`.
What a terrible protocol this is.
|
| | |
| |
| |
| | |
No functional change.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This is going to be the entrypoint for sharing verification code with
parse2. For now it must be pub(crate) since we're going to call it
from poc.
No functional change.
|
| | |
| |
| |
| |
| | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4059#note_3424494
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An existing real consensus says something like this:
client-versions 0.4.8.19,0.4.8.20,0.4.8.21,0.4.8.22,0.4.8.23,0.4.8.24,0.4.8.25,0.4.9.4-rc,0.4.9.5,0.4.9.6,0.4.9.7,0.4.9.8
so it's not using the additional arguments, and the spec says those
should be ignored.
See also torspec!500.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a single comma-separated argument, with absence of the item
being the same as absence of the arguemnt.
The previous code had `Vec<String>` which in parse2 would mean zero or
more occurrences of the item, with one argument each.
The old parser would split the whole RHS of the arguments. It still
does right now - we'll fix that in a moment.
|
| | |
| |
| |
| | |
This will make the next change here slightly less confusing.
|
| | | |
|
| | |
| |
| |
| | |
Again, this is going to get more complicated, so let's make a closure.
|
| | |
| |
| |
| | |
This is going to get more complicated, so let's make a closure for it.
|
| |/ |
|
| |\
| |
| |
| |
| | |
tor-netdoc: Replace ad-hoc pseudo-diff with unidiff from imra
See merge request tpo/core/arti!4096
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | | |
Use tor_basic_utils::iter_join in a couple of places
See merge request tpo/core/arti!4091
|
| | | |
| | |
| | |
| | | |
This is what iter_join is for.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
tor-netdoc: routerstatus: add missing fields
See merge request tpo/core/arti!4061
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | | |
This was simply missing.
|
| | |/ / |
|
| | | |
| | |
| | |
| | |
| | | |
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.
|
| |\ \
| | |
| | |
| | |
| | | |
Add Ed25519NtorCrossCert
See merge request tpo/core/arti!4022
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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: ns preamble: break out validity_time_range
See merge request tpo/core/arti!4054
|
| | | |
|
| | |
| |
| |
| | |
Remove the otiose `preamble` and `timebound_range` bindings again.
|
| | |
| |
| |
| |
| |
| |
| | |
We are going to want to use this when we implement verification for
network statuses from parse2.
Review with --color-moved.
|
| | |
| |
| |
| |
| | |
Introduce and use bindings `preamble` and `timebound_range` that will
make the next change easier to review.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: Remove accidential TODO left-over
See merge request tpo/core/arti!4081
|