aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-socksproto/src/handshake
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-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.
* Fix typosTobias Stoeckmann2026-03-241-1/+1
| | | | Typos found with codespell
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-062-2/+2
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-072-6/+6
| | | | | | | | | | | | | | 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.
* socksproto: Grammar fix in comment.Nick Mathewson2025-07-091-1/+1
|
* Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-091-2/+2
| | | | Made with https://crates.io/crates/typos-cli
* fix `clippy::unneeded_struct_pattern`Steven Engler2025-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | Example: ```text warning: struct pattern is not needed for a unit variant --> crates/hashx/src/program.rs:165:32 | 165 | Instruction::Target { .. } => Opcode::Target, | ^^^^^^^ help: remove the struct pattern | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern note: the lint level is defined here --> crates/hashx/src/lib.rs:9:9 | 9 | #![warn(clippy::all)] | ^^^^^^^^^^^ = note: `#[warn(clippy::unneeded_struct_pattern)]` implied by `#[warn(clippy::all)]` ```
* fix `clippy::doc_overindented_list_items`Steven Engler2025-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | Example: ```text warning: doc list item overindented --> crates/arti-rpc-client-core/src/conn/connimpl.rs:322:9 | 322 | /// indicates that no more messages will be received for this request. | ^^^ help: try using ` ` (2 spaces) | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items note: the lint level is defined here --> crates/arti-rpc-client-core/src/lib.rs:8:9 | 8 | #![warn(clippy::all)] | ^^^^^^^^^^^ = note: `#[warn(clippy::doc_overindented_list_items)]` implied by `#[warn(clippy::all)]` ```
* fix: fix typosDimitris Apostolou2025-01-061-2/+2
|
* tor-socksproto: Handle 0-byte reads (EOF) correctly (fmt)Ian Jackson2024-10-011-1/+3
|
* tor-socksproto: Handle 0-byte reads (EOF) correctlyIan Jackson2024-10-011-3/+13
| | | | | | | This restores the functionality of socks users: detect closed sockets. 0c595818f713916d94b7b0e4062f953fad7c9799 which we reverted as part of rebasing this branch onto main.
* fixup! tor-socksproto: Fix doc comment for new_preciseIan Jackson2024-10-011-6/+3
|
* tor-socksproto: Fix doc comment for ReadPrecisionIan Jackson2024-10-011-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2436#note_3081884
* tor-socksproto: Fix doc comment for new_preciseIan Jackson2024-10-011-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2436#note_3081885
* tor-socksproto: Code motion to tidy upIan Jackson2024-10-012-31/+25
|
* tor-socksproto: Deprecate old APIIan Jackson2024-10-013-5/+11
|
* tor-socksproto: Introduce handshake_for_tests method (fmt)Ian Jackson2024-10-012-4/+16
|
* tor-socksproto: Introduce handshake_for_tests methodIan Jackson2024-10-013-32/+40
|
* tor-socksproto: Introduce into_output_forbid_pipeliningIan Jackson2024-10-011-0/+14
|
* tor-socksproto: Introduce new API (fmt)Ian Jackson2024-10-011-1/+1
|
* tor-socksproto: Introduce new APIIan Jackson2024-10-011-3/+426
|
* tor-socksproto: Add HasHandshakeOutputIan Jackson2024-10-013-1/+37
| | | | Our new API implementation will need this.
* Apply deferred rustfmt churnIan Jackson2024-10-013-22/+15
|
* tor-socksproto: Introduce HandshakeImpl::call_handshake_implIan Jackson2024-10-011-6/+27
| | | | This will support both the new and old API.
* tor-socksproto: Make NextStepImpl an enum (tidy)Ian Jackson2024-10-012-8/+4
| | | | | 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-013-32/+35
| | | | | | | | 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-013-39/+45
| | | | | | | | | | | | | 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-013-41/+29
| | | | | | | | | | | 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-012-4/+4
| | | | | | 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-013-30/+21
| | | | | | | | | | | | | 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-013-28/+123
| | | | | | | | | | | 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-socksproto: Use .is_empty() in some testsIan Jackson2024-10-011-4/+4
| | | | | | | | | Type inference seems fragile when comparing with empty slices. Here's a ticket I filed where an earlier version of the tor-socksproto API branch triggered this problem: https://github.com/rust-lang/rust/issues/130480 The latest version seems to trigger it too.
* tor-bytes: Rename Truncated to Incomplete, and restore old Truncated as ↵Ian Jackson2024-09-112-2/+8
| | | | | | | | | 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-112-8/+8
| | | | | | | 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-102-2/+2
| | | | This will allow us to fix #1592, but it doesn't do so yet.
* Run maint/add_warning.Nick Mathewson2024-03-132-0/+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
|
* 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-272-0/+2
| | | | | 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.
* test lint blocks: Standardise one in tor-socksprotoIan Jackson2022-12-121-2/+2
| | | | | The previous syntax was recognised by the real script, but not by the ad-hoc script I'm about to use to add all the missing ones.
* Allow "clippy::single_char_pattern" in tests.Ian Jackson2022-10-121-0/+1
| | | | | | | This lint exists for perf reasons, and this is rarely relevant in tests. Using double quoted str is generally cognitively less burdensome.
* Move generate_* methods in socks client impl.Nick Mathewson2022-10-031-34/+38
|
* Tweak "handshake" docs.Nick Mathewson2022-10-032-4/+12
| | | | | Per a suggestion from Diziet, clarify that the socks handshake code only wants you to drain your buffers when it tells you to.
* Add a SocksReply type to capture address/port information.Nick Mathewson2022-10-031-18/+35
| | | | | I don't expect us to need this information much, but we may as well hang on to it.
* Tests for socks client handshake.Nick Mathewson2022-10-031-0/+152
| | | | | | These tests include a few reference cases, as well as a little framework to make sure that the client and the proxy implementation will handshake with one another successfully.