aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-netdoc: rs: Remove some fiddly docs differencesIan Jackson2025-08-182-5/+2
| | | | | | | Not having the flavour in the type name is a shame, but we probably don't want to resort to generating the docs with macros. Part of making these two files largely identical.
* tor-netdoc: rs: Introduce FLAVOR constantIan Jackson2025-08-182-4/+10
| | | | Part of making these two files largely identical.
* tor-netdoc: rs: Swap calling orderIan Jackson2025-08-182-4/+4
| | | | | Move the implementation to the trait method which then becomes completely identical in both files.
* tor-netdoc: rs: Introduce and use DOC_DIGEST_LENIan Jackson2025-08-184-6/+12
| | | | Part of making ns.rs and md.rs largely identical.
* tor-netdoc: rs: Use species macrology for DocDigestIan Jackson2025-08-182-18/+18
| | | | Part of making these two files largely identical.
* tor-netdoc: rs: Use species macrology for ConsensusRouterStatusIan Jackson2025-08-184-25/+24
| | | | | | | In the species-specific files ns.rs and md.rs, use the unqualified name; re-export it with the new macro. We are working towards making these two files largely identical.
* tor-netdoc: Introduce new "species" macrologyIan Jackson2025-08-184-0/+220
| | | | | This will let us deduplicate a fair amount of code, and also will let us support votes as well as ns and md consensuses.
* tor-netdoc: Change all in-tree references to ns-consensus from ns_consensusIan Jackson2025-08-184-13/+13
|
* tor-netdoc: Remove two false commentsIan Jackson2025-08-182-2/+0
| | | | Cut-and-paste error, I think.
* netdoc test data: Switch two tests to new consensus dataIan Jackson2025-08-141-3/+3
|
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0717-49/+59
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Update code for Edition 2024Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* Suggestions from @gabi-250 on prop360 implementation.Nick Mathewson2025-07-101-2/+2
|
* netdoc, hsservice: Respect maximum descriptor sizesNick Mathewson2025-07-101-2/+17
| | | | | It would be better to take a more sophisticated approach; see #2048.
* netdoc: Add note about prop360Nick Mathewson2025-07-101-0/+6
|
* netdoc: Tread a few more kinds of errors as suspicious.Nick Mathewson2025-07-101-1/+6
| | | | | In particular, these are errors that provide an opportunity to inflate the size of an hsdesc download.
* hs*: Define some HsDesc errors as _suspicious_.Nick Mathewson2025-07-101-0/+22
| | | | | These errors are suspicious as hsdir inflation attacks, in the context of prop360.
* netdoc: disallow extraneous space within final signature itemNick Mathewson2025-07-101-1/+39
| | | | Part of proposal 360.
* tor-netdoc: Removed dependency on `once_cell`hashcatHitman2025-06-147-36/+37
| | | | | | - Replaced `once_cell::sync::Lazy` with `std::sync::LazyLock`. Signed-off-by: hashcatHitman <[email protected]>
* hs: Prevent a client from using a `MiddleOnly` relay for onion servicesNeel Chauhan2025-05-201-4/+0
| | | | | | > The actual impact of this patch is to prevent usage of MiddleOnly > relays as Introduction Points. The Rendezvous Point logic isn't > hooked up yet - nick
* Resolve clippy warnings from 1.83Nick Mathewson2025-05-133-5/+5
| | | | | Now that our MSRV is 1.83, clippy is happy to make more recommendations for us.
* netdoc: improve documentation for check_protocolsNick Mathewson2025-04-161-1/+7
|
* Fix a pair of documentation links.Nick Mathewson2025-04-161-2/+2
|
* Implement PartialEq for ProtoStatuses unconditionally.Nick Mathewson2025-04-161-4/+2
|
* protover,netdoc: Implement serde for Protocols etc.Nick Mathewson2025-04-161-2/+36
|
* netdoc: Put all ProtoStatuses into a single Arc<>d objectNick Mathewson2025-04-162-19/+55
| | | | | We'll want this so that we can expose them before we expose the rest of the consensus (which we need to do for spec conformance).
* netdoc: functionality for detecting missing subprotos.Nick Mathewson2025-04-161-2/+91
| | | | Also, add a new ErrorKind for this sort of error.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-184-9/+9
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-182-2/+2
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* Always use full path to rand::thread_rng().Nick Mathewson2025-03-181-2/+1
| | | | | This is partly for consistency, and partly to facilitate a global search-and-replace.
* Merge branch 'interface-abstraction-of-the-daleks' into 'main'Nick Mathewson2025-03-181-1/+0
|\ | | | | | | | | Wrap x25519-dalek and ed25519-dalek types. See merge request tpo/core/arti!2868
| * Wrap ed25519-dalek types.Nick Mathewson2025-03-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | With this change, we'll no longer need to expose the types from dalek-cryptography as part of our API, and we'll have more freedom to switch ed25519 implementations, or to upgrade to a newer `rand` ahead of their schedule. Unlike with x25519-dalek, I had to tweak the API a bit: There's no way to get a &PublicKey out of a Keypair now, and implementing the old ed25519-dalek traits seemed unnecessary.
* | netdoc: Make some parsing init functions fallible.Nick Mathewson2025-03-177-27/+28
|/ | | | | | | I'm about to make our parsers reject some strings at construction time, so it makes sense to have these functions become fallible. This is a breaking change.
* netdoc: Add "family-cert" entries to routerdesc parserNick Mathewson2025-02-251-3/+79
|
* netdoc: Add "family-ids" line to microdesc parserNick Mathewson2025-02-122-2/+56
|
* fix: fix typosDimitris Apostolou2025-01-061-1/+1
|
* PoW: Consolidate feature flags into a single flag.Wesley Aptekar-Cassels2024-11-255-15/+15
| | | | | | | | | | | | | | | | | This replaces the hs-pow, hs-pow-full, hs-pow-v1, pow-v1, and pow-full features with a single hs-pow-full feature. It's possible that in the future we will want to split different schemes into different features, but we can do that when it comes up. For now, having this as a single flag makes it clearer what's going on, since the previous thing was not actually expressive enough to capture some things we care about (like "at least one pow scheme is enabled" that works in a future-compatible way). This change is not semver breaking since it's a experimental feature. Related: #1751
* tor-netdoc: Error on PowParams::V1 when hs-pow-v1 is disabled.Wesley Aptekar-Cassels2024-11-251-2/+11
|
* tor-netdoc: Don't include pow_params in HsDesc when feature is disabled.Wesley Aptekar-Cassels2024-11-252-7/+8
|
* tor-netdoc: Support writing pow-params line.Wesley Aptekar-Cassels2024-11-252-0/+91
| | | | | | | I'm not particularly happy with the code that does the actual writing out of the pow-params line, in particular the error handling there seems very verbose. However, I don't know of a better way to structure it given that APIs I'm working with.
* TimerangeBound: Stop using std::ops::Bound.Wesley Aptekar-Cassels2024-11-252-7/+7
| | | | Fixes: #1691
* tor-netdoc: add clippy allows and `#[non_exhaustive]`Steven Engler2024-11-201-0/+2
|
* Add a little test coverage for pow-params parsing.Wesley Aptekar-Cassels2024-10-091-0/+108
| | | | | | | | Cover some of the novel edge cases we're introducing around object parameters and repetition. This still feels awfully ad-hoc, but it's better than nothing. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* hs-pow inner desc: broaden pow-params rule, disallow object for v1.Wesley Aptekar-Cassels2024-10-092-3/+8
| | | | | | | | | | | We should not be restricting pow-params to occur only once at the rule level, and we shouldn't be disallowing object parameters at that level either. Instead, the v1 scheme itself needs to check for and disallow objects. Future schemes may allow object parameters. Test cases for this will be added in a subsequent commit. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* hs-pow: inner doc test using canned data from C tor.Wesley Aptekar-Cassels2024-10-091-4/+39
| | | | | | | | | | | This proliferates the canned hsdesc inner doc testing strategy, adding another file with data encoded with onion-pow-example running on C tor. Tests that it parses successfully, and asserts that the pow params line contents are correct. This is a positive test only. This strategy seems problematic, but it's better than nothing. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* hs-pow: Explain what the v1 scheme refers to, in PowParams.Wesley Aptekar-Cassels2024-10-091-0/+7
| | | | | | | Adds another breadcrumb as requested so new folks happening upon this in the docs can get oriented. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* hs-pow: Change rule to require pow_params type parameter.Wesley Aptekar-Cassels2024-10-091-1/+1
| | | | | | | This can now notice pow_params lines which are invalid because they have no parameters. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* hs-pow: Use TimerangeBound for puzzle parameters.Wesley Aptekar-Cassels2024-10-091-9/+9
| | | | Co-authored-by: Micah Elizabeth Scott <[email protected]>
* hs-pow: Refactor to prefer stub types rather than cfg sprawl.Wesley Aptekar-Cassels2024-10-095-34/+46
| | | | | | | | | | | | | | | | | | | | | | In this design, the thin multiplexing layer between PoW types is always available when onion services are in use, but the specific pow schemes (and their dependency libraries) are gated by crate features everywhere. There are now no new cfg() gates. When the pow-v1 scheme is disabled, we can parse `pow-params v1` lines into an empty type (so clients know a PoW scheme exists that might be supported if they were configured differently). We currently don't save the contents of unknown hsdesc items. On the relaycell side, the hs ext module already sets a strong precedent for keeping unrecognized data as a byte vec, and it doesn't provide a good way to signal soft parse errors like unrecognized optional extensions. There, the `v1` type is completely optional, and services lacking a pow scheme suggested by a client would see one of these 'unrecognized' blobs. This isn't necessarily helpful but it fits the rest of the design. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* tor-hspow: Big refactor, dissolve this crateWesley Aptekar-Cassels2024-10-094-34/+63
| | | | | | | | | | | | | | | | | My previous strategy here was to try and centralize hspow in one crate, writing it like a self-contained feature. That introduced friction in the data types, prompting the use of simplistic types at the netdoc/cell layers and full-featured types in the optional modules. This changes tactics, dissolving the low-level parts of tor-hspow into tor-hscrypto and the high-level parts into hsclient/hsservice. Full featured types are used everywhere now, but the tradeoff is that compile-time configurability is a lot more pervasive. Anything that knows about PoW types at all needs to be fully configured out. I took this opportunity to try a more complete set of crate features, allowing users to configure individual PoW schemes. Co-authored-by: Micah Elizabeth Scott <[email protected]>