aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/netstatus.rs
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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 ResultIan Jackson2026-06-111-3/+9
| | | | | | | | 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: recommended versions: new {client,server}-versions typeIan Jackson2026-06-111-0/+115
|/ | | | | | | | | | | 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: Replace an Itertools::intersperse with iter_joinIan Jackson2026-06-111-3/+2
| | | | This is what iter_join is for.
* Merge branch 'validity-time-range' into 'main'Clara Engler2026-06-111-1/+3
|\ | | | | | | | | 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-101-0/+1
| |
| * tor-netdoc: ns preamble: break out validity_time_rangeIan Jackson2026-06-031-1/+2
| | | | | | | | | | | | | | We are going to want to use this when we implement verification for network statuses from parse2. Review with --color-moved.
* | Merge branch 'clippy-string-slice' into 'main'Nick Mathewson2026-06-101-0/+1
|\ \ | | | | | | | | | | | | Lint for clippy::string_slice See merge request tpo/core/arti!4086
| * | maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* | | tor-netdoc: impl EncodeOrd for SignatureIan Jackson2026-06-091-1/+8
|/ / | | | | | | This will let us encode consensus signatures sections.
* | Merge branch 'netdoc-small-fixes' into 'main'Clara Engler2026-06-091-3/+3
|\ \ | | | | | | | | | | | | tor-netdoc: minor fixes arising from netstatus work See merge request tpo/core/arti!4055
| * | tor-netdoc: {required,recommended}-*-protocols: change orderingIan Jackson2026-06-031-2/+2
| | | | | | | | | | | | This matches C Tor and the spec.
| * | tor-netdoc: {required,recommended}-*-protocols: fix encodingIan Jackson2026-06-031-1/+1
| |/ | | | | | | We need to use `-`, not `_`. So use concat! stringify!.
* | Merge branch 'no-result' into 'main'Clara Engler2026-06-031-30/+29
|\ \ | |/ |/| | | | | tor-netdoc: No longer import crate::Result in doc::netstatus See merge request tpo/core/arti!4050
| * tor-netdoc: netstatus: Abolish StdResult aliasIan Jackson2026-06-021-11/+10
| |
| * tor-netdoc: netstatus: No longer use crate::ResultIan Jackson2026-06-021-18/+18
| |
| * tor-netdoc: Change one call to use try_collect()Ian Jackson2026-06-021-1/+1
| | | | | | | | This is a clearer.
* | tor-netdoc: Rename NetdocUnverified trait to NetdocParseableUnverifiedIan Jackson2026-06-021-1/+1
|/ | | | | | | | | | | | 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: implement encoding for consensus in votes' `m` itemsIan Jackson2026-05-281-0/+10
| | | | | We will test this when we test round trip parsing/encoding of votes. For now, mark it as incomplete.
* tor-netdoc: derive Ord for ConsensusMethodsIan Jackson2026-05-281-1/+1
|
* tor-netdoc: More explanation about RelayWeightsItem parsingIan Jackson2026-05-271-1/+5
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3991#note_3413169
* tor-netdoc: Rename RelayWeights to RelayWeightsItemIan Jackson2026-05-271-34/+34
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3991#note_3413168
* tor-netdoc: RelayWeights: implement encodingIan Jackson2026-05-271-0/+17
|
* tor-netdoc: RelayWeights: provide some constructorsIan Jackson2026-05-271-2/+42
| | | | In the form of trait impls.
* tor-netdoc: RelayWeights: put code in a more sane orderIan Jackson2026-05-271-23/+21
|
* tor-netdoc: Introduce RelayWeights and use it in RouterStatusIan Jackson2026-05-271-24/+130
| | | | | | | | For encoding, we need to represent the raw parameters. This change is carefully arranged so that when the retain unknown feature is disabled (ie, in clients), the per-router data structure remains the same.
* tor-netdoc: Introduce RelayWeights and use it in RouterStatus (pre)Ian Jackson2026-05-271-1/+2
| | | | Minor change which will make the next diff clearer.
* tor-netdoc: use TryFrom impl in RelayWeight parserIan Jackson2026-05-271-5/+5
| | | | | This makes the error handling a bit more regular. It will also make the code suit our further parsing changes better.
* tor-netdoc: impl TryFrom<&NetParams<u32>> for RelayWeightIan Jackson2026-05-271-1/+20
| | | | | Convert the from_net_params constructor into a TryFrom. Retain the bespoke method for the benefit of the old parser.
* tor-netdoc: impl encoding and parsing for NetParams<T>Ian Jackson2026-05-271-2/+7
| | | | | Not just NetParams<i32>. We're going to want it for NetParams<u32> in a moment.
* tor-netdoc: NetdocParseableFields: Pass ItemStream to finishIan Jackson2026-05-271-2/+2
|
* tor-netdoc: implement encoding for rs::SoftwareVersionIan Jackson2026-05-271-0/+7
| | | | Call the existing string encoding code.
* tor-netdoc: implement encoding for IgnoredPublicationTimeSpIan Jackson2026-05-271-0/+7
| | | | | This seems trivial enough I don't feel the need to mark it "incomplete" even though there is no test case.
* tor-netdoc: Rename FixedString to ConstantStringIan Jackson2026-05-271-3/+3
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413182 I left the word "fixed" in some of the docs and error messages, where it seemed to make sense.
* tor-netdoc: introduce VoteStatusConsensus and VoteStatusVoteIan Jackson2026-05-271-0/+14
| | | | | Replacing poc's. The new define_fixed_string macro is really helping here.