aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/parse2.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-netdoc: Abolish pocIan Jackson2026-07-151-3/+0
|
* tor-netdoc: parse2: Deprecate check_validity_timeIan Jackson2026-06-101-1/+4
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4070#note_3422637 We must allow it in poc, but poc is a thing we're trying to abolish/replace, so that's OK.
* tor-netdoc: ParseInput: add retain_unknown_values convenience setterIan Jackson2026-06-031-0/+10
|
* tor-netdoc: ParseInput: add accessorsIan Jackson2026-06-031-1/+4
|
* tor-netdoc: ParseInput: add some blank linesIan Jackson2026-06-031-0/+2
| | | | | This makes the code clearer, especially since we're going to add attributes.
* tor-netdoc: ParseInput: impl Debug and CloneIan Jackson2026-06-031-0/+1
|
* Merge branch 'netdoc-unverified-trait-name' into 'main'Clara Engler2026-06-031-4/+4
|\ | | | | | | | | tor-netdoc Rename NetdocUnverified trait to NetdocParseableUnverified See merge request tpo/core/arti!4043
| * tor-netdoc: Rename NetdocUnverified trait to NetdocParseableUnverified (fmt)Ian Jackson2026-06-021-3/+3
| |
| * tor-netdoc: Rename NetdocUnverified trait to NetdocParseableUnverifiedIan Jackson2026-06-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The NetdocParseableUnverified derive macro implements this trait (amongst other things). Traits and derive macros should have aligned names. This is only used for parsing, so let's keep the "Parseable" part of the name. I don't think the effort of deprecated alias, for downstream compatibility, is worth it, our compatibility policy notwithstanding.
* | tor-netdoc: Remove a TODO that we've doneIan Jackson2026-06-021-1/+0
|/ | | | We do now support encoding.
* tor-netdoc: Un-gate "plain-consensus" cargo featureIan Jackson2026-04-281-1/+1
| | | | As per #2492.
* tor-netdoc: Gate authcert/encoded.rs and poc behind incomplete and ↵Ian Jackson2026-04-231-1/+1
| | | | | | | | | plain-consensus "incomplete" is correct since encoded authcert depends on votes. "plain-consensus" is going backwards, but stripping "plain-consensus" gates from everything will be very intrusive.
* tor-netdoc: Move raw_data_object to new container moduleIan Jackson2026-04-011-1/+0
| | | | This will allow us to use it for encoding as well as parsing.
* tor-netdoc: Apply deferred rustfmt churn to importsIan Jackson2026-03-191-3/+2
|
* tor-netdoc: parse2: Don't impl NetdocParseable for bodies of signed docsIan Jackson2026-03-191-0/+1
| | | | Such an impl is a footgun. Explain this in docs & comments.
* tor-netdoc: parse2: Unify top-level derive as NetdocUParseablenverifiedIan Jackson2026-03-191-3/+4
| | | | | | | | | | | | | | | | 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: Move hash out of signature itemsIan Jackson2026-03-191-2/+2
| | | | | | | | | | 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: Introduce SignatureData structIan Jackson2026-03-191-1/+1
| | | | This is going to contain body information, and the hashes, too.
* tor-netdoc: NetdocParseableSignatures: Make into its own traitIan Jackson2026-03-191-1/+2
|
* tor-netdoc: NetdocParseableSignatures: Make into its own macroIan Jackson2026-03-191-2/+2
| | | | | | 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: Apply rustfmt churnIan Jackson2026-03-031-2/+1
|
* tor-netdoc: Rename *Signed to *UnverifiedIan Jackson2026-03-031-4/+4
| | | | | | | | | | 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-031-1/+2
| | | | | I keep not finding it because all the other signatures stuff is in signatures.rs.
* Merge branch 'encoded-authcert' into 'main'Ian Jackson2026-01-151-1/+1
|\ | | | | | | | | Implement EncodedAuthCert and use it in poc for votes See merge request tpo/core/arti!3592
| * tor-netdoc: parse2: Provide NetdocParseable::is_structural_keyword (rustfmt)Ian Jackson2026-01-151-2/+1
| |
| * tor-netdoc: parse2: Provide NetdocParseable::is_structural_keywordIan Jackson2026-01-151-0/+1
| | | | | | | | Roughly as per the proposal in `doc/dev/notes/authcert-in-consensus.md`.
* | tor-netdoc: Change error variantsClara Engler2026-01-151-1/+1
| | | | | | | | | | | | | | This commit changes `ErrorProblem::Other` to `ErrorProblem::OtherBadDocument` while adding two new variants: * `ErrorProblem::Internal` * `ErrorProblem::BadApiUsage`
* | parse2: OOB check for parse_netdoc_multiple_with_offsetsClara Engler2026-01-151-5/+15
|/ | | | | | | This commit adds an out-of-bounds memory check to parse2::parse_netdoc_multiple_with_offsets while adding the guarantee that interfacing applications do not need to validate the returned usize values to be in-range.
* tor-netdoc: authcert: Move CrossCert out of tmpIan Jackson2026-01-061-0/+2
| | | | | | | | 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.
* tor-netdoc: parse_netdoc_multiple_with_offsets: Add comment about offsetsIan Jackson2025-12-181-0/+5
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3554#note_3313768
* tor-netdoc: Provide parse2::parse_netdoc_multiple_with_offsetsIan Jackson2025-12-181-0/+21
|
* tor-netdoc: Fix doc comment for parse_netdoc_multipleIan Jackson2025-12-181-1/+1
|
* tor-netdoc: Implement new authority certificatesClara Engler2025-12-041-1/+2
| | | | | | | | | This commit implements directory authority certificates using the `parse2` approaches. For now, those are in a module `doc::authcert::tmp`, with the eventual goal of moving it into its super module after removing/deprecating the legacy types.
* parse2: Move naming convention to pocClara Engler2025-11-271-14/+0
| | | | | | | | | | | This commit moves the "Naming Convention" of the parse2::poc module into the respective module, as it does not apply to parse2 itself, as outlined in arti!3462. With this commit, there remains `NdaSystemTimeDeprecatedSyntax` as the only type outside poc following this naming schema. However, because it is more or less already deprecated anyways, there is no real need to bother with it any further.
* tor-netdoc: Move parse2/test.rs to test2.rsIan Jackson2025-11-241-3/+0
| | | | | | | We're going to use this for the encoder testing too, so it needs to be not buried inside parse2. This commit is the file rename plus minimal changes to make it compile.
* tor-netdoc: Introduce Unknown and retain_unknown_values optionIan Jackson2025-11-181-1/+20
|
* tor-netdoc: parse2: Introduce ParseOptionsIan Jackson2025-11-181-0/+15
| | | | There are currently no options.
* tor-netdoc: parse2: Introduce ParseInput intermediate structIan Jackson2025-11-181-8/+26
| | | | | | | We're going to add options arguments, effectively, to the parsing entrypoints. To avoid a proliferation of entrypoints (eg, parse_multiple_with_options), encapsulate the run-time input values in this structure.
* tor-netdoc: tests: Use real `RouterStatus` in `parse2::poc`Ian Jackson2025-10-151-0/+1
| | | | This now exercises all the new parsing code.
* tor-netdoc: impl parse2 multiplicity for BTreeSetIan Jackson2025-10-151-2/+2
|
* tor-netdoc: parse2: export NetdocSigned traitIan Jackson2025-10-151-1/+1
| | | | This seems to have been overlooked.
* tor-netdoc: parse2: Actually expose new errors in crate toplevelIan Jackson2025-10-091-1/+1
|
* tor-netdoc: parse2: Add column field to PaarsError and print itIan Jackson2025-10-091-0/+1
|
* netdoc parse2: Fix Object handlingIan Jackson2025-09-291-0/+1
| | | | | | | | | | Use the standard multiplicity technique rather than the ad-hoc impl on Option. This allows us to support an ad-hoc parsing function for a field that's `Option`. Disentangle the `label` field attribute, which did both setting the label, and expecting a different parsing approach: replace it with `with`.
* tor-netdoc: parse2: Explicitly define "structural item"Ian Jackson2025-09-021-0/+7
|
* tor-netdoc: parse2: Provide flattening and NetdocParseableFieldsIan Jackson2025-09-021-1/+4
|
* tor-netdoc: parse2: More focused tests (success cases)Ian Jackson2025-08-261-0/+3
| | | | | The netstatus doc poc does test most of the functionality, but I want some tests of edge cases that that misses.
* tor-netdoc: Rerun cargo fmt after rebaseIan Jackson2025-08-141-1/+1
|
* tor-netdoc: parse2: Fix typo in "Naming conventions" docIan Jackson2025-08-141-1/+1
|
* tor-netdoc: Proof-of-concept demo of new parserIan Jackson2025-08-141-0/+2
| | | | This can parse and validate the signatures on a consensus.