| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit adds a to_rsa_id() helper function to the authcert tests in
order to convert a hex-encoded RSA identity to an RsaIdentity. It will
be required later on for converting the test vector values to the inner
representations and this function is helpful here because it avoids us
to do repetitive unwrapping and RsaIdentity::from_hex calls, which
overall increase the length/readability.
|
| | |
| |
| |
| |
| |
| |
| | |
This commit adds the pem_to_rsa_pk helper function to the authcert tests
in order to convert a PEM encoded RSA public key to the internal data
structure. It will be required later on in order to convert the test
vector strings to internal representations.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This commit adds a to_system_time helper function accepting an &str in
the Iso8601TimeSp format and converting it to a SystemTime to the
authcert test cases. It will be required later on in order to
conveniently convert human readable timestamps to the test vectors
expected from parsed data.
|
| | | |
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This commit removes the implementation of ItemArgumentParseable for
curve25519::PublicKey in favor of using the already existing
Curve25519Public, which also got beefed up slightly.
|
| |
|
|
|
| |
This commit refactors Ed25519IdentityLine by deriving as much as
possible.
|
| |
|
|
|
|
|
|
|
| |
This commit uses a proper PEM parser as a dev-dependency to tor-netdoc
for parsing PEM entries, instead of hard-coding long DER byte strings.
It is better to use an external crate for this here, rather than the
existing somewhat accessible (only through traits) implementation of
parse2, because it feels wrong testing parse2 with parse2.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes a bug in the microdescriptor parser to properly parse
multiple family-ids.
Previously, we interpreted the spec to simply contain multiple
`family-ids` lines. This is wrong however. Instead, there may only be
a single such line with multiple values.
To fix this issues, we itnroduce a `RelayFamilyIds` type, similar to
`RelayFamily`, that stores multiple `RelayFamilyId` entires in a `Vec`.
Then, we just derive `ItemValueParseable` on it and win.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This makes it possible to parse2 micro descriptors, which will be very
useful later on.
For this, it makes a few changes. Most notably, it introduces a
(private) field called `onion_key`, which stores an optional RSA onion
key, as it serves as the introduction line for this netdoc document
type. Besides, it also changes the `ed25519_id` type to the
`Ed25519IdentityLine` wrapper type, although the signature of the
respective getter remains the same.
|
| | |
|
| |
|
|
|
| |
Get rid of the version in poc. Instead, implement the same
functionality in terms of AuthCert::verify, outside poc.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
These are in fact just a completely normal RSA signature like in the
spec!
Move the type to the types module, and rename it. Leave a
compatibility alias.
|
| | |
|
| |
|
|
| |
This will allow us to use it for encoding as well as parsing.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
The hidden __non_exhaustive field has to be pub.
And, fix the use site, currently AuthCert.
|
| |
|
|
|
|
|
|
|
|
|
| |
This method verifies all the signatures, and checks that the signing
authority is in the provided list. Anyway, authcerts aren't really
self-signed: they're a signature by KS_auth_id_rsa on
KP_auth_sign_rsa.
Note that there is also a `verify_selfcert` method which does only
some of the checks, and has some code duplication. That will be
cleaned up later.
|
| |
|
|
|
|
|
|
|
|
|
| |
With the introduction of the derives for document encoding, we now
have a trait ItemObjectEncodable. We will want a method on
ItemEncoder that takes an ItemObjectEncodable, and that should be
called `object` since it's a better approach than working ad-hoc with
tor_bytes::Writeable. (For example, an ItemObjectEncodable knows its
own label.)
So, rename `object` to `object_bytes`.
|
| | |
|
| |
|
|
| |
Typos found with codespell
|
| | |
|
| |
|
|
| |
Such an impl is a footgun. Explain this in docs & comments.
|
| |
|
|
| |
(pre-fmt)
|
| |
|
|
|
|
|
|
|
| |
We want to stop deriving NetdocParseable directly for body structs.
This test case does in fact parse a signed authcert and extract just
the body without verifying the signatures. That's fine in a test, but
we're going to make it involve some hoop-jumping. So, jump those
hoops.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the two separate NetdocParseable and NetdocUnverified derives,
for toplevel signed documents, with a single derive.
This makes the derive API simpler. It will also make it reasonably
possible to avoid deriving NetdocParseable directly for body structs.
Such impls are a security hazard!
In detail:
* Rename NetdocUnverified to NetdocParseableUnverified
* Have it use $IMPL_NETDOC_PARSEABLE from the NetdocParseable deftly
module so that it derives NetdocParseable for the body.
(We'll change this later in the series.)
* Adjust the docs and all call sites.
|
| |
|
|
|
|
|
|
|
|
| |
During encoding, including these hashes in the signature items makes
no sense. The hashes are an *input* to the signature items, but not
part of them.
Move the hashes out of the items. Instead, provide each signatures
section type with a hash accumulator type, in which the hash(es) are
stored.
|
| |
|
|
| |
This is going to contain body information, and the hashes, too.
|
| |
|
|
|
|
| |
This is going to be its own trait and it is usually best if macros are
named after traits, rather than having the macro derive a different
trait depending on meta attributes.
|
| |\
| |
| |
| |
| | |
tor-dirclient: Support for extra-info requests
See merge request tpo/core/arti!3764
|
| | |
| |
| |
| | |
Accidentally left out in the previous commit.
|
| |/ |
|
| |
|
|
|
| |
This commit adds a TODO to implement a trait combining the common fields
in a network status documents.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
This was a weird name, and while working in this area it all seemed to
make the docs strange.
Rename it. This is quite invasive!
In theory we could have the macros generate compatibility aliases, but
that seems quite complex.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test case constructs a "netdoc" which consists of one
dir-key-certification item, and parses it using `AuthCertSignatures as
NetdocParseable`. But we're going to split out the parsing trait for
signatures sections, so that's not going to work any more.
This test tests only corner cases of the derived
SignatureItemParseable implementation; but that's unit tested in the
parse2 tests. (Once upon a time there was perhaps manual parsing code
which needed a specific test.)
Remove it.
|
| |
|
|
|
|
| |
This commit replaces the last remaining uses of `EP::Other` in
`tor-netdoc`, which got removed in arti!3561 but was still made use of
in arti!3592 without causing a merge conflict.
|
| |\
| |
| |
| |
| | |
Implement EncodedAuthCert and use it in poc for votes
See merge request tpo/core/arti!3592
|
| | | |
|
| | | |
|