aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
* | maint: remove semver.md filesSteven Engler2026-08-031-2/+0
| |
* | Bump versions for tor-* and arti-* cratesSteven Engler2026-08-031-23/+23
| | | | | | | | | | | | | | ```bash readarray -t bump < <(maint/list-crates | grep -P '^tor-|^arti-') for crate in "${bump[@]}"; do cargo set-version --bump minor -p "${crate}"; done ```
* | proto: Update semver with the changes to the loggingDavid Goulet2026-08-031-0/+1
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | proto: Move comment to the right placeDavid Goulet2026-08-031-3/+3
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | proto: Add {backward|forward} prefix to circ_id in logsDavid Goulet2026-08-0311-35/+35
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | proto: Rename uniq_id to circ_unique_id mostly in loggingDavid Goulet2026-08-0314-55/+55
| | | | | | | | | | | | | | | | | | We have decided that instead of "uniq_id" in logging, we'll use the "<domaine>-[<type>]-id" syntax to indicate who is that unique ID. This commit only renames circuit's unique ID to "circ_uniq_id". Signed-off-by: David Goulet <[email protected]>
* | proto: Log both UniqId and CircId when possibleDavid Goulet2026-08-0315-65/+216
| | | | | | | | | | | | | | | | | | | | This commit only affects logging. Whenever possible, log both the UniqId and CircId. This also changes the log lines which is now "uniq_id=" and "circ_id=" as the UniqId is internal and circ_id (CircId) is protocol level. Signed-off-by: David Goulet <[email protected]>
* | proto: Rename CircId and UniqId variable nameDavid Goulet2026-08-038-26/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A CircId is now a circ_id and a UniqId is a unique_id so we stop confusing them in the code. Furthermore, channel_id that are CircId are now circ_id. Channel IDs are different and encoded internally into a UniqId. This is the first step to clarify semantic before we change the logging to log both unique ID and circ ID. No behavior change. Signed-off-by: David Goulet <[email protected]>
* | tor-proto: fix XON conversion from KB/s to B/sSteven Engler2026-07-301-4/+4
| | | | | | | | | | We previously interpreted the rate in the XON message as being Kbits per second, but it's really Kbytes per second.
* | tor-cell: update docs and variable names for `Xon`Steven Engler2026-07-302-3/+3
| |
* | tor-cell: rename `XonKbpsEwma` to `XonKBpsEwma`Steven Engler2026-07-3012-37/+37
|/
* Merge branch 'mock-net' into 'main'David Goulet2026-07-302-31/+69
|\ | | | | | | | | tor-proto: Small improvements to circuit handshake tests See merge request tpo/core/arti!4254
| * tor-proto: reuse existing channels in ntor testSteven Engler2026-07-301-8/+5
| | | | | | | | | | Now that we read all of the cells from the connection inspector, we can reuse the existing channel objects.
| * tor-proto: extend circ handshake tests to close the circuitSteven Engler2026-07-302-2/+38
| |
| * tor-proto: rename some methods on test `ConnInspector`Steven Engler2026-07-302-10/+10
| |
| * tor-proto: reword some TODOsSteven Engler2026-07-301-2/+2
| | | | | | | | These TODOs are for client issues, not relay isues.
| * tor-proto: don't drop stream rx in testsSteven Engler2026-07-302-10/+15
| | | | | | | | Otherwise the new circuit gets closed immediately by the relay.
* | Merge branch 'create-fast' into 'main'opara2026-07-303-37/+19
|\ \ | |/ |/| | | | | tor-protover,tor-proto: Add and use a new `subprotocol_restricted_set` macro See merge request tpo/core/arti!4241
| * tor-proto: use `subprotocol_restricted_set` macroSteven Engler2026-07-303-37/+19
| |
* | tor-proto: add unit tests for some circuit handshakesSteven Engler2026-07-291-0/+130
| |
* | tor-proto: add 'test_utils' mod for channel testsSteven Engler2026-07-292-0/+308
| | | | | | | | These help to establish connected channel objects to be used for tests.
* | tor-proto: add test-only `NoOpChannelProvider`Steven Engler2026-07-291-0/+22
| |
* | tor-proto: add test-only `NoOpRequestFilter`Steven Engler2026-07-291-0/+16
| |
* | tor-proto: fix tests when `feature = relay`Steven Engler2026-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | ```text $ cargo test -p tor-proto --features relay [...] error[E0405]: cannot find trait `IncomingStreamRequestFilter` in this scope --> crates/tor-proto/src/circuit/reactor.rs:631:10 | 631 | impl IncomingStreamRequestFilter for AllowAllStreamsFilter { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope ```
* | 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).