aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src/transport
Commit message (Collapse)AuthorAgeFilesLines
...
* | PT protocol: pt-spec conformance with password fieldNick Mathewson2022-11-301-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | pt-spec says: ``` If the encoded argument list is less than 255 bytes in length, the "PLEN" field must be set to "1" and the "PASSWD" field must contain a single NUL character. ``` This is a very silly thing to say, but some PTs enforce it. Fixes #676.
* | connect_via_proxy: Actually send initial handshake.Nick Mathewson2022-11-301-3/+3
| | | | | | | | | | | | | | Our previous code would make a TCP connection to the proxy, then wait forever for it to say something. Whoops! Part of a fix for #676.
* | PT SOCKS tests: add a few more testsIan Jackson2022-11-301-1/+6
| |
* | PT SOCKS tests: test name that only fits in V4Ian Jackson2022-11-301-3/+7
|/
* Merge branch 'todos-chanmgr' into 'main'Nick Mathewson2022-11-291-5/+11
|\ | | | | | | | | chanmgr: resolve several remaining "TODO pt-client" issues See merge request tpo/core/arti!897
| * chanmgr: Distinguish failure to connect to proxy from other IO failuresNick Mathewson2022-11-291-5/+11
| |
* | Remove deprecated aliases in tor-linkspec.Nick Mathewson2022-11-291-5/+5
|/
* Draft: Pluggable transport managereta2022-11-281-13/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* Make ChannelMethod non-exhaustiveIan Jackson2022-11-241-0/+6
| | | | | | | | | 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.
* tor-chanmgr: Invent [Box]ChanSensitive for two error payloadsIan Jackson2022-11-231-1/+4
| | | | | | | | | | | 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.
* Merge branch 'guards_as_bridges_part1' into 'main'Nick Mathewson2022-10-241-4/+2
|\ | | | | | | | | Allow GuardMgr to expose bridges as guards (part 1) See merge request tpo/core/arti!785
| * guardmgr: Refactor the interior of FirstHop.Nick Mathewson2022-10-241-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Now it contains either an `OwnedChanTarget` or an `OwnedCircTarget`, which will let `GuardMgr` return bridges that can be used to make circuits. As part of this change, it was necessary to revise some address-modification functions that applied to filters and `OwnedChanTarget`. Now they do the smart thing, and remove only the address that are in the `ChanMethod`. This means that the addresses from HasAddrs are still accurate about which addresses the relay "has".
* | tor-chanmgr: Suppress an unused imports warning for `use super::*`Ian Jackson2022-10-211-0/+1
|/ | | | | If pt-client is disabled, there are in fact no tests, so the module is empty. But we would always want `use super::*` here.
* Oops: Mark some imports as pt-client only.Nick Mathewson2022-10-211-3/+9
| | | | This causes CI problems, and is entirely my fault.
* transport: Escape = signs in keys only.Nick Mathewson2022-10-201-8/+13
| | | | | | | This is a compromise between C tor (never escapes = signs) and the spec (calls for escaping all = signs). In C tor there is no way to actually construct a key with an = sign in it, so this difference should be undetectable.
* Clarify comment on ExternalProxyPlugin.Nick Mathewson2022-10-201-1/+2
|
* transport: rename "ExtraneousData" to "UnexpectedData"Nick Mathewson2022-10-201-5/+5
|
* chanmgr: Add the code necessary to use SOCKS PTs via a TransportHelperNick Mathewson2022-10-201-3/+237
| | | | | This is mostly a matter of encoding parameters in the format used for socks authentication.
* chanmgr: Begin a socks-client implementation.Nick Mathewson2022-10-201-0/+215
| | | | | | | This code is _not_ conditional, since we want to support running with a proxy even if we don't support pluggable transports. We may eventually want to refactor this into a new create.
* ChanMgr: Reorganize factory, builder, transport code.Nick Mathewson2022-10-131-0/+228
There is no actual code change here: just movement.