Commit Graph

426 Commits

Author SHA1 Message Date
Nick Mathewson 99ec1c9818 tor-hscrypto: Rename key types to correspond to new spec names. 2023-02-08 12:27:36 -05:00
Nick Mathewson 8ee04ac203 Merge branch 'logs' into 'main'
Report causes of errors

Closes #680

See merge request tpo/core/arti!997
2023-02-01 18:19:33 +00:00
Nick Mathewson 7c1b6a5a81 Bump the patch version of every crate that had API additions
These crates had API or behavior changes that may affect downstream
crates. Fortunately, they're all version 0.x, and don't need minor
bumps for this.
2023-02-01 10:36:29 -05:00
Nick Mathewson 66f594a4b6 Bump the patch-level version of crates with _minor_ changes.
These changes influence behavior, but not effect compatibility.
(If I messed up, and any crate except for `arti` has non-breaking
API changes, that's still fine, since they are all version
0.x.)
2023-02-01 10:23:58 -05:00
Ian Jackson 37edcd688a Use ErrorReport - run rustfmt
Split off for ease of review and possible rebase.
2023-01-30 18:52:32 +00:00
Ian Jackson 3a8c36e9c6 Use ErrorReport for remaining errors in error! in tor-circmgr 2023-01-30 18:52:32 +00:00
Ian Jackson 25c41977ac Use ErrorReport for errors in warn! in tor-circmgr 2023-01-30 18:52:32 +00:00
Ian Jackson f657ef5b6c Use ErrorReport for errors in info! in tor-circmgr 2023-01-30 17:59:09 +00:00
Nick Mathewson b7c8646d7b circmgr: drop a receiver more explicitly.
Clippy now complains about `let _ = (expr_producing_a_future);`,
which is probably smart, since maybe you wanted to await that future
and ignore the result.  So it seems that the right way to get rid of
an unwanted Receiver is now to drop it explicitly.

