aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/parse2
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-netdoc: Abolish poc::authcertIan Jackson2026-04-015-10/+8
| | | | | | 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.)
* tor-netdoc: Replace AuthCert::verify_selfcert implIan Jackson2026-04-011-46/+0
| | | | | Get rid of the version in poc. Instead, implement the same functionality in terms of AuthCert::verify, outside poc.
* tor-netdoc: Move raw_data_object to new container moduleIan Jackson2026-04-011-10/+0
| | | | This will allow us to use it for encoding as well as parsing.
* tor-netdoc: Fix typo in doc commentIan Jackson2026-03-311-1/+1
|
* tor-netdoc: Rename `AuthCertUnverified::verify_self_signed`Ian Jackson2026-03-311-0/+2
| | | | | | | | | | | 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.
* Revert "parse2: Rename lno_for_error to lno"Clara Engler2026-03-251-2/+2
|
* parse2: Rename lno_for_error to lnoClara Engler2026-03-251-2/+2
| | | | | 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.
* parse2: Implement `ParseError::new()`Clara Engler2026-03-251-0/+19
| | | | | | | | | 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.
* Fix typosTobias Stoeckmann2026-03-246-9/+9
| | | | Typos found with codespell
* tor-netdoc: signature orderliness: add some xrefsIan Jackson2026-03-192-1/+6
|
* tor-netdoc: signature ordering: discuss an alternative impl approachIan Jackson2026-03-191-0/+3
| | | | Suggested-by: Clara Engler <[email protected]>
* tor-netdoc: signature orderliness: orderly signs don't cover other sigsIan Jackson2026-03-191-0/+1
| | | | | This is implied by `body` being the body before the first signature item, but needs to be part of the definition.
* tor-netdoc: signature orderliness: shuffle wording slightlyIan Jackson2026-03-191-1/+1
|
* tor-netdoc: signature orderliness: change terminologyIan Jackson2026-03-192-8/+8
| | | | | | "Regular" is confusing, especially since in American English it tends to mean "usual" - whereas, there are no orderly signatures in Tor netdocs.
* tor-netdoc: NetdocParseableSignatures: discuss orderingIan Jackson2026-03-191-0/+44
|
* tor-netdoc: Apply deferred rustfmt churn to importsIan Jackson2026-03-191-3/+2
|
* tor-netdoc: parse2: Add some navigational commentsIan Jackson2026-03-191-1/+64
| | | | I have been losing my way in this file a lot. This may help.
* tor-netdoc: parse2: Include body length in SignaturesDataIan Jackson2026-03-192-0/+5
| | | | | This could allow users to attach and detach signatures, hash (only) the body part, etc.
* tor-netdoc: parse2: Don't impl NetdocParseable for bodies of signed docsIan Jackson2026-03-194-13/+97
| | | | Such an impl is a footgun. Explain this in docs & comments.
* tor-netdoc: parse2: Don't impl NetdocParseable for bodies of signed docs ↵Ian Jackson2026-03-191-1/+4
| | | | (pre-fmt)
* tor-netdoc: parse2: Unify top-level derive as NetdocUParseablenverifiedIan Jackson2026-03-193-33/+35
| | | | | | | | | | | | | | | | 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.
* tor-netdoc: parse2: Break out IMPL_NETDOC_PARSEABLE in a deftly moduleIan Jackson2026-03-191-161/+175
| | | | | We are going to want to reuse this parsing implementation in another top-level deftly template.
* tor-netdoc: parse2: Move hash out of signature items (fmt)Ian Jackson2026-03-191-17/+19
| | | | | Run rustfmt and selectively apply the hunks that are relevant to the previous commit.
* tor-netdoc: parse2: Move hash out of signature itemsIan Jackson2026-03-198-67/+256
| | | | | | | | | | 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.
* tor-netdoc: parse2: Move hash out of signature items (prep)Ian Jackson2026-03-193-13/+22
| | | | | Nonfunctional and formatting changes which reduce noise in the next commit.
* tor-netdoc: parse2: SignatureHashInputs: Include document so farIan Jackson2026-03-192-0/+5
|
* tor-netdoc: parse2: Introduce SignatureData structIan Jackson2026-03-196-28/+53
| | | | This is going to contain body information, and the hashes, too.
* tor-netdoc: NetdocParseableSignatures: Make into its own traitIan Jackson2026-03-194-22/+24
|
* tor-netdoc: NetdocParseableSignatures: Make into its own macroIan Jackson2026-03-192-27/+121
| | | | | | 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-netdoc: Add VerifyFailed::BugIan Jackson2026-03-191-0/+3
| | | | | We're going to want this for cases where the hash computation machinery didn't DTRT.
* tor-netdoc: parse2 derive: break out INIT_ACCUMULATE_VARSIan Jackson2026-03-191-17/+25
| | | | For reuse when we split up the NetdocParseable derive.
* tor-netdoc: parse2: netstatus poc: Improve docs slightlyIan Jackson2026-03-191-0/+3
|
* tor-netdoc: parse2: Give reference to what a Regular signature isIan Jackson2026-03-191-0/+2
| | | | But, all signatures in the current protocol are irregular :-/.
* tor-netdoc: parse2: Fix an error messageIan Jackson2026-03-191-1/+1
|
* tor-netdoc: Apply rustfmt churnIan Jackson2026-03-031-2/+2
|
* tor-netdoc: parse2: Lengthen a doc comment slightlyIan Jackson2026-03-031-1/+1
|
* tor-netdoc: parse2: Use eprint for dtraceIan Jackson2026-03-032-5/+8
|
* tor-netdoc: Rename *Signed to *UnverifiedIan Jackson2026-03-038-36/+36
| | | | | | | | | | 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.
* tor-netdoc: Move NetdocSigned to signatures.rsIan Jackson2026-03-033-33/+34
| | | | | I keep not finding it because all the other signatures stuff is in signatures.rs.
* Merge branch 'encoded-authcert' into 'main'Ian Jackson2026-01-1511-135/+149
|\ | | | | | | | | Implement EncodedAuthCert and use it in poc for votes See merge request tpo/core/arti!3592
| * tor-netdoc: EncodedAuthCert: use in poc integration test / demoIan Jackson2026-01-151-6/+15
| |
| * tor-netdoc: Expose whole input string (rustfmt)Ian Jackson2026-01-151-2/+1
| |
| * tor-netdoc: Expose whole input stringIan Jackson2026-01-151-8/+17
| | | | | | | | | | | | | | | | 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.
| * tor-netdoc: parse2: Provide NetdocParseable::is_structural_keyword (rustfmt)Ian Jackson2026-01-151-3/+2
| |
| * tor-netdoc: parse2: Provide NetdocParseable::is_structural_keywordIan Jackson2026-01-155-2/+86
| | | | | | | | Roughly as per the proposal in `doc/dev/notes/authcert-in-consensus.md`.
| * tor-netdoc: Abolish poc's AuthCert (rustfmt)Ian Jackson2026-01-152-8/+3
| |
| * tor-netdoc: Abolish poc's AuthCertIan Jackson2026-01-154-109/+13
| | | | | | | | | | | | | | | | | | | | | | 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!)
| * tor-netdoc: Prepare poc's DirAuthKeyCertSigned::verify_selfcertIan Jackson2026-01-151-7/+8
| | | | | | | | | | | | | | Use accessors for the body. (Eventually this function will replace, be replaced by, or merge with, the existing signature code outside poc.)
| * tor-netdoc: Add an error variant we'll need for parsing embedded docsIan Jackson2026-01-151-0/+3
| |
| * tor-netdoc: Improve Keyword API slightlyIan Jackson2026-01-151-1/+12
| |