aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/microdesc.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-netdoc: Remove many needless calls to .iter() and .into_iter()Ian Jackson2023-02-151-5/+5
|
* netdoc: Require that unrecognized tokens be handled explicitly.Nick Mathewson2023-02-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Now we require that, for all `SectionRules`, either the caller say how to handle unrecognized tokens (using `.add(UNRECOGNIZED...)`), or that they explicitly reject unrecognized tokens (using `reject_unrecognized`()`.) This solution uses an assert!() rather than an Error to indicate failure. I say that's fine, since 1. This is a crate-internal API. 2. We never dynamically construct SectionRules according to different behavior: they are always prefabricated in a fixed code block. Thus, if we test a parser at all, we will make sure that its SectionRules are well-formed. I considered and explicitly rejected a solution where the builder had to be finalized with separate methods `build_strict()` or `build_tolerant()`: It's too easy IMO for the caller to forget what these call means. Prevents further recurrences of #752. Closes #752.
* netdoc: Switch SectionRules building to use a Buidler pattern.Nick Mathewson2023-02-031-4/+4
| | | | No new behavior yet.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Merge branch 'test-lints' into 'main'eta2023-01-061-0/+8
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | Use parse_rfc3339() in the tor-netdoc crateNeel Chauhan2022-12-161-2/+2
|/
* add feature annotation to fields made visible through visible::StructFieldstrinity-1686a2022-08-241-0/+6
|
* microdesc: make sure we recover from an error in the final md.Nick Mathewson2022-06-071-1/+7
| | | | | | | | (This is slightly different from recovering from errors in the middle of a list of mds, since in this case we _can't_ advance to the next md.) Also, note that a given branch is probably not reachable.
* netdoc: test case for microdesc with no ed25519 id.Nick Mathewson2022-06-071-0/+1
| | | | | The "bad-id" microdescriptor is hand-edited based on one from a Chutney network.
* Re-order attributes so that we can build with Rust 1.53.Nick Mathewson2022-03-311-1/+1
|
* tor-netdoc: Conditionally expose document fields.Nick Mathewson2022-03-311-0/+5
| | | | | | | | This commit uses the `visibility` and `visible` crates to conditionally make certain structs and their fields public (respectively). This is incredibly dangerous to use for anything besides testing, and I've tried to write the documentation for the feature accordingly.
* Canonicalize and intern family representations to save memory.Nick Mathewson2022-03-111-3/+7
| | | | | | This should save 1-3 MB of ram on each running arti client. Closes #384. See also tor#27359 and proposal 298.
* Refactor tor_netdoc::ErrorNick Mathewson2022-02-141-11/+16
| | | | | | | | | | | | | | | This error type doesn't impement HasKind, since the kind will depend on context. However, the existing implementation was pretty messy and inconsistent: Some errors had positions, some didn't. Some took messages as str, some as String. Some had internal errors that were somewhat orthogonal to their actual types. This commit refactors tor_netdoc::Error to use a ParseErrorKind, and adds a set of convenience functions to add positions and messages to the errors that need them.
* fix nightly clippy errorsTrinity Pointard2021-12-091-4/+1
|
* Add comments about the absence of tap_key in microdesc.Nick Mathewson2021-11-301-1/+4
|
* Parse RSA public keyNeel Chauhan2021-11-291-2/+9
|
* Remove unused tap_onion_key and tap_keyNeel Chauhan2021-11-281-12/+1
|
* derive 'Default' where possibleDaniel Eades2021-09-111-7/+1
|
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-4/+5
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+534
This will cause some pain for now, but now is really the best time to do this kind of thing.