| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | | |
| | | | | |
| | | | | | |
Co-authored-by: Ian Jackson
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit adds the tests for Ed25519NtorCrossCert by implementing
Ed25519CertTest for it and executing the respective generic test
functions for it.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit changes the invalid ed25519 cert unit test violation of a
missing signed-with extension if the generic type is not
Ed25519NtorCrossCertificate, as this type does not use this extension.
Instead, we change the test vector to a `mut Vec<_>` and push the
missing signed-with test if the generic parameter IS NOT of type
Ed25519NtorCrossCert.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Switches the invalid/out-of-place CertType away from ntor cross-cert
because we will add a test for this soon.
Instead, we now just an RSA certificate, should not collide with any
edcert.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit extends .verify() and .new_signed() in Ed25519CertTest to
accept the signing key next to the certified key in order to also
support Ed25519 certificates not containing the signed-with extension,
such as ntor certificates.
|
| | |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit adds the Ed25519NtorCrossCert type for use with
EmbeddedCert.
So far, this certificate may not be used directly tet, because of the
non-trivial X25519 -> Ed25519 conversion which is explained in a doc
comment.
The next commits will add more parse2-like types for actually parsing
it, by honoring the `bit` found in `ntor-onion-key-crosscert` items.
A unit test will be added in the immediate next commit.
|
| |\ \ \ \ \
| |/ / / /
|/| | | |
| | | | |
| | | | | |
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.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit updates Timebound's rustdoc to require inclusiveness when
checking the timeliness of a given object.
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit replaces a call to .duration_since(...).expect() with
.saturating_duration_since() for defensive programming. We will change
code related to it in the next commit.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit fixes the ed25519_invalid_cert unit test to not use `now` as
the expiration date when generating a certificate in order to test the
failed verification of it.
The reason for this is that we want to change the verification function
to be *inclusive* of the expiry date. If we were to use `now` as the
expiry date while also being at `now`, we would no longer get an error.
We will do the actual change in the next commits.
|
| |\ \ \ \ \
| |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Mark "counter-galois-onion" as stable
Closes #2550
See merge request tpo/core/arti!4069
|
| | | | | | |
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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 is technically a breaking change since it removes the
tor-rpc-connect, tor-rpcbase, and arti-rpcserver features from arti. But
I think these implicit features should not be expected to be stable.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
I want to call this in one of tor-netdoc's parse2 derives, which *do*
support generics.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If we move this let into the item impl, it will have access to the
generics we're about to add to the `impl $rule`.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Previously we were relying on the macro_rules pattern being in the
rustdoc. But it's about to get more complex.
Document it manually.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Usually Rust doesn't put a space after `:` in trait bounds. But it
does when calling a macro with { } syntax.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This bit of the doc contains both succeeding and failing examples,
each marked with an appropriate comment.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
I want this in tor-netdoc (which doesn't use tor-config and probably
shouldn't).
Almost entirely code motion. Review with --color-moved.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
I want to mvoe this to tor-basic-utils, so it can't use tor-config in
its example. Also, Cell is just a nicer example.
(The rule identifier was already wrong.)
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
IMO this makes the example clearer. It will also make moving this
macro to tor-basic-utils less noisy.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4070#note_3422636
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4070#note_3422637
We must allow it in poc, but poc is a thing we're trying to
abolish/replace, so that's OK.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Precisely the result of rustfmt.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
TimerangeBound is reasonably nice and this will fit in better when we
want to verify votes.
Adjust the one non-test call site (in tor-dirserver) using .and_then.
In the tests:
* Where we expected success, call .check_valid_at and add another .unwrap().
* Where we expected signature verification failure, delete the time parameters.
* Where we expected timeliness failure, call .check_valid_at and map the error.
* With nontrivial tolerance, add calls to `extend_[pre_]tolerance`.
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
We're about to make UnverifiedAuthCert::verify return a
TimerangeBound, not an AuthCert.
For the success cases, declare the expected return type.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
We're going to need to talk about Timebound in the non-test code.
|
| | | | | | | |
|
| | |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This makes more sense because:
* `start_bound` and `end_bound` return `Bound::Included`
* It doesn't make sense to say that a document isn't valid at
the very start of its validity period. (And we don't want a half-open range.)
* NotYetValid(0ns) and Expired(0ns) are rather nonsensical errors.
In real timeliness tests it will make no difference since the current
time is only equal to the bound for a nanosecond. But tests that like
to test corner cases might be affected, and possibly some synthetic
situations (where the document's own validity time start is used
somehow) might change.
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Lint for clippy::string_slice
See merge request tpo/core/arti!4086
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Add 'flowctl-cc' to 'default'
See merge request tpo/core/arti!4042
|
| | | | | | | |
|