aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-socksproto/src/handshake/proxy.rs
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'ci-test' into 'main'Nick Mathewson2026-06-171-3/+45
|\ | | | | | | | | Added ipv6 and hostname support for reply for socks5 See merge request tpo/core/arti!4063
| * sockproto: Tighten match and clean comments.Nick Mathewson2026-06-171-12/+6
| |
| * Added ipv6 and hostname support for reply for sockspryty262026-06-111-3/+51
| |
* | maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
|/ | | | | | | | | | | | 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.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* tor-socksproto: Code motion to tidy upIan Jackson2024-10-011-12/+9
|
* tor-socksproto: Deprecate old APIIan Jackson2024-10-011-4/+6
|
* tor-socksproto: Introduce handshake_for_tests method (fmt)Ian Jackson2024-10-011-2/+8
|
* tor-socksproto: Introduce handshake_for_tests methodIan Jackson2024-10-011-21/+21
|
* tor-socksproto: Add HasHandshakeOutputIan Jackson2024-10-011-0/+1
| | | | Our new API implementation will need this.
* Apply deferred rustfmt churnIan Jackson2024-10-011-3/+1
|
* tor-socksproto: Make NextStepImpl an enum (tidy)Ian Jackson2024-10-011-4/+2
| | | | | Remove redundant {} from construction of NextStepImpl::Finished. (We kept these in the previous commit to reduce the size of the diff there.)
* tor-socksproto: Make NextStepImpl an enumIan Jackson2024-10-011-10/+4
| | | | | | | | We never say both "finished" and "reply". Make this explicit. Our new caller API is going to depend on this. Also, notice if the implementation's behaviour implies an infinite loop, and call that an internal error instead.
* tor-socksproto: Introduce NextStepImpl and do drain centrallyIan Jackson2024-10-011-16/+12
| | | | | | | | | | | | | This separates the public API from the internal API, which will allow us to do more work centrally, and defend against various bugs on both sides. The name mirrors a new `NestStep` type we'll introduce as part of a new caller API. For now, we make only one centralisation change: Action.drain is now computed centrally rather than ad-hoc in each protocol implementation branch.
* tor-socksproto: Move `handshake` to be a trait methodIan Jackson2024-10-011-20/+4
| | | | | | | | | | | 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.
* tor-socksproto: Adjust description of `handshake`Ian Jackson2024-10-011-2/+2
| | | | | | Speak of "peer" rather than being specific. Also, fix a copypaste mistake: `SocksClientHandshake::handshake`'s doc says it's about `SocksProxyHandshake`. Instead just speak of the "handshake".
* tor-socksproto: Factor out reader constructionIan Jackson2024-10-011-17/+8
| | | | | | | | | | | | | Code flow changes: * We always construct the Reader, even on paths where we didn't previously. That's fine because it's infallible and has no side effects. * In proxy.rs, the quirk with `input[0]` has gone away. We can use the supplied `Reader` and peek the first byte. No overall functional change.
* tor-socksproto: Factor out return value handlingIan Jackson2024-10-011-13/+16
| | | | | | | | | | | This centralises the handling of return values, and paves the way for further deduplication. (The two return paragraphs were identical.) There's quite a lot of initial API surface to framework.rs. Some of that is going to be hidden, but we're also going to extend this to do more work. No functional change.
* tor-bytes: Rename Truncated to Incomplete, and restore old Truncated as ↵Ian Jackson2024-09-111-1/+4
| | | | | | | | | deprecated Incomplete is a better name. This lets us use Truncated for the old, deprecated, conflation of "Incomplete" with what is now "MissingData".
* tor-bytes: Add a Reader constructor for tor-socksproto's use caseIan Jackson2024-09-111-4/+4
| | | | | | | Here we add the constructor, and document it, and change the call sites. No functional change yet.
* tor-bytes: Add a deficit field to Error::TruncatedIan Jackson2024-09-101-1/+1
| | | | This will allow us to fix #1592, but it doesn't do so yet.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Change tor_bytes::Error::BadMessage to a Cow.Nick Mathewson2023-02-091-1/+1
| | | | | | | | | | Actually, to avoid making a breaking change, I'm deprecating BadMessage and creating a new InvalidMessage variant that takes a Cow. This way I don't need to track every crate that re-exposes tor_bytes::Error and call this a breaking change in those. Making this change will allow tor_bytes errors to be much more helpful.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* 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.
* Tweak "handshake" docs.Nick Mathewson2022-10-031-2/+6
| | | | | Per a suggestion from Diziet, clarify that the socks handshake code only wants you to drain your buffers when it tells you to.
* Bug fix: report empty SOCKS4 auth as "no auth".Nick Mathewson2022-10-031-2/+6
| | | | | Previously we would report it as authenticating using the empty string.
* Implement client-side SOCKS handshakeNick Mathewson2022-09-281-6/+1
|
* socksproto: Rename SocksHandshake to SocksProxyHandshake.Nick Mathewson2022-09-271-0/+523
Retain "SocksHandshake" as a deprecated synonym. Also, make an (on-by-default) feature for SocksProxyHandshake. (There is about to be a SocksClientHandshake as well.)