| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
The feature arrangements in tor-netdoc are getting to be in need of a
serious overhaul.
|
| |
|
|
| |
As per doc/dev/notes/authcert-in-consensus.md.
|
| |
|
|
| |
With `#[non_exhaustive]`, you're not allowed to write even `Thing { ..base }`.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
The compiler doesn't notice this, but it's odd.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This is in the spec. I don't think it is a great idea to duplicate it
here.
|
| |
|
|
|
| |
These names came from tmp, and we renamed things as we went, but
didn't change the docs everywhere.
|
| |
|
|
| |
Fix the type names while we're here.
|
| |
|
|
| |
This module is now the "proper" tests for the parse2 impl on AuthCert.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
tmp's version of AuthCert is gone. Each of its fields is already in
AuthCert, including the docs links. I've decided not to transfer the
syntax snippets.
The remaining function in that module is now an inherent method on
AuthCert, not on tmp's version.
This needs reformatting since verify_self_signed is now at the wrong level!
|
| |
|
|
|
| |
It's not clear that we want to expose these impls, but our existing
tests (in test::tmp) want them.
|
| | |
|
| | |
|
| |
|
|
| |
This will enable parse2 to process it.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
We can call this type authcert::CrossCert.
The names in the docs are getting rather wrong, and right now the docs
build produces warnings. We'll tidy all that at the end after we're
done moving and renaming.
|
| |
|
|
|
|
| |
The distinction is: `verify_selfcert` sounds like it only verifies the
self certificate. `veriify_self_signed` completely verifies a
document, albeit one that is expected to be self-signed.
|
| |
|
|
|
| |
Let's keep the existing name `AuthCert` in authcert.rs, so we want to
rename this from DirKeyCertificateVersion, while we move it.
|
| |
|
|
| |
This is our new style. Now there's no known-dead code.
|
| |
|
|
| |
This will let the parse2 derive work properly.
|
| |
|
|
|
|
|
|
|
| |
Make AuthCert look like the network document.
This means removing its stored copy of H(KP_auth_sign_rsa), which it
previously had via the embedded AuthCertKeyIds.
We reculculate it as needed in AuthCert::key_ids().
|
| |
|
|
| |
There are no in-tree callers.
|
| |
|
|
|
| |
AuthCert is about to lose its copy of H(KP_auth_sign_rsa) so it needs
to return an owned value.
|
| |
|
|
|
|
| |
This is used by the old parsing code, apparently as a thing to hang
the checking methods off. It is confusing to have so many different
RSA types! Let's at least rename this one.
|
| |
|
|
| |
Spec links from the tmp module will be added later.
|