Commit Graph

7809 Commits

Author SHA1 Message Date
Ian Jackson f6d5cae574 tor-circmgr: Add two possibly-needed docsrs annotations
I don't know if these are needed because the rules are not documented
afaict.  But it seems like probably they ought to be there?
2023-07-12 15:32:26 +01:00
Ian Jackson 1fa692d63d tor-proto: Conversation: drop two otiose cfg(feature)
These fns are in a feature-gated impls on feature-gated structs.
2023-07-12 15:31:30 +01:00
Nick Mathewson 1737832164 Merge branch 'channelfactory' into 'main'
Expose channel builder in order to create channels more efficiently in external code

See merge request tpo/core/arti!1374
2023-07-12 13:40:54 +00:00
gabi-250 484e2b0bbc Merge branch 'ci-full-build' into 'main'
CI: Add a job for building arti with additional features.

See merge request tpo/core/arti!1401
2023-07-12 10:15:07 +00:00
Gabriela Moldovan 0de2ee756e
CI: Remove unnecessary --feature flag.
`onion-service-client` is now a default feature, so we don't need to
explicitly enable it anymore.
2023-07-12 10:51:25 +01:00
Nick Mathewson a2c935f292 Merge branch 'remove-outdated-todo' into 'main'
arti-client: Remove outdated TODO.

See merge request tpo/core/arti!1400
2023-07-12 00:48:19 +00:00
Gabriela Moldovan d9e4ca9ecb
CI: Add a job for building arti with additional features.
This is needed for testing `experimental-api` features (such as the
keymgr) in shadow and chutney.

Prompted by this discussion: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1399#note_2921294
2023-07-11 20:45:27 +01:00
Gabriela Moldovan 674fc9d7dc
arti-client: Remove outdated TODO.
These errors aren't ignored anymore.
2023-07-11 16:49:44 +01:00
Nick Mathewson bcf574cef5 Merge branch 'explain_952_fix' into 'main'
Explain the code for the #952 fix.

See merge request tpo/core/arti!1391
2023-07-11 09:53:09 +00:00
Ian Jackson 3acc2af4f3 Merge branch 'clippy-allow' into 'main'
clippy: Allow some of our existing code patterns

See merge request tpo/core/arti!1396
2023-07-11 09:37:42 +00:00
Nick Mathewson e265f65fec Merge branch 'fix-chutney-ci' into 'main'
fix chutney in CI

See merge request tpo/core/arti!1393
2023-07-10 23:58:13 +00:00
trinity-1686a 4fc779faa2 make chutney setup script more portable 2023-07-10 18:46:14 +02:00
Ian Jackson db99117b9a Merge branch 'range' into 'main'
Forbid use of panicky Rng::gen_range

Closes #920

See merge request tpo/core/arti!1387
2023-07-10 15:28:54 +00:00
Ian Jackson 24bec4552b rng docs: Fix two links 2023-07-10 16:08:03 +01:00
Ian Jackson a0a17e4074 rng ranges: Provide examples (doctests) 2023-07-10 16:08:03 +01:00
Ian Jackson d1ed505b61 rng ranges: Forbid use of panicky Rng::gen_range
Fixes #920
2023-07-10 16:08:03 +01:00
Ian Jackson b151237a7f rng ranges: Use gen_range_infallible() for Duration::ZERO..=T 2023-07-10 16:08:03 +01:00
Ian Jackson 09f0ecaa71 rng ranges: Introduce gen_range_infallible
There are a number of places where we generate random Durations
in a range which starts at zero.

These call sites currently (i) have to write out Duration::ZERO
or equivalent, and (ii) would have to use gen_range_checked and expect
the result, even though it can be statically proven to be OK.

