| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
| |
This was just some type aliases. Put them in the poc files that used
them. (These type aliases are undesirable but we aren't cleaning them
up because the whole of poc is destined for deletion.)
|
| |
|
|
|
| |
Get rid of the version in poc. Instead, implement the same
functionality in terms of AuthCert::verify, outside poc.
|
| |
|
|
| |
This will allow us to use it for encoding as well as parsing.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
This commit lno_for_error in ItemStream to lno because its value may not
always be used for error handling, such as in tor-consdiff.
|
| |
|
|
|
|
|
|
|
| |
This commit adds the ParseError::new() method, which allows external
APIs to construct a ParseError, which is currently not possible due to
non-exhaustiveness, despite the member fields being public.
It is required for external applications using lower-level but public
parse2 APIs, such as ItemStream's.
|
| |
|
|
| |
Typos found with codespell
|
| | |
|
| |
|
|
| |
Suggested-by: Clara Engler <[email protected]>
|
| |
|
|
|
| |
This is implied by `body` being the body before the first signature
item, but needs to be part of the definition.
|
| | |
|
| |
|
|
|
|
| |
"Regular" is confusing, especially since in American English it tends
to mean "usual" - whereas, there are no orderly signatures in Tor
netdocs.
|
| | |
|
| | |
|
| |
|
|
| |
I have been losing my way in this file a lot. This may help.
|
| |
|
|
|
| |
This could allow users to attach and detach signatures, hash (only)
the body part, etc.
|
| |
|
|
| |
Such an impl is a footgun. Explain this in docs & comments.
|
| |
|
|
| |
(pre-fmt)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
We are going to want to reuse this parsing implementation in another
top-level deftly template.
|
| |
|
|
|
| |
Run rustfmt and selectively apply the hunks that are relevant to the
previous commit.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Nonfunctional and formatting changes which reduce noise in the next
commit.
|
| | |
|
| |
|
|
| |
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.
|
| |
|
|
|
| |
We're going to want this for cases where the hash computation
machinery didn't DTRT.
|
| |
|
|
| |
For reuse when we split up the NetdocParseable derive.
|
| | |
|
| |
|
|
| |
But, all signatures in the current protocol are irregular :-/.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
I keep not finding it because all the other signatures stuff is in
signatures.rs.
|
| |\
| |
| |
| |
| | |
Implement EncodedAuthCert and use it in poc for votes
See merge request tpo/core/arti!3592
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
The string so far is exposed already via whole_for_signatures.
It is unusual for a doc parser to need this, but embedded documents
can use this plus byte_position to get the original input text for
their part of the outer document.
|
| | | |
|
| | |
| |
| |
| | |
Roughly as per the proposal in `doc/dev/notes/authcert-in-consensus.md`.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We can use the real AuthCert now that it implements the parse2 traits.
The verification function is still used by poc's netstatus code and by
a test case.
We must change the field names in a few places, because the real
AuthCert's struct field names are the keywords, whereas the poc's are
the key names. (A shame that they're different!)
|
| | |
| |
| |
| |
| |
| |
| | |
Use accessors for the body.
(Eventually this function will replace, be replaced by, or merge with,
the existing signature code outside poc.)
|
| | | |
|
| | | |
|