summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge branch 'more_netdoc_tests' into 'main'Ian Jackson2022-11-296-36/+323
|\ \ \ | |_|/ |/| | | | | | | | tor-netdoc: More tests for routerdesc accessors and parsing. See merge request tpo/core/arti!870
| * | netdoc: Add a test for routerdesc family parsing.Nick Mathewson2022-11-171-0/+9
| | |
| * | netdoc: Correct and test some tricky routerdesc errorsNick Mathewson2022-11-175-2/+247
| | | | | | | | | | | | These required hex-editing identity certificates :P
| * | netdoc: Add tests for routerdesc accessors.Nick Mathewson2022-11-171-1/+31
| | |
| * | Netdoc: use a different desc in tests.Nick Mathewson2022-11-172-34/+37
| | | | | | | | | | | | This is from Akka, which ahf runs.
* | | Merge branch 'ptmgr-draft' into 'main'Nick Mathewson2022-11-2814-125/+434
|\ \ \ | |_|/ |/| | | | | | | | Pluggable transport manager See merge request tpo/core/arti!886
| * | tor-chanmgr: Introduce the BootstrapReporter API, publicize ChanBuildereta2022-11-286-41/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
| * | Draft: Pluggable transport managereta2022-11-289-84/+323
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | Merge branch 'chanmethod-non-exhaustive' into 'main'Nick Mathewson2022-11-275-2/+35
|\ \ | | | | | | | | | | | | Make ChannelMethod non-exhaustive See merge request tpo/core/arti!891
| * | Make ChannelMethod non-exhaustiveIan Jackson2022-11-245-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enums with variants conditional on cargo features must be non-exhaustive, because cargo features are supposed to be additive, meaning that enabling a feature (which might happen due to some random distant thing) ought not to break things using that enum. There were surprisingly few places to fix this.
* | | Merge branch 'reconfig-bridges-bad' into 'main'Nick Mathewson2022-11-275-13/+78
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Require state ownership when using bridges Closes #612 See merge request tpo/core/arti!889
| * | | tor-guardmgr: rustfmt for recent changesIan Jackson2022-11-242-5/+6
| | | | | | | | | | | | | | | | Left unsquashed for ease of review
| * | | tor-guardmgr: NoLock error: add TODO for trying to get lockIan Jackson2022-11-241-0/+2
| | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856874
| * | | tor-config: Rename to ReconfigureError::UnsupportedSituationIan Jackson2022-11-243-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Unsupported. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873 This was added in this MR. Also add the missing semver note.
| * | | tor-config: Rename to ConfigBuildError::NoCompileTimeSupportIan Jackson2022-11-243-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Unsupported. Following one of the suggestions here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873 This was added in 2c3711614908d0c9cf1663b20b67a3fc233301f4 which was not yet in a release so this isn't a semver break. I have added the semver note that was omitted in that MR.
| * | | tor-guardmgr: Refuse to configure bridges if we don't have the lockIan Jackson2022-11-233-1/+29
| | | | | | | | | | | | | | | | Fixes #612
| * | | tor-guardmgr: make replace_bridge_config fallibleIan Jackson2022-11-232-7/+38
| | | | | | | | | | | | | | | | | | | | | | | | The error type needs to be convertible to GuardMgrError and also to ReconfigureError. Neither of those is right, so we need a new error type.
| * | | tor-guardmgr: Replace a let _ignore with a typed versionIan Jackson2022-11-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `let _ignore =` isn't great because if the function called is currently infallible, but becomes fallible, it suppresses the detection of the error check. A better pattern is to specify the type of the ignored value. I'm about to do precisely this, here. I did a git-grep and `let _ignore =` seems very common. Let's not deal with all those now.
* | | | Merge branch 'rustls-0.20' into 'main'Nick Mathewson2022-11-273-66/+47
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rustls 0.20 Closes #305 See merge request tpo/core/arti!821
| * | | | fix deprecation warnings from rustlstrinity-1686a2022-11-261-9/+7
| | | | |
| * | | | upgrade rustls to 0.20, ignoring all deprecation warningstrinity-1686a2022-11-263-60/+43
|/ / / /
* | | | Merge branch 'restore_nightly' into 'main'Ian Jackson2022-11-241-3/+7
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | Switch CI back to nightly. Closes #633 See merge request tpo/core/arti!884
| * | | Switch CI back to nightly.Nick Mathewson2022-11-241-3/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'sensitive-error' into 'main'Ian Jackson2022-11-2311-31/+115
|\ \ \ | | | | | | | | | | | | | | | | Scrub channel target information in errors See merge request tpo/core/arti!890
| * | | tor-dirclient: Replace OwnedChanTarget with LoggedChanTarget in SourceInfoIan Jackson2022-11-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | tor-cirmgr: Replace OwnedChanTarget with LoggedChanTarget in errorsIan Jackson2022-11-232-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | tor-chanmgr: Invent [Box]ChanSensitive for two error payloadsIan Jackson2022-11-233-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | tor-chanmgr: Replace OwnedChanTarget with LoggedChanTarget in errorsIan Jackson2022-11-232-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | tor-linkspec: Provide LoggedChanTarget type alias and utility methodIan Jackson2022-11-234-2/+15
| | | | | | | | | | | | | | | | | | | | This makes it easy to talk about, and construct, a BoxSensitive<OwnedChanTarget>, which is what we'll use in errors.
| * | | safelog: Provide BoxSensitiveIan Jackson2022-11-231-0/+47
| | | |
| * | | safelog: Remove type argument from `impl_display_traits`Ian Jackson2022-11-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | safelog: Provide some more accessorsIan Jackson2022-11-231-0/+15
| | | | | | | | | | | | | | | | | | | | We're about to use `.as_inner()` in a few places, and `.as_ref()` (by analogy with `Option`) seems obviously necessary.
* | | | Merge branch 'bdm-dormant' into 'main'Ian Jackson2022-11-232-13/+71
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bridge desc mgr: Honour specified dormancy Closes #630 See merge request tpo/core/arti!861
| * | | | bridge desc mgr: Add dormancy comment to effective_parallelismIan Jackson2022-11-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/861#note_2856922
| * | | | bridge desc mgr: Test dormancyIan Jackson2022-11-231-0/+42
| | | | |
| * | | | bridge desc mgr: Honour specified dormancyIan Jackson2022-11-231-6/+13
| | | | | | | | | | | | | | | | | | | | Fixes #630
| * | | | bridge desc mgr: Introduce effective_parallelism helperIan Jackson2022-11-231-5/+12
| | | | |
| * | | | bridge desc mgr: Move set_dormancy to impl that is for mock tooIan Jackson2022-11-231-6/+6
| |/ / /
* | | | Merge branch 'watch-drop-option' into 'main'Ian Jackson2022-11-233-13/+50
|\ \ \ \ | |/ / / |/| | | | | | | | | | | tor-basic-utils: DropNotifyWatchSender: use DropNotifyEofSignallable See merge request tpo/core/arti!853
| * | | arti-client: Add comment about Option DormantModeIan Jackson2022-11-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/852#note_2854090 (ftaod, that is a different MR to this one)
| * | | tor-basic-utils: DropNotifyWatchSender: use DropNotifyEofSignallableIan Jackson2022-11-232-7/+38
| | | | | | | | | | | | | | | | | | | | This will help avoid the programmer making the mistake I made here: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/852#note_2854029
| * | | tor-basic-utils: DropNotifyWatchSender test: introduce IIan Jackson2022-11-231-6/+9
| |/ / | | | | | | | | | | | | We do want to test this with a non-Option type, but we are going to have to wrap it up.
* | | Merge branch 'bridge-config-arc' into 'main'Nick Mathewson2022-11-235-34/+47
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Make BridgeConfig be Arc, so no Arc<BridgeConfig> Closes #635 See merge request tpo/core/arti!885
| * | | BridgeConfig: Replace all Arc<BridgeConfig> with BridgeConfigIan Jackson2022-11-224-12/+7
| | | | | | | | | | | | | | | | BridgeConfig is itself an Arc now, so these are redundant.
| * | | BridgeConfig: Make it be a newtype around Arc<Inner>Ian Jackson2022-11-221-21/+40
| | | | | | | | | | | | | | | | | | | | This leaves the external API of this type unchanged, but now it's much smaller and quite cheap to clone.
| * | | bridge config: Remove a done TODOIan Jackson2022-11-221-1/+0
| | | | | | | | | | | | | | | | This was done by !874 and #604 closed accordingly.
* | | | Merge branch 'test-config' into 'main'Ian Jackson2022-11-233-3/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | tor-guardmgr: Fix visibility of TestConfig with no features enabled See merge request tpo/core/arti!875
| * | | | fixup! tor-guardmgr: Fix visibility of TestConfig with no features enabledIan Jackson2022-11-181-1/+1
| | | | |
| * | | | tor-guardmgr: Fix visibility of TestConfig with no features enabledIan Jackson2022-11-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Without this, tor-guardmgr tests don't build when run without the crate's own testing feature enabled.
* | | | | Merge branch 'matrix-test' into 'main'Nick Mathewson2022-11-231-0/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | maint/matrix_test: Print what command we are running! See merge request tpo/core/arti!879