Closes #749
2023-01-27 09:16:51 -05:00
Nick Mathewson a6dd92843e Allow clippy::unchecked_duration_subtraction in tests
This panics on error, and we're fine with a panic on misbehavior in
tests.
2023-01-27 08:28:02 -05:00
Nick Mathewson bf04641c68 Disable clippy::unlinlined-format-args
This warning kind of snuck up on us! (See #748)  For now, let's
disable it.  (I've cleaned it up in a couple of examples, since
those are meant to be more idiomatic and user-facing.)

Closes #748.
2023-01-27 08:27:47 -05:00
Nick Mathewson 8ce05dc725 CircMgr: Draft API to construct targeted multihop circuits.
Onion services and onion clients need these to make connections to
HsDirs, Introduction points, and Rendezvous points.
2023-01-24 12:32:21 -05:00
Nick Mathewson 190f24e66d CircMgr: Draft APIs used to implement onion service clients. 2023-01-24 12:32:21 -05:00
eta 118050e54c Merge branch 'test-lints' into 'main'
Add test lint blocks to all "mod test"

See merge request tpo/core/arti!937
2023-01-06 17:16:09 +00:00
Emil Engler 8579bc66a8
doc: consistent summary line for the READMEs
This commit introduces a consistency to the summary line of all
README.md files in each and every crate.
2022-12-20 14:31:47 +01:00
Ian Jackson 125a455bdc test lint blocks: Add many many automatically
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
2022-12-12 18:00:30 +00:00
Ian Jackson 4181ccb8cc tor-circmgr: Use ErrorReport on a logged error
To demonstrate what the use looks like.
2022-12-12 16:40:51 +00:00
Nick Mathewson e0aeda3071 Remove semver.md files now that 1.1.0 is released. 2022-11-30 17:10:29 -05:00
Nick Mathewson 38bef96b99 Bump the minor version of every crate.
We made this job easy this time around: by incrementing our MSRV, we
have forced ourselves to do at least a minor bump everywhere.
2022-11-30 15:10:16 -05:00
Ian Jackson b822e2ebe9 tor-cirmgr: Replace OwnedChanTarget with LoggedChanTarget in errors
This
 1. Makes the errors smaller
 2. Redacts (currently, scrubs) the chantarget when safe logging is enabled

The other error variants in tor-circmgr::Error don't seem to contain
information that should become sensitive as part of bridge support.
2022-11-23 18:28:38 +00:00
Nick Mathewson f2121101d1 Even more comments explaining circuit cancellation. 2022-11-22 12:53:32 -05:00
Nick Mathewson e7c942c918 Improve notes surrounding circuit cancellation.
It turns out that bug #656 is not a real bug, but it was easy to
overlook the code that prevented it.

Closes #656.
2022-11-22 12:53:32 -05:00
Nick Mathewson c0aa10d409 CircMgr: retire all circuits if bridge configuration changes.
Closes #650.
2022-11-22 12:53:32 -05:00
Nick Mathewson 47041bd4ce Merge branch 'refactor_into_ownedchantarget' into 'main'
CircMgr: Refactor DirSpecificTarget constructor

See merge request tpo/core/arti!866
2022-11-18 15:21:46 +00:00
Nick Mathewson ec148a63cb CircMgr: Refactor DirSpecificTarget constructor
This commit replaces the
`impl From<&T> for OwnedChanTarget where T:ChanTarget`
with a new `IntoOwnedChanTarget` trait. This lets us be explicit
that we're constructing an owned object, and not just converting
something.

No semver change needed, since these APIs haven't been released.

----------- (new description)
2022-11-18 09:55:46 -05:00
Nick Mathewson 76e41b8bf6 circmgr: make some imports conditional
This resolves an "unused import" warning when bridges are not
enabled.
2022-11-18 08:53:47 -05:00
Nick Mathewson 1928fd0b72 circmgr: Make "specific-relay" non-experimental. 2022-11-18 08:53:47 -05:00
Nick Mathewson db9440464b Remove a spurious log that I committed by mistake. Whoops. 2022-11-15 13:15:32 -05:00
Nick Mathewson 050eab9bba Implement more cases for `DirSpecificTarget`.
Without this fix, any attempt to actually use a circuit for a
`DirSpecificTarget` will fail, since supports() will say false, and
`restrict_mut()` will say `NotSupported`.
2022-11-15 11:42:54 -05:00
Ian Jackson b41becec56 Merge branch 'guardmgr' into 'main'
Move guardmgr creation to arti-client, rather than within circmgr

See merge request tpo/core/arti!850
2022-11-14 17:01:31 +00:00
Ian Jackson 525c452e77 Move GuardMgr::new call to arti_client::TorClient
Having this done within circmgr was irregular - most of our other key
buildup functions are done in TorClient::create_inner.

It is also inconvenient, as it buries the guardmgr within the circmgr.
2022-11-14 15:50:07 +00:00
Ian Jackson 9ecda958a4 Document Clone semantics of GuardMgr and DirMgr 2022-11-11 16:55:56 +00:00
Nick Mathewson 936920b26e bump rust-version to 1.60 in every crate. 2022-11-10 10:57:33 -05:00
Ian Jackson 8efcfb64af Merge branch 'misc-todo-ptclient' into 'main'
Downgrade and/or remove a few misc "TODO pt-client" comments

See merge request tpo/core/arti!838
2022-11-08 16:21:30 +00:00
Nick Mathewson 6b422b1c4d circmgr: downgrade TODO pt-client comments
These are structure-internal things we can solve later, if ever.
2022-11-08 08:31:59 -05:00
Nick Mathewson 95a95076a7 Refactor external guardmgr APIs: Stop taking NetDir arguments.
These arguments were used only for legacy (testing) purposes; the
tests now use `TestNetDirProvider`.  This lets us simplify our
internal logic for passing a `NetDir` to our samples, and prepare
for having a `BridgeSet` to pass there instead.

This is a breaking change to `guardmgr` and `circmgr`.
2022-11-08 08:10:15 -05:00
Ian Jackson 6c64be06a6 guardmgr config: Introduce and require new GuardMgrConfig trait
It doesn't seem to me like it makes sense to provide the backward
compatibility here.
2022-11-03 15:43:41 +00:00
Ian Jackson 2bfce54959 guardmgr config: Pass fallback list from config by reference
This does involve additional cloning.  However, soon it will mean that
we can pass the whole `TorClientConfig` by reference.
2022-11-03 15:43:41 +00:00
Nick Mathewson 932fe48eaf Run add_warnings. 2022-11-03 11:06:02 -04:00
Nick Mathewson 40ec12b0cb Merge branch 'guards_as_bridges_part1' into 'main'
Allow GuardMgr to expose bridges as guards (part 1)

See merge request tpo/core/arti!785
2022-10-24 13:30:02 +00:00
Nick Mathewson c4263543d4 circmgr: More NOTEs and TODO pt-clients. 2022-10-24 08:59:12 -04:00
Nick Mathewson 103c88dd95 Circmgr: construct paths using either Relay or OwnedCircTarget
Previously we could only use Relay for this case, which won't work
any more: a Bridge is not a `tor_netdir::Relay`.  Instead we allow
the GuardMgr to give us something that knows how to convert itself
into an OwnedCircTarget.

This change required a far amount of follow-on revisions and
refactoring, but it should all be internal to the path-building
logic.
2022-10-24 08:59:12 -04:00
Ian Jackson a30e42a740 tor-circmgr: Make get_or_launch_dir_specific feature-specific 2022-10-21 15:19:18 +01:00
Ian Jackson 6806180ce1 tor-circmgr: Rename get_or_launch_dir_specific from _bridge
DirSpecificTarget in the usage was renamed apropos an MR comment but
this function name was overlooked.
2022-10-21 15:19:18 +01:00
Ian Jackson aa3cd7a97c tor-circmgr README: Add experimental features boilerplate 2022-10-21 15:18:41 +01:00
Ian Jackson ea7f31b357 tor-circmgr README: Remove "Limitations"
This doesn't make sense now we've released Arti 1.0.  The version
number is enough I think.
2022-10-21 15:18:41 +01:00
Ian Jackson ef5e60c879 circmgr: Plumbing for direct to target directory circuits
The target is identified by Into<OwnedChanTarget>.
We introduce corresponding TargetCircUsage and SupportedCircUsage.
2022-10-20 13:28:30 +01:00
Ian Jackson f84d8777db cargo fmt to remove blank lines
Apparently cargo fmt doesn't like these, which my perl rune didn't
delete.

This commit is precisely the result of `cargo fmt`.
2022-10-12 15:29:04 +01:00
Ian Jackson d9910dba08 Replace all README copies in src/lib.rs with includes
The feature we want is `#[doc = include_str!("README.md")]`, which is
stable since 1.54 and our MSRV is now 1.56.

This commit is precisely the result of the following Perl rune:
  perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
2022-10-12 15:29:03 +01:00
Ian Jackson 82ad9eea5f Allow "clippy::single_char_pattern" in tests.
This lint exists for perf reasons, and this is rarely relevant in
tests.

Using double quoted str is generally cognitively less burdensome.
2022-10-12 13:50:29 +01:00