aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc
Commit message (Collapse)AuthorAgeFilesLines
...
| * tor-netdoc: verify_general: explain an exhaustive patternIan Jackson2026-06-111-0/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4065#note_3423331
| * tor-netdoc: consensuses: Add a TODO about validate's signatureIan Jackson2026-06-111-0/+2
| |
| * tor-netdoc: consensuses: Introduce VerifyGeneralTrustedAuthorities (fmt)Ian Jackson2026-06-111-7/+7
| |
| * tor-netdoc: consensuses: Introduce VerifyGeneralTrustedAuthoritiesIan Jackson2026-06-111-5/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids passing the threshold around as a bare usize, separated out from the list of trusted authorities. Roughly as discussed in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4065#note_3423775 But, VGTA::HazardouslyAssumeAllAuthCertsAreRealAuthorities contains n_authorities, not the thtreshold. That's what its user has, and that allows us to centralise the threshold calculation somewhat. The situation with votes in poc is a bit odd now: we pass one cert and then there's one authority so the threshold of 1 is calculated rather than literal. That's OK, but also we perhaps aren't going to use verify_general for votes in the production.
| * tor-netdoc: certs: Use .contains() in one placeIan Jackson2026-06-111-1/+1
| |
| * tor-netdoc: Apply deferred rustfmt import churnIan Jackson2026-06-111-2/+1
| |
| * tor-netdoc: ns verification: Allow "dry run" to just get missing certs infoIan Jackson2026-06-111-10/+24
| | | | | | | | No functional change with the existing caller.
| * tor-netdoc: ns verification: Collect missing certs/sigs informationIan Jackson2026-06-111-2/+68
| | | | | | | | | | | | | | Introduce ConsensusVerifiabilityError. No functional change with the existing callere, which discards the error value.
| * tor-netdoc: ns verification: verify_general, return Result, tidy callerIan Jackson2026-06-111-5/+2
| | | | | | | | | | | | Now the caller can use .map_err rather than if .ok(). No functional change.
| * tor-netdoc: ns verification: verify_general, return ResultIan Jackson2026-06-112-4/+10
| | | | | | | | No functional change.
| * tor-netdoc: ns verification: abolish SigCheckResultIan Jackson2026-06-111-27/+5
| | | | | | | | | | | | | | | | Move the body of check_signature into verify_general. check_signature was the only thing that returned SigCheckResult. No functional change.
| * tor-netdoc: ns verification: Introduce ConsensusSignatureToVerifyIan Jackson2026-06-111-9/+53
| | | | | | | | | | | | | | | | | | And split check_signature into signature_to_verify which obtains a ConsensusSignatureToVerify, and then a call to .verify(). The return values are still a bit janky. No functional change.
| * tor-netdoc: ns verification: verify_general, remove an otiose typecheckIan Jackson2026-06-111-2/+1
| | | | | | | | | | | | | | Previously this was arguably needed for clarity. With the new hash finding arrangements, much less so. No functional change.
| * tor-netdoc: ns verification: verify_general, disassemble SignatureIan Jackson2026-06-111-2/+13
| | | | | | | | | | | | | | Use an exhaustive pattern. This allows us to spot any fields which we omit to look at, which would be an indication of a possible bug. No functional change.
| * tor-netdoc: ns verification: verify_general, add trusted_auth's argumentIan Jackson2026-06-111-0/+15
| | | | | | | | No functional change with the current caller.
| * tor-netdoc: ns verification: Use the proper hash fieldIan Jackson2026-06-111-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does not fix the bug with the old parser. The old parser always uses the `sha1` field in `hashes` even when `sha1_unnamed` would be right. But it also always sets `sha1`. Or to put it another way, because the old parser parses an unspecified algorithm as if it were explicitly `sha1`, it then both sets the digest_algo to DigestAlgoInSignature(Some(...)), and writes the hash to the `sha1` field. So this does not have an overall functional change with the old parser, and nothing else calls this. I'm fixing this here, now, so that the new parser doesn't inherit the bug. The new parser will set `digest_algo` correctly, and correctly write the hash to `sha1` or `sha1_unnamed`. What a terrible protocol this is.
| * tor-netdoc: ns verification: Use let else to avoid an unwrapIan Jackson2026-06-111-5/+3
| | | | | | | | No functional change.
| * tor-netdoc: ns verification: Break out SignatureGroup::verify_generalIan Jackson2026-06-111-1/+23
| | | | | | | | | | | | | | | | This is going to be the entrypoint for sharing verification code with parse2. For now it must be pub(crate) since we're going to call it from poc. No functional change.
* | tor-netdoc: Use iter_join for RecommendedTorVersionsIan Jackson2026-06-111-7/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4059#note_3424494
* | tor-netdoc: Fix a trailing whitespaceIan Jackson2026-06-111-1/+1
| |
* | tor-netdoc: Fix copypaste errorIan Jackson2026-06-111-1/+1
| |
* | tor-netdoc: recommended versions: fix parsing bug in old parserIan Jackson2026-06-111-4/+9
| | | | | | | | | | | | | | | | | | | | | | An existing real consensus says something like this: client-versions 0.4.8.19,0.4.8.20,0.4.8.21,0.4.8.22,0.4.8.23,0.4.8.24,0.4.8.25,0.4.9.4-rc,0.4.9.5,0.4.9.6,0.4.9.7,0.4.9.8 so it's not using the additional arguments, and the spec says those should be ignored. See also torspec!500.
* | tor-netdoc: recommended versions: new {client,server}-versions typeIan Jackson2026-06-114-12/+131
| | | | | | | | | | | | | | | | | | | | | | This is a single comma-separated argument, with absence of the item being the same as absence of the arguemnt. The previous code had `Vec<String>` which in parse2 would mean zero or more occurrences of the item, with one argument each. The old parser would split the whole RHS of the arguments. It still does right now - we'll fix that in a moment.
* | tor-netdoc: old consensus parser: add a bindingIan Jackson2026-06-111-2/+3
| | | | | | | | This will make the next change here slightly less confusing.
* | tor-netdoc: old consensus parser: break out parse_rec_versions (fmt)Ian Jackson2026-06-111-8/+7
| |
* | tor-netdoc: old consensus parser: break out parse_rec_versionsIan Jackson2026-06-111-10/+8
| | | | | | | | Again, this is going to get more complicated, so let's make a closure.
* | tor-netdoc: ConsensusBuilder: break out mk_versionsIan Jackson2026-06-111-2/+4
| | | | | | | | This is going to get more complicated, so let's make a closure for it.
* | tor-netdoc: recommended versions: add spec linksIan Jackson2026-06-111-0/+4
|/
* Merge branch 'assert-eq-diff' into 'main'Clara Engler2026-06-111-1/+1
|\ | | | | | | | | tor-netdoc: Replace ad-hoc pseudo-diff with unidiff from imra See merge request tpo/core/arti!4096
| * tor-netdoc: Use assert_eq_or_diff in three more placesIan Jackson2026-06-111-1/+1
| |
* | Merge branch 'join' into 'main'Ian Jackson2026-06-111-3/+2
|\ \ | | | | | | | | | | | | Use tor_basic_utils::iter_join in a couple of places See merge request tpo/core/arti!4091
| * | tor-netdoc: Replace an Itertools::intersperse with iter_joinIan Jackson2026-06-111-3/+2
| | | | | | | | | | | | This is what iter_join is for.
* | | Merge branch 'rs-items' into 'main'Ian Jackson2026-06-114-0/+37
|\ \ \ | | | | | | | | | | | | | | | | tor-netdoc: routerstatus: add missing fields See merge request tpo/core/arti!4061
| * | | tor-netdoc: routerstatus entries: Add `id` item (votes only)Ian Jackson2026-06-113-0/+11
| | | |
| * | | tor-netdoc: routerstatus entries: Add note about location of `m` itemIan Jackson2026-06-111-0/+3
| | | |
| * | | tor-netdoc: routerstatus entries: Add `p` itemIan Jackson2026-06-114-0/+11
| | | |
| * | | tor-netdoc: routerstatus: r item: add dir-port argumentIan Jackson2026-06-113-0/+7
| | | | | | | | | | | | | | | | This was simply missing.
| * | | tor-netdoc: routerstatus: r item: add blank lines to structIan Jackson2026-06-111-0/+5
| |/ /
* | | tor-netdoc: Add RouterDesc::hidden_serive_dirClara Engler2026-06-111-0/+12
| | | | | | | | | | | | | | | Adds RouterDesc::hidden_service_dir as well as an accompanying ZST token.
* | | tor-netdoc: Replace bool with ItemPresent in RouterDesc (fmt)Clara Engler2026-06-111-1/+2
| | | | | | | | | | | | No functional change.
* | | tor-netdoc: Replace bool with ItemPresent in RouterDescClara Engler2026-06-111-4/+14
|/ / | | | | | | | | | | | | | | This commit modifies RouterDesc to replace all occurrences of `bool` with `Option<ItemPresent<T>>` while adding respective ZST tokens for the respective items. In this case, it adjusts caches_extra_info and tunnelled_dir_server.
* | Merge branch 'ntor-crosscert' into 'main'Clara Engler2026-06-111-14/+10
|\ \ | | | | | | | | | | | | Add Ed25519NtorCrossCert See merge request tpo/core/arti!4022
| * | tor-netdoc: Use .verify_inner() in legacy parserClara Engler2026-06-111-15/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the legacy parser to make use of the just added .verify_inner() method. For this, we replace the part that extracts crosscert_cert to only extract the inner signature and expiry timestamp, because this is what will be used ultimately. Inside this extraction, we change the parser to only obtain the KeyUnknownCert without any further checks, after which we will pass it to .verify_inner() to store the signatures and expiry date. Following this change, we now only change the places where the previous crosscert_cert was used to extract signatures and expiration dates to use the just extracted cc_sig and cc_expiry instead.
| * | tor-netdoc: Ed25519NtorCrossCert::verify_inner()Clara Engler2026-06-111-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit creates a new method, Ed25519NtorCrossCert::verify_inner(), which in essence represents a copying of the verification logic for ntor cross certificates from the legacy parser into parse2 logic, with the eventual goal to unify these two. Unfortunately, a 1:1 move using --color-moved was not possible, because the legacy parser uses edcert::UnvalidatedEdCert for this, which is a very legacy parser specific type, as it contains a Pos in its inner items. Instead, I encourage reviewers to review the functional equality between these two implementations using the following approach: 1. Open the .verify_inner() in one pane. 2. Open routerdesc.rs below the position where this commit introduces the "XXX" comment in another pane next to it; this is the lion's share of the legacy implementation of it. 3. Ensure that the properties that the legacy implementation achieves is also achieved by .verify_inner(). This may require you to take a look at UnvalidatedEdCert::check_cert_type() and similar methods and verify that the if statements in .verify_inner() are equivalent. As outlined above, we cannot make use of these methods directly ourselves inside .verify_inner(). Keep in mind that the legacy parser only returns a tor_cert::UncheckedCert, whereas .verify_inner() returns a gated type. This is okay because UncheckedCert contains these gated types inside it anyways.
* | Merge branch 'validity-time-range' into 'main'Clara Engler2026-06-113-6/+16
|\ \ | |/ |/| | | | | tor-netdoc: ns preamble: break out validity_time_range See merge request tpo/core/arti!4054
| * tor-netdoc: netstatus preamble: use saturating sub for starting_timeIan Jackson2026-06-102-1/+2
| |
| * tor-netdoc: ns preamble: break out validity_time_range (tidy)Ian Jackson2026-06-031-5/+3
| | | | | | | | Remove the otiose `preamble` and `timebound_range` bindings again.
| * tor-netdoc: ns preamble: break out validity_time_rangeIan Jackson2026-06-033-7/+16
| | | | | | | | | | | | | | We are going to want to use this when we implement verification for network statuses from parse2. Review with --color-moved.
| * tor-netdoc: ns preamble: break out validity_time_range (prep)Ian Jackson2026-06-031-3/+5
| | | | | | | | | | Introduce and use bindings `preamble` and `timebound_range` that will make the next change easier to review.
* | Merge branch 'fix-eventdns-todo' into 'main'Ian Jackson2026-06-101-1/+0
|\ \ | | | | | | | | | | | | tor-netdoc: Remove accidential TODO left-over See merge request tpo/core/arti!4081