aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
* | proto: Use PeerInfo to log responder channel addrDavid Goulet2026-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Inbound channel (as responder) don't have a ChannelMethod as they are not initiating the type of transport to use (PT vs Direct). It would result in a log line when receiving a channel request: DEBUG tor_proto::channel::handshake: Completed handshake without authentication to [? ] stream_id=Chan 2 This commit uses the `PeerInfo` which is wrapped in a `MaybeSensitive` and thus safe to log. Signed-off-by: David Goulet <[email protected]>
* | Merge branch 'destroyreason' into 'main'gabi-2502026-07-282-3/+3
|\ \ | | | | | | | | | | | | | | | | | | align DestroyReason with torspec!490 Part of #2578 See merge request tpo/core/arti!4202
| * | align DestroyReason with torspec!490ramdoys2026-07-282-3/+3
| | |
* | | tor-proto: build crypt state after building hop settingsSteven Engler2026-07-271-10/+10
| | | | | | | | | | | | | | | | | | `HopSettings::from_handshake_params()` checks that the parameters are correct, so if there are invalid parameters we should fail early before we initialize the `CryptStatePair`.
* | | tor-proto: move where we split 'crypt' in CREATE_FAST handshakeSteven Engler2026-07-271-2/+2
| | | | | | | | | | | | This is just to make ntor and CREATE_FAST handshakes consistent.
* | | tor-proto: add some log messages after circuit handshakeSteven Engler2026-07-271-0/+5
|/ /
* | Merge branch 'clippy' into 'main'opara2026-07-271-1/+1
|\ \ | |/ |/| | | | | Fix some recently-appearing clippy lints See merge request tpo/core/arti!4240
| * tor-proto: Remove a redundant explicit link targetIan Jackson2026-07-271-1/+1
| | | | | | | | Found by rustdoc.
* | tor-proto: add a TODO for crypt protocol and cc alg logicSteven Engler2026-07-271-0/+4
| |
* | tor-proto: add `HandshakeSubprotocols`Steven Engler2026-07-272-9/+49
| | | | | | | | | | | | The advantage of this over using a `SubprotocolRequest` is that we can use the type system to ensure it only has subprotocols that are allowed during a handshake.
* | tor-proto: remove `CircNetParameters::extend_by_ed25519_id`Steven Engler2026-07-273-6/+0
| | | | | | | | | | We never used this, it was just needed because we used to convert to a `CircParameters` which required this.
* | tor-proto: add `HopSettings::from_handshake_params()`Steven Engler2026-07-272-71/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and also remove `CircNetParameters::as_circ_parameters()`. We used to call `HopSettings::from_params_and_caps()` when handling incoming circuit requests, but this didn't really make sense because we already know exactly what settings we want. The new `HopSettings::from_handshake_params()` takes the exact settings we want, which means we can also skip constructing a `CircParameters` and use the raw consensus `CircNetParameters`. Most of the code in `CircNetParameters::as_circ_parameters()` has been migrated in some form to `HopSettings::from_handshake_params()`.
* | tor-proto: require feat 'counter-galois-onion' for 'relay'Steven Engler2026-07-271-0/+1
|/
* Merge branch 'testdata-export' into 'main'Ian Jackson2026-07-271-1/+1
|\ | | | | | | | | tor-netdoc testdata-live: Export for the benefit of other crates See merge request tpo/core/arti!4229
| * Require derive-deftly 1.11.4Ian Jackson2026-07-231-1/+1
| | | | | | | | | | | | | | | | | | We're about to *use* the fix that was in 1.11.4. We already updated the lockfile in !4228, so this is just Cargo.toml changes (which will prevent the minimal-versions tests failing when we change the code to rely on the fix). git-grep -l '^derive-deftly' |xargs perl -i~ -pe 's{\b\Q1.11.3\E\b}{1.11.4}g'
* | proto: Include the actual cell command in an error messageGabriela Moldovan2026-07-231-3/+5
| | | | | | | | | | | | | | This can happen if we get an unexpected BEGIN_DIR/RESOLVE too, so we can't hard-code "BEGIN" in the error message. Context: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4230#note_3439258,
* | proto: Remove feature-gating from CircHop::handle_msg()Gabriela Moldovan2026-07-233-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature-gating has been a source of confusion, and it unnecessarily complicates the stream message handling flow. I've previously argued in favour of keeping it, in the spirit of a belt and braces approach to message validation, but I've been convinced that in this particular case, the feature-gate is more trouble than it's worth. What makes things worse is that the `CircHop::handle_msg()` function was designed poorly (by yours truly). I plan on refactoring it at some point, hopefully soon. There is a TODO about this below its doc comment.
* | tor-checkable: Rename `TimeBound::is_valid_at` to `check_valid_at`Ian Jackson2026-07-231-1/+1
| | | | | | | | | | I find this names confusing. To my mind "is" implies a function returning `bool`.
* | tor-checkable: TimeBound: Make wrapped type an associated typeIan Jackson2026-07-231-3/+3
| | | | | | | | | | It wouldn't make much sense for one concrete type to be unwrappable variously as different inner types.
* | tor-checkable: TimeBound: remove Error associated typeIan Jackson2026-07-231-1/+1
|/ | | | | This was always TimeValidityError. And we want to rely on that so we can do the validity checking more centrally.
* proto: Remove misleading comment about CircuitIncomingStreamReceiverGabriela Moldovan2026-07-221-3/+0
|
* proto: Update CreateRequestHandler::new() docsGabriela Moldovan2026-07-221-1/+2
| | | | | As suggested in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4222#note_3437129
* proto: Reword CircuitIncomingStreamReceiver docs for clarityGabriela Moldovan2026-07-221-1/+2
| | | | Applies @opara's suggested rephrasing.
* proto: Return the incoming streams from the create handler (fmt)Gabriela Moldovan2026-07-221-8/+10
|
* proto: Return the incoming streams from the create handlerGabriela Moldovan2026-07-222-12/+60
| | | | | | | | | | | We need to return the "futures::Stream of Tor streams" from the CREATE handler, because these need to be handled from `arti-relay`, as per `doc/dev/notes/relay-streams.md` This commit is intentionally (slightly) misformatted to make reviewing a bit easier (the next commit will rustfmt everything). Part of #2612
* proto: Add newtype wrapper for incoming stream receiverGabriela Moldovan2026-07-222-2/+43
| | | | | The inner type is an eyesore, and doesn't really need to be exposed outside of tor-proto (we might even replace it at some point).
* proto: Adjust feature-gating around incoming streamsGabriela Moldovan2026-07-221-1/+1
| | | | | This applies to relays too, not just onion services (we need to to handle BEGIN/BEGIN_DIR/RESOLVE).
* Apply deferred rustfmt churnIan Jackson2026-07-161-1/+1
|
* Use new TimeBound name throughout the treeIan Jackson2026-07-161-2/+2
|
* Merge branch 'remove-lint' into 'main'Jim Newsome2026-07-153-6/+1
|\ | | | | | | | | | | | | Removed unnecessary lint Closes #2556 See merge request tpo/core/arti!4210
| * Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-152-2/+0
| |
| * add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
| |
| * lib.rs: remove stale commentJim Newsome2026-07-151-2/+0
| |
| * Removed unnecessary lintpryty262026-07-151-2/+1
| | | | | | | | Removed unnecessary lint
* | Merge branch 'clippy_warning' into 'main'Jim Newsome2026-07-131-1/+1
|\ \ | | | | | | | | | | | | multiple crates: Fix clippy warnings See merge request tpo/core/arti!4203
| * | multiple crates: Fix clippy warningshjrgrn2026-07-101-1/+1
| |/
* | Merge branch 'upgrade-cipher' into 'main'gabi-2502026-07-135-17/+28
|\ \ | |/ |/| | | | | Upgrade cipher, aes, and ctr. See merge request tpo/core/arti!4195
| * Upgrade cipher, aes, and ctr.Nick Mathewson2026-07-135-17/+28
| |
* | hsclient: Support protocol negotiation for CGO and flowctrl-ccNick Mathewson2026-07-021-0/+6
| |
* | proto: Allow HsV3 to use cgo.Nick Mathewson2026-07-021-2/+8
| |
* | proto: Do not automatically disable CC with hsv3.Nick Mathewson2026-07-021-5/+0
| | | | | | | | | | | | | | We _already_ do not include FLOWCTRL_CC as a listed protocol among the capabilities we provide, when we make a virtual hop. This branch will make that behavior even more certain, by not looking at required-client-protocols any longer.
* | proto: log virtual hop additions at trace.Nick Mathewson2026-07-021-0/+2
| | | | | | | | We do something similar with non-virtual hops at !4076.
* | proto: Improve/clarify documentation on extend_virtual.Nick Mathewson2026-07-021-0/+8
| |
* | Merge branch 'stream-msg-parse' into 'main'gabi-2502026-07-022-23/+53
|\ \ | | | | | | | | | | | | | | | | | | proto: Allow BeginDir and Resolve messages in the stream reactor Closes #2613 See merge request tpo/core/arti!4188
| * | proto: Add TODO about the eventual client-side reactor rewriteGabriela Moldovan2026-07-021-0/+10
| | | | | | | | | | | | | | | See https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4188#note_3432579
| * | proto: Re-enable IncomingCmdChecker test (fmt)Gabriela Moldovan2026-07-011-2/+6
| | |
| * | proto: Re-enable IncomingCmdChecker testGabriela Moldovan2026-07-011-14/+7
| | | | | | | | | | | | | | | These assertions no longer fail now that the stream reactor is able to handle non-`BEGIN` streams.
| * | proto: Allow BeginDir and Resolve messages in the stream reactor (fmt)Gabriela Moldovan2026-07-011-1/+3
| | |
| * | proto: Allow BeginDir and Resolve messages in the stream reactorGabriela Moldovan2026-07-011-9/+30
| |/ | | | | | | | | | | | | Previously, these would fail to parse, because the (WIP) stream reactor assumed all streams would be exit (BEGIN) streams. Closes #2613
* / Upgrade to itertools 0.15.0Nick Mathewson2026-07-012-12/+11
|/ | | | | | Additionally, fix itertools usage in maybenot_padding.rs The definition of `Position` changed in 0.15.0.