| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We are going to reuse/move this test code. Ie, it is going to be
testing the real network document types.
The naming outside poc is different. To make future diffs a bit less
noisy, change some type names in the test code and fudge it up with a
use.
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
We have the #1645 allow at the top of lib.rs, so this is unnecessary
bureaucracy. Let's simplify this before adding more to it.
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | | |
This calculation appeared 3 times.
|
| | | | | |
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
Encode for SpFingerprint
See merge request tpo/core/arti!4116
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit adds a round-trip encoding for SpFingerprint to the already
existing parsing test.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Do not shadow s and provide access to Wrapper instead of just the inner
fingerprint. We will make use of this soon.
|
| | |/ / /
| | | |
| | | |
| | | |
| | | | |
Implements encode::ItemArgument for SpFignerprint. A test will be added
in the next commit.
|
| |\ \ \ \
| |/ / /
|/| | |
| | | |
| | | | |
Add ntor onion key cross certificate to RouterDesc
See merge request tpo/core/arti!4109
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit moves the construction place for the NtorOnionKeyCrossCert
from the final RouterDesc construction to the crosscert code block,
which should be more correct.
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
This commit adds ntor_onion_key_crosscert to RouterDesc as well as
integrating it into the legacy parser.
|
| | | | |
| | | |
| | | |
| | | | |
No functional change.
|
| | | | |
| | | |
| | | |
| | | | |
We will soon need it for the ntor cross certificate.
|
| | | |/
| |/|
| | |
| | |
| | | |
We will need it for compatibility with the legacy parser soon. Not
super nice.
|
| | | | |
|
| | | | |
|
| | | | |
|
| |\ \ \
| |_|/
|/| |
| | |
| | | |
tor-netdoc: port policies: Encode with reject if it's shorter
See merge request tpo/core/arti!4108
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
When trying to repro a live consensus, I discovered that `reject 25`
turned into `accept 1-24,26-65535`.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Use // to force rustdoc to multi-line layout. That makes the layout
uniform across all these test cases, and will make the next commit
clearer.
|
| | | |
| | |
| | |
| | |
| | | |
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.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
|
| |/ |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)]`
|
| |\
| |
| |
| |
| | |
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.
|