| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
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
|
| |/
|
|
|
|
|
|
|
|
|
| |
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 is what iter_join is for.
|
| |\
| |
| |
| |
| | |
tor-netdoc: ns preamble: break out validity_time_range
See merge request tpo/core/arti!4054
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
We are going to want to use this when we implement verification for
network statuses from parse2.
Review with --color-moved.
|
| |\ \
| | |
| | |
| | |
| | | |
Lint for clippy::string_slice
See merge request tpo/core/arti!4086
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |/ /
| |
| |
| | |
This will let us encode consensus signatures sections.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: minor fixes arising from netstatus work
See merge request tpo/core/arti!4055
|
| | | |
| | |
| | |
| | | |
This matches C Tor and the spec.
|
| | |/
| |
| |
| | |
We need to use `-`, not `_`. So use concat! stringify!.
|
| |\ \
| |/
|/|
| |
| | |
tor-netdoc: No longer import crate::Result in doc::netstatus
See merge request tpo/core/arti!4050
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
This is a clearer.
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
We will test this when we test round trip parsing/encoding of votes.
For now, mark it as incomplete.
|
| | |
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3991#note_3413169
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3991#note_3413168
|
| | |
|
| |
|
|
| |
In the form of trait impls.
|
| | |
|
| |
|
|
|
|
|
|
| |
For encoding, we need to represent the raw parameters.
This change is carefully arranged so that when the retain unknown feature is
disabled (ie, in clients), the per-router data structure remains the
same.
|
| |
|
|
| |
Minor change which will make the next diff clearer.
|
| |
|
|
|
| |
This makes the error handling a bit more regular. It will also make
the code suit our further parsing changes better.
|
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413182
I left the word "fixed" in some of the docs and error messages, where
it seemed to make sense.
|
| |
|
|
|
| |
Replacing poc's. The new define_fixed_string macro is really helping
here.
|