| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| |
|
|
| |
No longer required because it implements Copy.
|
| |
|
|
|
|
|
|
|
|
| |
This commit fixes the range to NOT include SystemTime::UNIX_EPOCH.
This is because TimerangeBound makes a difference between a lower bound
being Some or None.
This was discovered later during test and is crucial to properly detect
a minimum in the yet-to-be-merged .verify() method for router
descriptors.
|
| |\
| |
| |
| |
| | |
tor-netdoc: ExpandedKeypair for Ed25519NtorCrossCert::new_signed()
See merge request tpo/core/arti!4155
|
| | |
| |
| |
| |
| |
| |
| | |
This commit changes Ed25519NtorCrossCert::new_signed() to accept an
ExpandedKeypair instead of a Keypair, because when converting the ntor
key using convert_curve25519_to_ed25519_public(), only the
ExpandedKeypair is returned, which is a one-way conversion from Keypair.
|
| |\ \
| |/
|/|
| |
| | |
tor-netdoc: Remove document hash from Microdesc struct (and add MicrodescAndHash for that)
See merge request tpo/core/arti!4138
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The Microdesc type having a copy of the document hash was always
weird, and it's weirder now that there's all these parse2 types that
don't have it and parse2 derives on Microdesc that don't touch it.
Make a new type for the descriptor and its hash.
Use deref to arrange that the new type works almost like the old one.
Adjust the use lines in the dependencies to temporarily import
MicrodescAndHash as Microdesc.
|
| | |
| |
| |
| |
| | |
Code motion, plus adding a new impl block, to make the next commit
clearer.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: Replace trivial string slice
See merge request tpo/core/arti!4143
|
| | | | |
|
| | | |
| | |
| | |
| | | |
No functional change, just reformatting.
|
| |/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit replaces the use of string slices with str::get() in all
document related code.
While this is not a perfect replacement for it, the relevant parts in
the code heavily depend upon the byte offsets returned by the low level
(legacy) parser where changing it would lead to a very big refactoring.
Nonetheless, this approach is better because returning a bug is better
than crashing.
|
| | |
| |
| |
| | |
Removes a blocking comment and replaces it with a TODO DIRAUTH.
|
| | |
| |
| |
| | |
As a shorthand for T::intern_cache().intern(value).
|
| | |
| |
| |
| | |
This commit wraps the port policies in an Intern.
|
| | |
| |
| |
| | |
This commit wraps the relay family in an Intern instead of an Arc.
|
| | |
| |
| |
| | |
Just a boilerplate implementation.
|
| | |
| |
| |
| |
| | |
This commit implements ItemValueParseable and ItemArgumentParseable for
Intern<T> types. This should be sufficient for the time being.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
No functional change.
|
| | |
| |
| |
| |
| | |
This commit modifies the codebase to actually return Intern<T> in
InternCache<T> and adds calls to .into() accordingly.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
No functional change.
|
| | |
| |
| |
| |
| |
| |
| | |
This commit modifies the .verify() method for the Ed25519 embedded
certificates to wrap the result in a TimerangeBound, which inevitably
also changes the function signature in terms of arguments to no longer
accept SystemTime/Duration arguments.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
tor-netdoc: addr policy: Overhaul and fix /0 bug
Closes #2589
See merge request tpo/core/arti!4128
|
| | | |
| | |
| | |
| | |
| | |
| | | |
IMO it makes more sense to describe the semantics, than the syntax.
(This is a private type at the moment.)
|
| | | |
| | |
| | |
| | |
| | | |
These are currently accepted. I'm not sure if we want to change that.
For now, add a test case.
|
| | | |
| | |
| | |
| | |
| | | |
ipnet is a very widely used crate which is already in our dependency
stack.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
ADDR/0 is not the same as *, because it specifies the IP version.
Turning 0.0.0.0/0 into * is wrong, because * accepts IPv6 too.
Do this by abolishing the V4Star and V6Star variants. Sadly Rust
thinks that u32 << 32 is an overflow, not zero, so we do still need a
special case for a zero prefix length. (But we're about to delete
this code.)
Fixes #2589.
|
| | | |
| | |
| | |
| | | |
This is, also, wrong.
|
| | | |
| | |
| | |
| | |
| | | |
We should privilege the "is the same" case. Rename check to check2
and check1 to check.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This allows us to easily distinguish by eye, the cases where things
changed (ie, where the input string was canonical), from the ones
where they didn't.
One of these cases is a bug.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
A "mask" is a bitmask, eg 255.255.0.0 in 192.168.0.0/255.255.0.0.
These are all prefix lengths.
Using the word "mask" to refer to a prefix length is quite bad,
because prefix lengths are numbers and sometimes masks are too.
Using one as the other would be a bug.
|
| |\ \ \
| |_|/
|/| |
| | |
| | | |
Derive NetdocParseableUnverified for RouterDesc
See merge request tpo/core/arti!4134
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This adds a very small RouterDesc parse2 test only verifying whether the
testdata2 gets properly parsed, with a minimal length verification
alongside two identity related fields.
Once we have encoding and verification support, we have to extend this
test of course.
|
| | | |
| | |
| | |
| | |
| | | |
Only for testing, just returns the inner body. Will be removed once we
have a proper verify method.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Finally! 🎉
This commit derives NetdocParseableUnverified for RouterDesc by adding
the respective derive_deftly attributes to the top-level definition as
well as the member fields that require it.
A .verify() method as well as unit tests will be added in the next
commits.
Encoding still depends on a few tiny papercuts but will otherwise be
added shortly too, although in a different branch.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
We don't need the type to be private. Indeed, we'd like it not to be
to make Microdesc construction with Constructor regular
|