aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src/transport
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-092-0/+2
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* tor-rtcompat+misc: add `NetStreamProvider::ConnectOptions`Steven Engler2026-06-082-2/+6
| | | | | | | | | This adds the trait type `ConnectOptions` to `NetStreamProvider` and adds this `ConnectOptions` as an argument to `NetStreamProvider::connect()`. You probably want to look at the changes in tor-rtcompat first, then the rest of this commit is updating the various places we use `NetStreamProvider`.
* tor-chanmgr: fix `unused_imports` warningSteven Engler2026-05-271-1/+3
|
* Merge branch 'socket-buf-size' into 'main'opara2026-05-211-2/+14
|\ | | | | | | | | | | | | Set socket buffer sizes (`SO_SNDBUF` and `SO_RCVBUF`) for proxy sockets Closes #2500 See merge request tpo/core/arti!3957
| * tor-rtcompat+misc: add `NetStreamProvider::ListenOptions`Steven Engler2026-05-071-2/+14
| | | | | | | | | | | | | | | | | | This adds the trait type `ListenOptions` to `NetStreamProvider` and adds this `ListenOptions` as an argument to `NetStreamProvider::listen()`. You probably want to look at the changes in tor-rtcompat first, then the rest of this commit is updating the various places we use `NetStreamProvider`.
* | chanmgr: report target address, not proxy address, in errorNick Mathewson2026-05-072-3/+6
| | | | | | | | | | | | Also, change the address type in the error to String for now. In reality we need a better representation of this error, but that shouldn't block this.
* | chanmgr: refactor error typesNick Mathewson2026-05-072-3/+9
| | | | | | | | | | Proxy belonged as a subcase of ChannelBuild. And ChannelBuild was only about making an initial connection.
* | chanmgr: Do not turn connect errors into proxy errors.Nick Mathewson2026-05-071-14/+9
|/ | | | | | | This fixes the problem where we'd report all connect failures as proxy failures. Closes #2459.
* tor-chanmgr: don't `warn_report!` for failed connectionsSteven Engler2026-03-241-1/+0
| | | | | | | | | | | | | | | | | | | | `warn_report!` is useful when there's an error that we need to ignore and can't propagate up the call stack. But here we're using `warn_report!` while also returning the error in a `Error::ChannelBuild`. This is not great because: 1. The caller should warn if it wants to, since it will have the error message and the proper context. 2. This code is doing something like happy eyeballs, which means we only care that one connection succeeds, not if any fail. One instance where this is problematic is when running Arti on a machine without IPv6 support. If connecting to a relay with both an IPv4 and IPv6 address, the IPv6 attempt will always fail. We don't want to warn about every outgoing IPv6 connection failure when the IPv4 connection succeeds.
* tor-chanmgr: add loopback validation, startup warning and httparseNihal2026-03-182-103/+120
|
* tor-chanmgr: split handshake into helper functionsNihal2026-03-181-14/+47
|
* tor-chanmgr: fix type inference in handshakeNihal2026-03-182-6/+6
|
* tor-chanmgr: refactor handshake into helper functionsNihal2026-03-181-30/+53
|
* tor-chanmgr: implement HTTP CONNECT proxy handshake and wire transportNihal2026-03-182-20/+186
|
* proto: Use the PeerAddr accross channel handshakeDavid Goulet2026-02-192-16/+9
| | | | | | | This is a large change but it is basically using PeerAddr in the channel builder through the channel handshake code and into the Channel itself. Signed-off-by: David Goulet <[email protected]>
* tor-chanmgr: fix proxy config parsing and clippy lintNihal2026-02-161-1/+1
|
* tor-chanmgr: remove SocketAddr and improve errorNihal2026-02-162-22/+15
|
* tor-chanmgr: add URI-style parsing for ProxyProtocol outbound_proxy configNihal2026-02-161-8/+21
|
* tor-chanmgr: integrate outbound proxy into DefaultTransportNihal2026-02-161-13/+39
|
* tor-chanmgr: add From<ProxyError> for io::Error conversionNihal2026-02-161-0/+6
|
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-041-2/+0
| | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-0/+1
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-062-2/+2
| | | | Run maint/add_warning
* opentelemetry: Add some instrument macros.Wesley Aptekar-Cassels2025-09-241-1/+2
| | | | | I've added these in places that are useful for the debugging that I've been doing.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-072-13/+10
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-socksproto: Handle 0-byte reads (EOF) correctlyIan Jackson2024-10-011-1/+1
| | | | | | | This restores the functionality of socks users: detect closed sockets. 0c595818f713916d94b7b0e4062f953fad7c9799 which we reverted as part of rebasing this branch onto main.
* tor-chanmgr: Use new tor-socksproto API (fmt)Ian Jackson2024-10-011-2/+1
|
* tor-chanmgr: Use new tor-socksproto APIIan Jackson2024-10-011-56/+16
|
* Apply deferred rustfmt churnIan Jackson2024-10-011-3/+2
|
* tor-socksproto: Move `handshake` to be a trait methodIan Jackson2024-10-011-0/+1
| | | | | | | | | | | This deduplicates some docs and eliminates the two wrapper functiosn for `run_handshake`, which is now just `handshake`. We're going to make other API breaks too, and this isn't going to be the primary API, so we might as well do this. Proper description of the semver breakage will come at the end when it's all done.
* Revert "socks users: detect closed sockets."Ian Jackson2024-10-011-11/+1
| | | | This reverts commit 0c595818f713916d94b7b0e4062f953fad7c9799.
* Revert "socks users: copy the correct amount in our drain logic."Ian Jackson2024-10-011-1/+1
| | | | This reverts commit dceeb82f7d1154894ab9c7c607d68f8335bb9615.
* socks users: copy the correct amount in our drain logic.Nick Mathewson2024-09-241-1/+1
| | | | | | | | When calling copy_within, we want to copy the amount of data that we're keeping; previously, we were copying an extra `action.drain` bytes, which could have led to a panic. Spotted by Opara.
* socks users: detect closed sockets.Nick Mathewson2024-09-241-1/+11
| | | | | | | | | Without this check, our socks code can enter an infinite loop if a socket is closed at the wrong time. Resolves TROVE-2024-011. Fixes #1635.
* rtcompat: Rename TcpProvider to NetStreamProvider.Nick Mathewson2024-09-242-10/+10
| | | | | | | | | | | | | | (And similarly rename TcpListener to NetStreamListener, along with their TcpStream/TcpListener associated types.) These types are about to become generic over addresses, and therefore shouldn't be named after TCP. Renaming was done mostly with Rust Analyzer, except for some macros that needed to be hand-edited. (I'll revise the comments in the next commit; this one is all about renaming.)
* socksproto: Add a const for suggested buffer length.Nick Mathewson2024-09-091-1/+2
| | | | | Ticket #1509 will probably get rid of this constant, but for now we may as well put it in one place.
* Run maint/add_warning.Nick Mathewson2024-03-132-0/+2
|
* Add initial support for running a PT in server modeSaksham Mittal2023-08-241-2/+2
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-232-0/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-102-0/+2
|
* Throughout: Use *_report!() macros for reporting Errors.Nick Mathewson2023-07-071-2/+2
| | | | | | | | | | | | | | | I identified the cases to replace by searching for the string `.report()`. There are a few that I didn't change: * A couple of cases that used anyhow::Error, * One case that reported two Errors. * Two cases in `tor_hsclient::err` that just did `error!("Bug: {}")`. I have also not audited the cases in `tor-hsclient` where we're using `tor_error::Report` manually. Nonetheless, closes #949.
* Fix a local-only CPU DoS bug.Nick Mathewson2023-05-231-0/+15
| | | | | | | | | | | | | | | | | | Previously, there was a bug in the way that our code used our SOCKS implementations. If the buffer used for a SOCKS handshake became full without completing the handshake, then rather than expanding the buffer or closing the connection, our code would keep trying to read into the zero-byte slice available in the full buffer forever, in a tight loop. We're classifying this as a LOW-severity issue, since it is only exploitable by pluggable transports (which are trusted) and by local applications with access to the SOCKS port. Closes #861. Fixes TROVE-2023-001. Reported-By: Jakob Lell <jakob AT srlabs DOT de>
* s/ProtocolFailed/ProtocolViolation/g where possibleNeel Chauhan2023-04-081-1/+1
|
* Use ErrorReport for errors in warn! in tor-chanmgrIan Jackson2023-01-301-2/+2
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-272-0/+2
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* chanmgr: trace-level logs when launching connections.Nick Mathewson2023-01-062-0/+15
| | | | Based on more temporary debugging code. Yet another part of #677.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* Rename TransportHelper => TransportImplHelper.Nick Mathewson2022-11-302-3/+3
|
* Merge branch 'bridge-addr-2' into 'main'Nick Mathewson2022-11-301-5/+5
|\ | | | | | | | | Separate BridgeAddr and PtTargetAddr See merge request tpo/core/arti!904
| * Separate BridgeAddr and PtTargetAddrIan Jackson2022-11-301-5/+5
| | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/issues/668#note_2858220 This commit is difficult to split up. The innards of BridgeAddr and PtTargetAddr are still a bit entangled.