Commit Graph

5432 Commits

Author SHA1 Message Date
Nick Mathewson 6b12c5d1de guardmgr: remove todo about bridge::config::Inner members
We've revised this a few times; now it seems plausible.
2022-11-29 11:03:44 -05:00
Nick Mathewson 0c0f3d1faf guardmgr: Remove now-unneeded #[allow(unnecessary_wraps)] 2022-11-29 11:00:27 -05:00
Nick Mathewson 69744ef8f3 Remove deprecated aliases in tor-linkspec. 2022-11-29 10:56:59 -05:00
Nick Mathewson 75cba2ce80 ptmgr: Refine RetryTime for ChildSpawnFailed. 2022-11-29 10:44:09 -05:00
Nick Mathewson 29ea66ecb9 ptmgr: Rename ClientTransportFailed, document, and correct its RetryTime. 2022-11-29 10:42:26 -05:00
Nick Mathewson d9dc30bc13 ptmgr: Replace StdioUnavailable with a PtError. 2022-11-29 10:36:51 -05:00
Nick Mathewson 7f923b9dfe Rename LocalLoginFailed to ExternalToolFailed. 2022-11-29 10:32:59 -05:00
Nick Mathewson eebfe8300e Document better what LocalProtocolViolation does not cover. 2022-11-29 10:29:54 -05:00
Nick Mathewson f08cfb6567 Merge branch 'ptmgr-cleanup' into 'main'
Post-merge cleanups for PtMgr

Closes #667 and #659

See merge request tpo/core/arti!893
2022-11-29 14:46:55 +00:00
Ian Jackson fe07367cef Merge branch 'update_packages_20221128' into 'main'
Dependency upgrades and updates in preparation for upcoming release

See merge request tpo/core/arti!892
2022-11-29 14:32:44 +00:00
Nick Mathewson 9a17a6a8aa Switch from sha-1 back to sha1.
As near as I can tell, the rust-crypto SHA1 crate was called `sha-1`
for a while because of a conflict with a different SHA1 crate.  Now
they apparently have the `sha1` name back and have deprecated the
`sha-1` name.
2022-11-29 08:24:58 -05:00
Nick Mathewson af0984bcaa Run cargo update in preparation for next release 2022-11-29 08:13:56 -05:00
Nick Mathewson e317c0ad6b Merge branch 'repro-less-shm' into 'main'
reproducible builds without shm

Closes #614

See merge request tpo/core/arti!818
2022-11-29 13:06:06 +00:00
eta 3a0f0a909d Spelling fix in arti_client::err 2022-11-29 12:31:50 +00:00
Ian Jackson 8835c1b170 Merge branch 'redacted' into 'main'
Define a "redactable" trait, and use it when logging guard info

Closes #648 and #627

See merge request tpo/core/arti!882
2022-11-29 12:29:48 +00:00
trinity-1686a 3d5d4ada01 use newer version of zstd and lzma 2022-11-29 12:54:25 +01:00
Ian Jackson d78295929b Merge branch 'more_netdoc_tests' into 'main'
tor-netdoc: More tests for routerdesc accessors and parsing.

See merge request tpo/core/arti!870
2022-11-29 11:11:47 +00:00
Nick Mathewson 1f4a385d7d Temporarily make ptmgr required for arti-client :/ 2022-11-28 17:29:32 -05:00
Nick Mathewson 820657b6bc PtMgr: Use a persistent state directory for PT state.
This makes a `pt_state` directory inside .local/share/arti (or the
local equivalent), right next to our existing `state` dir.

Ideally we would use a separate directory for each PT, but we have a
very fuzzy "what is a specific PT" notion.

Closes #667
2022-11-28 17:29:32 -05:00
Nick Mathewson 1a9c4c722b Integrate PtMgr into arti-client.
If support is available at compile-time, then we construct a PtMgr
and register it with the ChanMgr.  We keep a handle to it ourself so
that we can reconfigure it as needed.

Closes #659.
2022-11-28 17:29:32 -05:00
Nick Mathewson 3db0e05b39 Fix ChanMgr APIs for setting PtMgr etc to match what TorClient wants. 2022-11-28 17:29:23 -05:00
Nick Mathewson 3fa86f41a6 Revise the API of "PtMgr::reconfigure"
I prefer that it not take `&mut self`, since PtMgr already has
interior mutability.

I also need it to take `tor_config::Reconfigure` argument, in case
it gains any more smarts about validation in the future.
2022-11-28 17:29:23 -05:00
Nick Mathewson c99017b0d6 ptmgr: Note a TODO issue around TempDir. 2022-11-28 17:29:23 -05:00
Nick Mathewson 4b5be3685f ptmgr: Fill in some error-related code; resolve TODOs. 2022-11-28 17:29:23 -05:00
Nick Mathewson 1fa9296f9c ptmgr: clear up unused_import exceptions. 2022-11-28 17:29:23 -05:00
Nick Mathewson 6bde90ce01 PtMgr: New features section in README.md
Per convention, have a `full` feature.

Also, downgrade the 'TODO pt-client' entries in README::limitations,
since they are not blockers for 1.1.0.
2022-11-28 17:29:23 -05:00
Nick Mathewson 8d0ac9bdc8 ptmgr: Mark PtMessage and next_message as experimental-api.
These are implementation details and we don't want to mark them as
stable.

To do this, I needed to apply some additional options to the example
code's configuration in Cargo.toml.
2022-11-28 17:29:23 -05:00
Nick Mathewson d6642ef6ac Merge branch 'ptmgr-draft' into 'main'
Pluggable transport manager

