Commit Graph

3115 Commits

Author SHA1 Message Date
Nick Mathewson 80d9248b50 Merge branch 'merge_ptreactor' into 'main'
Merge PtReactor, resolve a few of my comments.

See merge request tpo/core/arti!903
2022-11-30 15:21:13 +00:00
Nick Mathewson dacb3eafda ptmgr: report an error if PT transports don't match requested.
(I think this may be impossible now, since we check in ipc.rs, but
IMO it's best to check.)
2022-11-29 20:01:19 -05:00
Nick Mathewson 5f0f5f81b1 arti-client: Try to take ownership of state earlier.
There's no harm in doing this, since we'll try to take ownership of
the state soon as soon as we use it: We just want to try early, so
that we'll get it before we decide that we're using bridges.

Fixes bug #669; bug introduced by !889.
2022-11-29 19:58:42 -05:00
Nick Mathewson fdc49b1fed Register transport in pt reactor even if it has no pending requests 2022-11-29 19:35:38 -05:00
Nick Mathewson 9765fdc2e6 ptmgr: Use anonymize_home when displaying paths in errors 2022-11-29 19:30:50 -05:00
Nick Mathewson f6311c83f7 ptmgr: Use PluggableTransport::identity in logs.
This lets us avoid logging the user's path.
2022-11-29 19:20:44 -05:00
Nick Mathewson bb0749cd42 Centralize the "find an identifier for the pt name" logic in one place. 2022-11-29 19:13:32 -05:00
Nick Mathewson 21e7e52ad5 Merge remote-tracking branch 'eta/ptreactor-v1' into merge_ptreactor
Resolved several conflicts while doing so; mostly with !893 and
!895.
2022-11-29 18:55:49 -05:00
eta 9b4fc50625 tor-ptmgr: add PtReactor
This fleshes out the PtReactor that was previously a stub, making it
actually do reactor-ey things. Note that this is entirely untested, and
might not work at all. Hopefully it does, though.
2022-11-29 20:13:32 +00:00
Nick Mathewson 7ef9dde99c Merge branch 'todos-chanmgr' into 'main'
chanmgr: resolve several remaining "TODO pt-client" issues

See merge request tpo/core/arti!897
2022-11-29 19:31:48 +00:00
Nick Mathewson dc5551114c Merge branch 'list-builder-lint' into 'main'
tor-basic-utils: list_builder: Use standard test lint block

See merge request tpo/core/arti!900
2022-11-29 19:25:07 +00:00
Ian Jackson f3c8b0433b tor-basic-utils: list_builder: Use standard test lint block
This gets rid of a spurious warning on nightly about the use of dbg!
2022-11-29 18:41:56 +00:00
Nick Mathewson bdddb78828 Merge branch 'more-linkspec-tests' into 'main'
Add tests for a bunch of code in tor-linkspec

See merge request tpo/core/arti!867
2022-11-29 18:41:54 +00:00
Nick Mathewson 8cc09c2728 chanmgr: Distinguish failure to connect to proxy from other IO failures 2022-11-29 13:41:35 -05:00
Ian Jackson c3bdb30025 Merge branch 'ptmgr-optional-dep-test' into 'main'
MultilineListBuilder etc.: add serde tests

See merge request tpo/core/arti!899
2022-11-29 18:37:43 +00:00
Ian Jackson b36a23cfd3 Merge branch 'ptmgr-optional-dep' into 'main'
Support building without pluggable transports

Closes #649

See merge request tpo/core/arti!898
2022-11-29 18:26:30 +00:00
Ian Jackson 303fafe81b Merge branch 'll-todo-fixes' into 'main'
Fix and resolve TODO pt-client comments in guardmgr, linkspec.

See merge request tpo/core/arti!896
2022-11-29 18:14:25 +00:00
Ian Jackson cdc1e574f9 tor-config MultilineListBuilder: Test deserialisation 2022-11-29 17:53:04 +00:00
Ian Jackson 255f3b6bf6 tor-config MultilineListBuilder: Print line number starting at 1, not 0 2022-11-29 17:53:04 +00:00
Ian Jackson ef07c2e99d tor-config list_builder tests: Move Outer up a level
We're going to reuse this.
2022-11-29 17:53:04 +00:00
Ian Jackson 211a832f6d Clarify internal error. 2022-11-29 17:22:16 +00:00
Ian Jackson 143b331ef7 arti-client: Make ptmgr actually optional 2022-11-29 16:32:14 +00:00
Ian Jackson 1bd606ab5c guardmgr: Conditionalise DisplayRule::Redacted
This is unused in bridgeless configs.  Fixes a compiler warning.
2022-11-29 16:32:14 +00:00
Ian Jackson c92dcb5f50 arti, arti-client: Conditionalise various things on pt-client 2022-11-29 16:32:14 +00:00
Ian Jackson d05d383fa5 arti cfg tests: Add some more debug output 2022-11-29 16:32:14 +00:00
Ian Jackson 71e81bf7b4 MultilineListBuilder: Use a manual implementation of Deserialize
The error message from `#[serde(untagged)]` would otherwise start to
appear when we try to deserialise unsupported PT configurations, when
compiled with bridge but not PT support.
2022-11-29 16:32:14 +00:00
Nick Mathewson c6aa587dc8 chanmgr: remove a now-stale TODO. 2022-11-29 11:15:36 -05:00
Nick Mathewson 4fff9f9dda chanmgr: Report Pt errors correctly.
We were panicking if the PtMgr gave us an error, which isn't so
good.
2022-11-29 11:10:26 -05:00
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
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
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
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