| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
| |
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.)
|
| | | |
|
| | | |
|
| |/
|
|
|
|
|
| |
This commit changes `ErrorProblem::Other` to
`ErrorProblem::OtherBadDocument` while adding two new variants:
* `ErrorProblem::Internal`
* `ErrorProblem::BadApiUsage`
|
| |
|
|
|
| |
This lets us having document items that are "manually non exhaustive"
which is necessary for struct literal constructors.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the spec we always use this fixed exponent, and we have a
minimum size of 1024. This is checked adhoc in the old parser with
some slight assistance from what is now `RsaPublicParse1Helper`.
It's not clear to me that checking the exponent is actually a good
idea. I think checking the size is probably a bad idea, and if it is
a good idea then 1024 is clearly too short.
But rather than revisit these questions, let's reproduce the old
behaviour in parse2.
In parse2 these checks should be features of the type.
|
| | |
|
| |
|
|
| |
This was missed, apparently.
|