Commit Graph

5120 Commits

Author SHA1 Message Date
trinity-1686a fda17829d5 fix deprecation warnings from rustls 2022-11-26 10:23:05 +01:00
trinity-1686a 0a917a1abc upgrade rustls to 0.20, ignoring all deprecation warnings 2022-11-26 10:23:05 +01:00
Ian Jackson c1fbf06e63 Merge branch 'restore_nightly' into 'main'
Switch CI back to nightly.

Closes #633

See merge request tpo/core/arti!884
2022-11-24 16:23:39 +00:00
Nick Mathewson c93d7d6e90 Switch CI back to nightly.
Now that they have merged
https://github.com/rust-lang/rust/pull/104416 ,
our CI should pass again with the regular nightly image.

Rather than remove the pinned image entirely, I'm commenting it out,
with a comment explaining how to pin an image the next time we need
to do so.

Closes #633.
2022-11-24 12:06:23 +00:00
Ian Jackson 90a1a10b3c Merge branch 'sensitive-error' into 'main'
Scrub channel target information in errors

See merge request tpo/core/arti!890
2022-11-23 20:18:17 +00:00
Ian Jackson dc13c93491 Merge branch 'bdm-dormant' into 'main'
bridge desc mgr: Honour specified dormancy

Closes #630

See merge request tpo/core/arti!861
2022-11-23 20:13:29 +00:00
Ian Jackson 6a39cdfe57 Merge branch 'watch-drop-option' into 'main'
tor-basic-utils: DropNotifyWatchSender: use DropNotifyEofSignallable

See merge request tpo/core/arti!853
2022-11-23 18:55:32 +00:00
Ian Jackson ef5a58e158 tor-dirclient: Replace OwnedChanTarget with LoggedChanTarget in SourceInfo
SourceInfo primarily appears in errors, here and in (indirectly)
tor-dirmgr.

This
 1. Makes the errors smaller
 2. Redacts (currently, scrubs) the chantarget when safe logging is enabled

This commit therefore deals with both tor-dirmgr and tor-dirclient
errors, from the pov of error information that should become sensitive
as part of bridge support.

The error pyaloads directly in tor_dirmgr/src/err.rs don't seem to
contain anything in that category.
2022-11-23 18:28:38 +00: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
Ian Jackson e635383dfb tor-chanmgr: Invent [Box]ChanSensitive for two error payloads
This
 1. Makes the errors smaller (in the case of Io's PtTargetAddr;
    ChannelBuild's addresses are already indirected in a Vec).
 2. Redacts (currently, scrubs) the PtTargetAddr and SocketAddr
    when safe logging is enabled

These are the remaining error variants in tor-chanmgr that contain
information that should become sensitive as part of bridge support.
2022-11-23 18:28:38 +00:00
Ian Jackson 32357b3de7 tor-chanmgr: Replace OwnedChanTarget with LoggedChanTarget in errors
This
 1. Makes the errors smaller
 2. Redacts (currently, scrubs) the chantarget when safe logging is enabled

This commit doesn't treat other should-be-sensitive inforemation in
errors just yet.  That will come in a moment.
2022-11-23 18:28:38 +00:00
Ian Jackson 45a79bf725 tor-linkspec: Provide LoggedChanTarget type alias and utility method
This makes it easy to talk about, and construct, a
BoxSensitive<OwnedChanTarget>, which is what we'll use in errors.
2022-11-23 18:28:38 +00:00
Ian Jackson bbc84bf9f4 safelog: Provide BoxSensitive 2022-11-23 18:28:38 +00:00
Ian Jackson 4f193f1017 safelog: Remove type argument from `impl_display_traits`
We're going to have this same macro implement the same traits for a
second type.  And its function is specific to `Sensitive`, so have it
know that.
2022-11-23 18:28:34 +00:00
Ian Jackson b77fd893a4 safelog: Provide some more accessors
We're about to use `.as_inner()` in a few places, and `.as_ref()` (by
analogy with `Option`) seems obviously necessary.
2022-11-23 18:28:34 +00:00
Ian Jackson 1c085cf401 bridge desc mgr: Add dormancy comment to effective_parallelism
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/861#note_2856922
2022-11-23 18:20:58 +00:00
Ian Jackson 68acedccfd bridge desc mgr: Test dormancy 2022-11-23 18:20:58 +00:00
Ian Jackson e0c4eed549 bridge desc mgr: Honour specified dormancy
Fixes #630
2022-11-23 18:20:58 +00:00
Ian Jackson a33df9a5f5 bridge desc mgr: Introduce effective_parallelism helper 2022-11-23 18:20:58 +00:00
Ian Jackson 2c98351e2d bridge desc mgr: Move set_dormancy to impl that is for mock too 2022-11-23 18:20:58 +00:00
Nick Mathewson ce0f8f41cb Merge branch 'bridge-config-arc' into 'main'
Make BridgeConfig be Arc, so no Arc<BridgeConfig>

Closes #635

See merge request tpo/core/arti!885
2022-11-23 17:52:26 +00:00
Ian Jackson fbd4b88044 Merge branch 'test-config' into 'main'
tor-guardmgr: Fix visibility of TestConfig with no features enabled

See merge request tpo/core/arti!875
2022-11-23 17:51:05 +00:00
Nick Mathewson 4c5a88c925 Merge branch 'matrix-test' into 'main'
maint/matrix_test: Print what command we are running!

