| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
We'll want this in a moment, not just invert in place. I was tempted
to remove the mutating form, but there are at least two call sites.
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
It's Copy, in fact. But Copy iterators are a hazard.
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
We're going to want this for a more clever formatting algorithm.
|
| | |_|_|_|_|/ / /
|/| | | | | | | |
|
| |\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Encoding for RelayPlatform
See merge request tpo/core/arti!4114
|
| | | | | | | | | | |
|
| | | |_|_|/ / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
ItemArgumentParseable does not make much sense because the field is
effectively a free-form field similar to ContactInfo.
|
| |\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Fix small edcert papercuts
See merge request tpo/core/arti!4112
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
As a follow up to !4022 and discussed on IRC:
> Since we don't think we need to check the keys are different I think
> it's OK to delete the thing in the tests that insists we have such a
> check.
> [...]
> We are the relying party here. That MUST is directed to the signing
> party. As reliers we don't need to check it.
|
| | |/ / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Fixes a TODO as discussed in !4022.
Review with --color-moved.
|
| |\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
arti-client: Warn if `reconfigure()` possibly left the client in an inconsistent state
See merge request tpo/core/arti!4101
|
| | | | | | | | | | |
|
| |\ \ \ \ \ \ \ \ \
| |_|/ / / / / / /
|/| | | | | | | |
| | | | | | | | |
| | | | | | | | | |
tor-proto: Add unit test for `XonXoffReader`
See merge request tpo/core/arti!4093
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
The 'futures' version bump is needed so that our test can use
`UnboundedSender::try_recv()` in the minimal-versions CI test.
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This will allow us to add a unit test for `XonXoffReader`.
|
| | | | | | | | | | |
|
| |\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
tor-netdoc: fix EncodedAuthCert parsing
See merge request tpo/core/arti!4104
|
| | | |_|/ / / / / /
| |/| | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
It would swallow the whole rest of the document, leading to bizarre
output on re-encoding.
There is no test case for this in-tree (which is why this is cfg
"incomplete"), but I have a full roundtrip test of a vote (which
contains an authcert) in a wip branch, which detected this problem.
|
| |\ \ \ \ \ \ \ \ \
| |_|_|_|/ / / / /
|/| | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Avoid string slices in netdoc types
See merge request tpo/core/arti!4103
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This commit replaces the use of string slices in LongIdent by using
.strip_prefix() and .split_once() instead.
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Replaces the use of a string slice in conjuction with .rfind() with a
call to .rsplit_once().
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This commit replaces the use of a string slice in an address parse
helper by replacing calls to `.starts_with` / `.ends_with` to calls with
`.strip_prefix` / `.strip_suffix` and using the respective `.is_some()`
for the boolean like value, making the result functionally equivalent.
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This commit replaces the use of string slices in IpPattern with a call
to split_once(). Either review as it is or with --word-diff=color.
|
| | |/ / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This commit replaces a string slice use in PortRange with a call to
.split_string().
Either review the change as an entire rewrite, as the function in itself
is pretty small or use --color-moved --color-moved-ws=ignore-all-space
if you want to verify that the lines regarding a port range without a
hyphen is still using the same logic.
|
| | | | | | | | | |
|
| |/ / / / / / / |
|
| |\ \ \ \ \ \ \
| |_|_|_|_|_|/
|/| | | | | |
| | | | | | |
| | | | | | | |
tor-netdoc: Rename variants in VerifyGeneralTrustedAuthorities
See merge request tpo/core/arti!4099
|
| | | | | | | | |
|
| | | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In a wip branch I added a variant, and clippy complained. In this
case, I agree with clippy.
warning: all variants have the same postfix: `Authorities`
--> crates/tor-netdoc/src/doc/netstatus.rs:2335:1
|
2335 | / pub(crate) enum VerifyGeneralTrustedAuthorities<'r> {
2336 | | /// Trust these authorities.
2337 | | TrustTheseAuthorities {
2338 | | /// The HKP_auth_id_rsa
... |
2357 | | },
2358 | | }
| |_^
|
= help: remove the postfixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#enum_variant_names
note: the lint level is defined here
--> crates/tor-netdoc/src/lib.rs:9:9
|
9 | #![warn(clippy::all)]
| ^^^^^^^^^^^
= note: `#[warn(clippy::enum_variant_names)]` implied by `#[warn(clippy::all)]`
|
| |\ \ \ \ \ \
| |/ / / / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Always use destroy reason NONE in circuit handshake code
Closes #2466
See merge request tpo/core/arti!4088
|
| | | | | | | |
|
| | | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The spec was recently updated in [1],
so we should make this clearer in our code comments.
[1]: https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/490
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
tor-netdoc: overhaul consensus verification, in preparation for parse2 ns verification
See merge request tpo/core/arti!4065
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In an attempt to check that the new verification code makes sense, we
compare it with the freshly rewritten one in poc.
To review this, compare the code being deleted with the body of
verify_general (doc/netstatus.rs, line 2164 et seq).
You'll also want to refer to the body of find_cert and
check_signature (lines 2068-2086).
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Like verify_general does.
(This wasn't a bug before, because we could the length of ok, so all
that would happen is we'd do some extra work.)
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Obtain the hash first, like verify_general does.
No significant functional change, and this is poc code anyway.
|
| | | | | | | |
|