To make this slightly smoother, provide `GenRangeInfallible` and
`gen_range_infallible`.
2023-07-10 16:07:18 +01:00
Ian Jackson 8ae759ef95 rng ranges: Use gen_range_checked().unwrap() in test case
Ideally we would be allowed to use vanilla gen_range() here, but there
doesn't seem to be a way to allow a specific clippy-forbidden method
using #[allow] and we probably don't want to make a blanket allow.
2023-07-10 16:07:18 +01:00
Ian Jackson 332285015f rng ranges: Use gen_range_checked().expect() in obvious cases (fmt) 2023-07-10 16:07:18 +01:00
Ian Jackson 5e10805ede rng ranges: Use gen_range_checked().expect() in obvious cases
In each of these, it is locally obvious that the range is nonempty.
2023-07-10 16:07:18 +01:00
Ian Jackson 36f998b690 tor-basic-utils: retry: Use and justify gen_range_checked
delay_bounds's implementation ensures the postcondition, so the
potential p[anic in next_delay_msec cannot happen.
2023-07-10 16:07:18 +01:00
Ian Jackson 58da20b708 rng ranges: Introduce RngExt and gen_range_checked
We will use this in many places instead of gen_range.
2023-07-10 16:07:18 +01:00
gabi-250 1510cf42b7 Merge branch 'keymgr-erased-key' into 'main'
keymgr: Use Box<dyn EncodableKey> instead of Box<dyn Any>.

Closes #937

See merge request tpo/core/arti!1398
2023-07-10 15:06:34 +00:00
gabi-250 47f7e8a6dd Merge branch 's101-q2' into 'main'
Update s101 stats.

See merge request tpo/core/arti!1397
2023-07-10 14:41:02 +00:00
Gabriela Moldovan bd4955f9ed keymgr: Add semver.md. 2023-07-10 15:38:58 +01:00
Gabriela Moldovan 9cde64c2c8 keymgr: Use Box<dyn EncodableKey> instead of Box<dyn Any>.
Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1337#note_2917701

This will make it harder to accidentally return the wrong value from
`Keystore::get` (the returned value is now at least guaranteed to
implement `EncodableKey`).

Closes #937
2023-07-10 14:41:30 +01:00
Alexander Færøy 6be6352b98 Merge branch 'conversation' into 'main'
Overhaul send_control_message

See merge request tpo/core/arti!1367
2023-07-10 13:14:11 +00:00
Alexander Færøy 943c12739d Merge branch 'recurse' into 'main'
tor-hsclient: Mock traits: Work around an async boobytrap

See merge request tpo/core/arti!1365
2023-07-10 13:13:31 +00:00
Ian Jackson fd2e4979be clippy: tor-error: Use convert::identity for into_internal!
This launders the closure so that clippy's
clippy::redundant_closure_call can't see it.

We can't have a local #[allow] because it would be on an expression,
which isn't allowed on stable.

This avoids having to use more clumsy idioms at call sites.
2023-07-10 13:49:51 +01:00
Ian Jackson 1a8395cd11 tor-llcrypto: Add a missing instance of the standard lint block
This fixes a needless_vec lint on nightly.
2023-07-10 13:49:51 +01:00
Ian Jackson 473447a82e Run maint/add_warning to actually apply new lint allows 2023-07-10 13:49:51 +01:00
Ian Jackson 01cb7ee0a1 clippy: in tests, allow clippy::useless_vec
This is a perf issue, only.  If tests are too slow, we will notice and
ca speed them up.  We should optimise for clarity and convenience,
rather than speed.

Forbidding this can result in churn between vec![] and [] as tests are
updated and changed.
2023-07-10 13:49:51 +01:00
Ian Jackson 43bf89d540 clippy: globally allow clippy::needless_raw_string_hashes
Rationale: no-one writes these by default without thinkinh.  If they
are unnecessary, then either the string must have had " in it
before (in which case it might do again), or it is near other strings
which *do* need it.

And having it does no harm; indeed IMO it can increase clarity.

Alternative to !1388's
  Fix new "needless_raw_string_hashes" lint from clippy +nightly
2023-07-10 13:49:51 +01:00
Alexander Færøy 590c72eb03 Update s101 stats. 2023-07-10 14:35:27 +02:00
Nick Mathewson 9f3619d5c9 Merge branch 'clippy-vec' into 'main'
Fix new "useless_vec" warning from clippy +nightly

See merge request tpo/core/arti!1395
2023-07-10 12:07:31 +00:00
Ian Jackson 25b7573f58 Merge branch 'clippy-common' into 'main'
clippy +nightly: Uncontroversial adjustments from Nick

See merge request tpo/core/arti!1394
2023-07-10 12:01:02 +00:00
Nick Mathewson c2601ec896 Explain the code for the #952 fix.
Let's explain what Trinity did in its fix for #952, so that we know
why this code is here the next time we find it.
2023-07-10 08:00:08 -04:00
Ian Jackson 501454370f Fix new "useless_vec" warning from clippy +nightly
Explanation at
https://rust-lang.github.io/rust-clippy/master/index.html#/useless_vec

This is the non-tests subset of the same-named commmit in !1388,
(recreated by hand by me, and then checked against that commit;
I stole the commit message from Nick's.)

This should be uncontroversial I think.
2023-07-10 12:35:21 +01:00
Nick Mathewson 22f55b7cf8 Remove some needless into_iter() calls.
Clippy nightly now detects when you're calling into_iter() and
passing the result into something that accepts an
`impl IntoIterator`.
2023-07-10 12:33:21 +01:00
Nick Mathewson 0b6cc7ba5e Add exceptions for some cases of diverging_sub_expression
See here for documentation on the lint:
https://rust-lang.github.io/rust-clippy/master/index.html#/diverging_sub_expression

The issue here, from what I can tell, is that the lint triggers
whenever you use a diverging expression as a function body within an
2023-07-10 12:33:21 +01:00
Nick Mathewson 7e78224460 Add an exception for clippy::arc_with_non_send_sync.
We're doing this deliberately, I believe.
2023-07-10 12:33:21 +01:00
gabi-250 2db3e73434 Merge branch 'da-task' into 'main'
RFC: tor-rtmock: Use derive-adhoc for composite runtimes

See merge request tpo/core/arti!1381
2023-07-10 10:53:23 +00:00
Ian Jackson ca32680ba6 Merge branch 'onion-service-client-docs' into 'main'
Update documentation regarding the `onion-service-client` feature

See merge request tpo/core/arti!1392
2023-07-10 09:41:04 +00:00
trinity-1686a c98894cebc fix chutney in CI 2023-07-08 12:31:20 +02:00
Kunal Mehta 7acd7de369 Update documentation regarding the `onion-service-client` feature
It is no longer experimental, but still not rated for security-sensitive
usage per <https://blog.torproject.org/arti_116_released/>.
2023-07-07 22:01:51 -04:00
Ian Jackson 77b0dc2edc Merge branch 'raw_event_report' into 'main'
Fix warn_report and error_report macros.

See merge request tpo/core/arti!1390
2023-07-07 20:07:45 +00:00
Nick Mathewson 53c599d50f Fix warn_report and error_report macros.
Originally they didn't check err.kind(), since err.kind() can never
increase their severity.  We lost that behavior with !1386, and we
became dependent on it with arti!1383.  Since they both merged at
the same time, CI broke.

This patch restores their original behavior.
2023-07-07 15:46:41 -04:00
Nick Mathewson ba3876b22a Merge branch 'feat' into 'main'
arti: Build with HS client support by default

Closes #948

See merge request tpo/core/arti!1382
2023-07-07 19:28:05 +00:00
Nick Mathewson b6b7edad59 Merge branch 'event_report_everywhere' into 'main'
Throughout: Use event_report!() macros for reporting Errors.

Closes #949

See merge request tpo/core/arti!1383
2023-07-07 19:27:20 +00:00