See merge request tpo/core/arti!879
2022-11-23 17:50:30 +00:00
Ian Jackson 4d502bd818 arti-client: Add comment about Option DormantMode
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/852#note_2854090
(ftaod, that is a different MR to this one)
2022-11-23 17:50:05 +00:00
Ian Jackson c82cda85d6 tor-basic-utils: DropNotifyWatchSender: use DropNotifyEofSignallable
This will help avoid the programmer making the mistake I made here:
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/852#note_2854029
2022-11-23 17:50:05 +00:00
Nick Mathewson c0a6fb3e0f Merge branch 'stability' into 'main'
arti-client, tor-config: Remove stability warning from top-level docs

See merge request tpo/core/arti!878
2022-11-23 17:50:01 +00:00
Ian Jackson 63a799a118 tor-basic-utils: DropNotifyWatchSender test: introduce I
We do want to test this with a non-Option type, but we are going to
have to wrap it up.
2022-11-23 17:50:01 +00:00
Nick Mathewson e25ed00fd1 Merge branch 'remove_deadcode_allow' into 'main'
guardmgr: Remove a now-unneeded "allow(dead_code)"

See merge request tpo/core/arti!862
2022-11-23 17:45:26 +00:00
Nick Mathewson f60eb449d3 Merge branch 'install_mgr' into 'main'
ChanMgr: Implement the functions needed to install a ChannelFactory and an AbstractPtMgr.

See merge request tpo/core/arti!888
2022-11-23 16:57:10 +00:00
Nick Mathewson 3f5699b95a ChanMgr: Another attempt to build on CI. 2022-11-23 11:25:15 -05:00
Nick Mathewson 74ebc904e3 ChanMgr: Rename Factory -> CompoundFactory 2022-11-23 11:10:34 -05:00
Nick Mathewson 1249bedbb0 ChanMgr: Fix a few more conditional-compilation issues 2022-11-23 11:10:34 -05:00
Nick Mathewson 2fb36f5585 ChanMgr: Remove Arc aliases. 2022-11-23 11:10:34 -05:00
Nick Mathewson f8e103bb94 Mark set-default-factory API as experimental. 2022-11-23 11:10:34 -05:00
Nick Mathewson c04aa9baed Make ChannelFactory and AbstractPtMgr require Send+Sync 2022-11-23 11:10:34 -05:00
Nick Mathewson bc1de60d6d ChanMgr: Implement functions that replace channel factories.
This commit makes it possible to replace the default channel factory
(used when there is no PtMgr), and to replace the PtMgr.

This is part of #659.
2022-11-23 11:10:34 -05:00
Nick Mathewson a688e4afc9 ChanMgr: move the AbstractChanFactory into MgrState.
We will want the freedom to replace this, so it needs to go behind a
lock. We need to be able to Clone it cheaply now, so we're using an
Arc instead of a Box.
2022-11-22 14:41:44 -05:00
Nick Mathewson fc74bb8bb4 Merge branch 'retire_on_guard_cfg_change' into 'main'
CircMgr: retire all circuits if bridge configuration changes.

Closes #650

See merge request tpo/core/arti!880
2022-11-22 19:00:20 +00:00
Nick Mathewson 07599615b9 Merge branch 'abstract-pt-mgr' into 'main'
Replace TransportRegistry with AbstractPtMgr

See merge request tpo/core/arti!887
2022-11-22 18:59:20 +00:00
Nick Mathewson 09092394a8 Merge branch 'main' into 'abstract-pt-mgr'
# Conflicts:
#   crates/tor-chanmgr/src/factory.rs
2022-11-22 18:12:25 +00:00
eta 2f75702cec Replace TransportRegistry with AbstractPtMgr
It doesn't make much sense to have the pluggable transport manager be a
registry, so replace its interface with a more narrowly defined, less generic
version.

Other changes:
- instead of returning a &-reference, it returns an owned Arc, which
  should make the ptmgr easier to implement while allowing efficient
  reuse
- provision for error handling is added, but will probably be revised in
  a future commit pending discussion
- tor-ptmgr code that would generate warnings as a result of this change
  is temporarily removed

This is a split out version of arti!886, intended so work on arti#659
can proceed.
2022-11-22 18:09:06 +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
Ian Jackson 7a082cb8f0 Merge branch 'bridge-transp-parse' into 'main'
Use TransportId FromStr in BridgeConfig parsing

Closes #653

See merge request tpo/core/arti!881
2022-11-22 16:27:43 +00:00
Ian Jackson ee87097dc1 BridgeConfig: Replace all Arc<BridgeConfig> with BridgeConfig
BridgeConfig is itself an Arc now, so these are redundant.
2022-11-22 15:33:21 +00:00
Ian Jackson 3caf7aafc0 BridgeConfig: Make it be a newtype around Arc<Inner>
This leaves the external API of this type unchanged, but now it's much
smaller and quite cheap to clone.
2022-11-22 15:33:21 +00:00
Ian Jackson 5d8d3f79fa bridge config: Remove a done TODO
This was done by !874 and #604 closed accordingly.
2022-11-22 15:08:28 +00:00
Ian Jackson 822a6ce32b TransportId: Fix test case for no pt-target
Fixes

  cargo +stable clippy --manifest-path=/home/ian/Rustup/Arti/arti/Cargo.toml --locked --target-dir=target --offline -p tor-linkspec --no-default-features --all-targets

giving

  446 |             .method(ChannelMethod::Pluggable(PtTarget::new(
      |                                    ^^^^^^^^^ variant or associated item not found in `transport::ChannelMethod`
2022-11-22 14:59:25 +00:00
Ian Jackson 8406474435 bridge config parsing tests: Show expected error message in asssrt 2022-11-22 14:59:25 +00:00