aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | HsDesc::parse_decrypt_validate: Don't check validity time (style followup)Ian Jackson2026-07-231-5/+3
| | | |
| * | | HsDesc::parse_decrypt_validate: Don't check validity timeIan Jackson2026-07-234-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function returns a `TimeRangeBound`. That implies a responsibility on the caller to check the time. It doesn't make sense for this function to do the check as well. But, it turns out that in tor-hsclient, the `TimeRangeBound<HsDesc>` is sometimes processed with `.dangerously` on the assumption that it was checked earlier. I considered changing this, and storing plain `HsDesc` and a separate `TimeRange` - but that's not right, because there are places where the `TimeRangeBound<HsDesc>` is used well after it was verified. Instead, in this commit, I (effectively) move the `.check_valid_at` call from `parse_decrypt_validate` to its principal call site. This involves a change to the error representation. Previously, validity time errors ended up as `DescriptorErrorDetail::Descriptor` containing an `HsDescError::OuterValidation` HsDescError:: InnerValidation`, which in turn contains a `tor_netdoc::Error`. (`tor_netdoc::Error` is a rather awkward type.) Now we have our own error variant. The overall behaviour is unchanged.
| * | | tor-netdoc: hsdesc: Use new TimeRangeBound::build_intersect (fmt)Ian Jackson2026-07-231-5/+4
| | | |
| * | | tor-netdoc: hsdesc: Use new TimeRangeBound::build_intersectIan Jackson2026-07-231-27/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace open-coding of various is_valid_at and various dangerously and intersect. In more detail: * Do most of the processing inside `TimeRangeBound::build_intersect` * Replace uses of dangerously_peek etc. with `TimeBound::unwrap_with` * The timebound machinery now takes care of doing the intersection * Remove the individual `.is_valid_at` calls and replace them with one at the end, on the intersection. This preserves the current behaviour except that sometimes time validity errors will now be reported as having occurred the wrong level. We'll deal with this in a moment (by deleting these checks from here entirely). * There is no need to handle a `None` from `intersect` any more. TimeBound handles conflicting time ranges differently: it allows ranges which are empty due to being ill-formed.
| * | | tor-netdoc: hsdesc: Rename a variableIan Jackson2026-07-231-2/+2
| | | | | | | | | | | | | | | | | | | | This variable had a different name inside the block, to outside. This was confusing, and, fixing it makes the next commit clearer.
| * | | tor-checkable: TimeBound: Provide new build_intersect APIIan Jackson2026-07-233-1/+141
| | | |
| * | | clippy config: Forbid TimeRangeBound::if_valid_nowIan Jackson2026-07-234-4/+10
| | | |
| * | | tor-checkable: Rename `TimeBound::is_valid_at` to `check_valid_at` (fmt)Ian Jackson2026-07-231-1/+5
| | | |
| * | | tor-checkable: Rename `TimeBound::is_valid_at` to `check_valid_at`Ian Jackson2026-07-238-28/+29
| | | | | | | | | | | | | | | | | | | | I find this names confusing. To my mind "is" implies a function returning `bool`.
| * | | tor-checkable: Rename `TimeBound::check_valid_*` to `if_valid_*`Ian Jackson2026-07-2319-50/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I find these names confusing. To my mind "check" implies a function returning `Result<(), _>`. Some other APIs use `unwrap` here but I think `if` is good.
| * | | tor-checkable: Deprecate `TimeBound::check_valid_at_opt`Ian Jackson2026-07-233-8/+19
| | | |
| * | | tor-checkable: TimeBound: Make wrapped type an associated type (fmt)Ian Jackson2026-07-231-1/+4
| | | |
| * | | tor-checkable: TimeBound: Make wrapped type an associated typeIan Jackson2026-07-236-12/+24
| | | | | | | | | | | | | | | | | | | | It wouldn't make much sense for one concrete type to be unwrappable variously as different inner types.
| * | | tor-checkable: TimeBound: Make dangerously_into_parts return TimeRange (fmt)Ian Jackson2026-07-232-12/+4
| | | |
| * | | tor-checkable: TimeBound: Make dangerously_into_parts return TimeRangeIan Jackson2026-07-235-17/+19
| | | | | | | | | | | | | | | | | | | | It is better to return a more cooked type. `TimeRange` aka `TimeRangeBound<()>` is perfect for this.
| * | | tor-checkable: TimeBound: Make is_valid_at a provided methodIan Jackson2026-07-234-22/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have `bounds()`, we can centralise this implementation and delete the implementations. I don't think it's necessary to provide an engineered safeguard against downstreams overriding this method. Any existing implementors of this trait will break because they must provide `.bounds()` now, which is an opportunity to notice that the `is_valid_at` can be deleted. But, if it is not deleted, nothing goes wrong.
| * | | tor-checkable: TimeBound: remove Error associated typeIan Jackson2026-07-236-24/+13
| | | | | | | | | | | | | | | | | | | | This was always TimeValidityError. And we want to rely on that so we can do the validity checking more centrally.
| * | | tor-checkable: TimeBound: Add bounds accessorIan Jackson2026-07-235-16/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes a `TimeBound` much more convenient to work with, will allow more centralisation. This replaces temporary `bound` inherent method on `TimeRangeBound`.
| * | | tor-checkable: TimeRange: Provide intersect_bounds methodIan Jackson2026-07-234-1/+56
| | | |
| * | | tor-checkable: TimeRange: Provide a more complete APIIan Jackson2026-07-232-0/+59
| | | | | | | | | | | | | | | | | | | | This is our time range type, so it wants a bunch of useful methods and conversions.
| * | | tor-checkable: Introduce TimeRange aliasIan Jackson2026-07-233-1/+10
| | | |
| * | | tor-checkable: TimeRangeBound: Rename extend_tolerance to extend_end_boundIan Jackson2026-07-235-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was confusing that one of these functions had "which bound" mentioned in its name, but the other didn't. So add `end` and switch from `tolerance` to `bound` (see previous commit message). *This* commit should deal only in `extend_tolerance` and `end` and shouldn't touch `extend_start_bound` or `extend_pre_tolerance`.
| * | | tor-checkable: TimeRangeBound: Rename extend_pre_tolerance to extend_start_boundIan Jackson2026-07-234-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although it is often used to apply a tolerance, it doesn't make sense to say that this is extending the "tolerance" of a `TimeRangeBound`. A `TimeRangeBound` doesn't have a tolerance, only bounds. Also we should be consistent in our terminology, and use `start` rather than `pre`. We'll rename the other method too. Doing them one at a time will makes it easier to spot any "pre/start" vs "<nothing>/end" slips: *this* commit should deal only in `pre` and `start` and shouldn't touch `extend_tolerance`.
| * | | tor-checkable: TimeRangeBound: Swap code order of two functionsIan Jackson2026-07-231-10/+10
| | | | | | | | | | | | | | | | | | | | This puts the start bounds extension function before the end one. That makes sense because starts are before ends.
| * | | tor-checkable: TimeRangeBound: Rename bounds to bounds_start_endIan Jackson2026-07-233-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This just returns a tuple. We're going to introduce a new method that returns a `TimeRagne` and will want to be called `bounds`. That method will want to be in the `TimeBound` trait, but for now we add it here. Various call sites will be added in forthcoming commits.
| * | | tor-checkable: Cargo.toml: Add some blank linesIan Jackson2026-07-231-0/+2
| | | | | | | | | | | | | | | | I find this hard to read without them.
| * | | tor-checkable: TimeRangeBound: document lack of well-formedness invariantIan Jackson2026-07-231-0/+3
| | | |
| * | | tor-checkable: Re-export TimeRangeBound at the top-levelIan Jackson2026-07-232-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | This module has only few public items - currently, only one. And it has the word "time" in it. It doesn't make sense to expect callers to write `timed::`.
| * | | tor-checkable: import time::Duration for brevityIan Jackson2026-07-231-3/+3
|/ / / | | | | | | | | | | | | I noticed this clumsiness while passing. We can't do the same for SystemTime because we have the wasm SystemTime thing too :-/.
* | | Merge branch 'edition' into 'main'Jim Newsome2026-07-228-48/+55
|\ \ \ | | | | | | | | | | | | | | | | Bump edition of tor-dirserver and tor-dirauth See merge request tpo/core/arti!4227
| * | | Much formatting churn for 2024 editionIan Jackson2026-07-226-46/+53
| | | |
| * | | Bump edition of tor-dirserver and tor-dirauthIan Jackson2026-07-222-2/+2
| |/ / | | | | | | | | | | | | Apparently these crate creations were outstanding when the workspace's edition was increased.
* | | Merge branch 'deftly-4' into 'main'Jim Newsome2026-07-221-4/+4
|\ \ \ | | | | | | | | | | | | | | | | Update to derive-deftly 1.11.4 See merge request tpo/core/arti!4228
| * | | Update to derive-deftly 1.11.4Ian Jackson2026-07-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To pick up this fix: * BETA: Allow user-defined expansions whose definition is just a string literal `"..." within `${concat }` and `$"..."`. which I have just released.
* | | | Merge branch 'td2-desc' into 'main'Ian Jackson2026-07-2236-257/+1267
|\ \ \ \ | |/ / / |/| | | | | | | | | | | tor-netdoc testdata-live: Update and expand See merge request tpo/core/arti!4224
| * | | tor-netdoc testdata-live: Clarify what should be committedIan Jackson2026-07-221-2/+4
| | | |
| * | | tor-netdoc: Fix grammar in a commentIan Jackson2026-07-221-1/+1
| | | |
| * | | tor-netdoc testdata-live: Save selected routers' descriptors (effect)Ian Jackson2026-07-2215-0/+819
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Run crates/tor-netdoc/testdata-live-download with the locally saved, previously downloaded, network statuses. It downloaded these descriptors.
| * | | tor-netdoc testdata-live: Save selected routers' descriptorsIan Jackson2026-07-222-0/+30
| | | |
| * | | tor-netdoc testdata-live: Split off selected routers' routerstatus entries ↵Ian Jackson2026-07-2215-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (effect) Run crates/tor-netdoc/testdata-live-download with the locally saved, previously downloaded, network statuses. (It didn't download anything extra, but it did produced these new output files, as expected.)
| * | | tor-netdoc testdata-live: Split off selected routers' routerstatus entriesIan Jackson2026-07-221-1/+5
| | | | | | | | | | | | | | | | | | | | This will be convenient for saving their descriptors, and may be useful for other purposes too.
| * | | tor-netdoc testdata-live: Download fresh dataIan Jackson2026-07-223-70/+380
| | | | | | | | | | | | | | | | Precisely a run of crates/tor-netdoc/testdata-live-download.
| * | | tor-netdoc testdata-live: Document the contents of testdata-live/Ian Jackson2026-07-221-0/+7
| | | |
| * | | tor-netdoc testdata-live: Report URLs we are downloading to stderrIan Jackson2026-07-221-0/+1
| | | |
| * | | tor-netdoc testdata-live: Do not re-download already-fetched inputsIan Jackson2026-07-224-398/+93
| | | | | | | | | | | | | | | | We don't fetch files to the names we commit.
| * | | tor-netdoc testdata-live: Add http:// to URLsIan Jackson2026-07-211-1/+1
| | | | | | | | | | | | | | | | curl infers this, but we should include it.
| * | | tor-netdoc testdata-live: Break out run-curl functionIan Jackson2026-07-211-1/+7
| | | |
| * | | tor-netdoc tests; work around version number ordering issueIan Jackson2026-07-211-0/+16
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Ideally we would have Arti sort things sensibly but currently we have no types in Arti that are (1) faithful (2) sort correctly. Most of the existing types eventually have a `TorVersion` inside, which is lossy, so we can't use them for (eg) dirauth network status processing.
* | | Merge branch 'relay-incoming-stream4' into 'main'gabi-2502026-07-2212-25/+310
|\ \ \ | | | | | | | | | | | | | | | | arti-relay: Spawn DirMirror, start handling BEGIN_DIR See merge request tpo/core/arti!4222
| * | | arti-relay: Turn a TODO(relay-tuning) into TODO DIRMIRRORGabriela Moldovan2026-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | Context: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4222#note_3437336