See merge request tpo/core/arti!886
2022-11-28 19:44:18 +00:00
eta a3c9fc5b1a tor-chanmgr: Introduce the BootstrapReporter API, publicize ChanBuilder
This commit makes the `ChanBuilder` type in `tor-chanmgr` usable by
consumers outside of that crate, like the doc comment for
`ChannelFactory` says you need to be able to do in order to turn your
`TransportHelper` into something useful.

As part of doing this, the `event_sender` its constructor takes needed
to be dealt with, since it was a crate-internal type that came from
inside the `ChanMgr`.

Enter `BootstrapReporter`: an opaque wrapper around that sender, now
provided as an additional argument to
`ChannelFactory::connect_via_transport`. You can now construct a
`ChanBuilder` outside this crate, and it'll still be able to report its
bootstrap status by unwrapping this new type that's threaded through
from the `ChanMgr`. (This was a fair deal of manually threading the type
through all the layers in this crate!)

Note that you cannot implement bootstrap updating using something that
isn't `ChanBuilder` yet due to the type being entirely opaque (but, of
course, we can figure out exactly what API the reporter should have
later, and add that capability in).
2022-11-28 13:52:21 -05:00
eta 3b41c78d6f Draft: Pluggable transport manager
This commit implements `PtMgr`, a pluggable transport manager
responsible for keeping track of spawned PTs and spawning them to
satisfy client requests on demand.

It does this in two parts: the `PtMgr` type exported to the rest of the
code, and the background `PtReactor` that actually does the spawning;
this design ensures that only one attempt to spawn a PT is active at a
time, and will prove useful later for implementing e.g. timeouts.

A few changes were necessary to the rest of the code in order to make
this all work out. Namely:
- `TransportRegistry`'s API didn't make any sense for two reasons:
  - It wasn't feasible for implementors to implement `ChannelFactory`,
    since that'd require constructing a `ChanBuilder` (which requires a
    bootstrap reporting event sender).
  - Treating the PT manager as a registry is over-general; it's only
    necessary for it to spawn pluggable transports, so saddling it with
    other concerns didn't make any sense.
  - (It's possible to get extensibility for arbitrary user customization
    by just letting the user swap in a new `ChannelFactory`, anyway.)
- Therefore, the `PtMgr` implements the new `AbstractPtMgr` trait, which
  is far more narrowly focused; this only exists to solve a dependency
  loop, and is documented as such.
  - This provides a `TransportHelper` instead of a `ChannelFactory`.
2022-11-28 13:52:21 -05:00
Nick Mathewson 5d6044f3fc Rustdoc fix: escape []s. 2022-11-28 09:36:15 -05:00
Nick Mathewson 45c4beff7a Fix up compatibility issues between linkspec tests and other patches 2022-11-28 08:29:33 -05:00
Nick Mathewson 777b6bee3d linkspec: Add some tests for ChannelMethod 2022-11-28 08:20:57 -05:00
Nick Mathewson 60bc179019 linkspec: Tests for PtTargetSettings 2022-11-28 08:19:47 -05:00
Nick Mathewson 119e5f6f75 PtTransportName: Remove unused accessors. 2022-11-28 08:19:47 -05:00
Nick Mathewson d990a23948 linkspec: Add tests for has_any_identity. 2022-11-28 08:19:45 -05:00
Nick Mathewson 145ab3c49b linkspec: Add test for lookup on no-ids. 2022-11-28 08:19:08 -05:00
Nick Mathewson aa72f3d8c8 Add a test for ByRelayIds::remove_by_all_ids 2022-11-28 08:19:08 -05:00
Nick Mathewson a77172e20d safelog: Make MaybeRedacted<T> opaque. 2022-11-28 08:01:53 -05:00
Nick Mathewson cf9f29158f GuardMgr: Treat Guards as sensitive and Bridges as redacted.
This machinery is a bit inelegant, but it is all confined to
be within the GuardMgr crate, so IMO it should be fine for now.
2022-11-28 08:01:53 -05:00
Nick Mathewson c62958c76f Add a default debug_redacted impl to save space. 2022-11-28 08:01:53 -05:00
Nick Mathewson 29f903bdac Display guards in redacted form in guard status messages.
Closes #627, again.

Closes #648.
2022-11-28 08:01:53 -05:00
Nick Mathewson 2aa0ae4016 linkspec: Give a Redacted form for chantarget. 2022-11-28 08:01:50 -05:00
Nick Mathewson 8d36fa9996 llcrypto: Make key id types Redactable. 2022-11-28 08:01:10 -05:00
Nick Mathewson f2c91ef56e safelog: Add a MaybeRedacted wrapper too.
This is super helpful for cases where we want to write two nearly
identical implementations to format a type.
2022-11-28 08:01:10 -05:00
Nick Mathewson f91218c78d safelog: implement Redactable for network addr types. 2022-11-28 08:01:10 -05:00
Nick Mathewson d3f4956728 safelog: Define a "Redactable" trait
A "redactable" object is one that can be _partially_ scrubbed in
sensitive contexts.  This can be very helpful for UX, but is not
risk-free: see comments.
2022-11-28 08:01:10 -05:00
Nick Mathewson 8cf9e2a6a4 Merge branch 'chanmethod-non-exhaustive' into 'main'
Make ChannelMethod non-exhaustive

See merge request tpo/core/arti!891
2022-11-27 19:36:22 +00:00
Nick Mathewson 984bd6012a Merge branch 'reconfig-bridges-bad' into 'main'
Require state ownership when using bridges

Closes #612

See merge request tpo/core/arti!889
2022-11-27 19:30:00 +00:00
Nick Mathewson c80702cf39 Merge branch 'rustls-0.20' into 'main'
Rustls 0.20

Closes #305

See merge request tpo/core/arti!821
2022-11-27 19:28:32 +00:00