| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Needed for tor-dirserver testing.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
The underlying type also implements Copy. We will need it later.
|
| |
|
|
| |
Rather than converting it to an Arc. This is the new idiom for Intern.
|
| | |
|
| |
|
|
|
| |
I keep finding I want to encode things and then I have to prat about
with a NetdocEncoder. Let's provide potted versions.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function returns a `TimeRangeBound`. That implies a
responsibility on the caller to check the time. It doesn't make sense
for this function to do the check as well.
But, it turns out that in tor-hsclient, the `TimeRangeBound<HsDesc>`
is sometimes processed with `.dangerously` on the assumption that it
was checked earlier. I considered changing this, and storing plain
`HsDesc` and a separate `TimeRange` - but that's not right, because
there are places where the `TimeRangeBound<HsDesc>` is used well after
it was verified.
Instead, in this commit, I (effectively) move the `.check_valid_at`
call from `parse_decrypt_validate` to its principal call site.
This involves a change to the error representation. Previously,
validity time errors ended up as `DescriptorErrorDetail::Descriptor`
containing an `HsDescError::OuterValidation` HsDescError::
InnerValidation`, which in turn contains a
`tor_netdoc::Error`. (`tor_netdoc::Error` is a rather awkward type.)
Now we have our own error variant. The overall behaviour is
unchanged.
|
| |
|
|
|
|
| |
In some sense this is a convenience wrapper around `push_ordered`,
but, really, it's the only nontrivial constructor that doesn't take an
iterator of individual port numbers.
|
| |
|
|
|
|
| |
The macro-generated code for `#[deftly(netdoc(flatten))]` relies on
this. The Default impl is genereated by the derive, but a generic
or handwritten `NetdocParseableFields` wouldn't work.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This will be used for exit port summary calculations.
|
| |
|
|
|
| |
This reverts the Eq derives added in !4150 while keeping the PartialEq,
in order to support including this in Unknown.
|
| | |
|
| | |
|
| |
|
|
| |
Needed for encoding.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This type consists of, and will always consist of, two u16. Making it
Copy is convenient.
This will preclude us making it contain a RangeInclusive because
std::ops::RangeInclusive is not Copy (due to API design blunder in
std), and std::range is still unstable. I think that's OK.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| |
| |
| | |
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.
|
| | | |
|
| | |
| |
| |
| | |
This commit wraps the port policies in an Intern.
|
| | |
| |
| |
| | |
This commit wraps the relay family in an Intern instead of an Arc.
|
| | |
| |
| |
| |
| | |
This updates semver.md with the breaking changes done to the Ed25519
certificate verification methods.
|
| |\ \
| |/
|/|
| |
| | |
Derive NetdocParseableUnverified for RouterDesc
See merge request tpo/core/arti!4134
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| | |
This lets us skip fields which have the default values.
|
| |/
|
|
|
|
|
| |
All these types already have parsing derives.
The encoding isn't quite right yet. It's legal, but doesn't match C
Tor as well as we'd like.
|
| |
|
|
|
| |
This commit implements NetdocEncodableFields for AddrPolicy in a
non-trivial fashion. A unit test will be added in a moment.
|
| | |
|
| |\
| |
| |
| |
| | |
Implement encoding and verification for consensuses, and add a round trip test
See merge request tpo/core/arti!4100
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | | |
Encode for SpFingerprint
See merge request tpo/core/arti!4116
|
| | |/
| |
| |
| |
| | |
Implements encode::ItemArgument for SpFignerprint. A test will be added
in the next commit.
|