aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
* | ./maint/cargo_sort: Run cargo-sort on the entire workspace.Gabriela Moldovan2025-05-271-2/+11
|/ | | | | | | | | | | | | | | | | | | The [latest version] of `cargo-sort` is more opinionated than the previous one, and is now causing the `rust-checks` job to fail on `main`. This commit applies the fixes needed to satisfy the new `cargo-sort` rules. These changes were generated by running `cargo sort --workspace` several times, until `cargo sort --check --workspace` finally succeeded (it couldn't fix all the errors in one go, for some reason). I have omitted the changes `cargo-sort` made to the top-level `Cargo.toml`, to preserve the topological ordering of the workspace members. Closes #2014 [latest version]: https://github.com/DevinR528/cargo-sort/blob/f066ae80e5e6f5c1d8f0e2b8099461dcb97d9656/changelog.md#200
* Merge branch 'extend_ntor-fix' into 'main'Nick Mathewson2025-05-211-1/+1
|\ | | | | | | | | | | | | tor-proto: Prevent sink and rx from being dropped in-place. Closes #2005 See merge request tpo/core/arti!3005
| * tor-proto: Prevent sink and rx from being dropped in-place.Gabriela Moldovan2025-05-201-1/+1
| | | | | | | | | | | | | | | | | | This was supposed to be fixed in 164d6b4d6c5, but that change failed to bind `sink` and `rx in `futures::join!`, causing `sink` and `rx` to get dropped, which would, in turn, cause the channel and circuit reactors to shut down, sometimes leading to intermittent failures (#2005). Closes #2005
* | tor-proto: Add TODO about multipath rend circuits.Gabriela Moldovan2025-05-201-0/+6
| |
* | tor-proto: Clarify that we need HopLocation, not TargetHop.Gabriela Moldovan2025-05-201-2/+2
| | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3002#note_3200935
* | tor-proto: Remove now-unused ConfluxSet::legs().Gabriela Moldovan2025-05-201-5/+0
| |
* | Revert "tor-proto: add a non-pub `ClientCirc::legs()` method"Gabriela Moldovan2025-05-202-32/+4
| | | | | | | | | | | | | | | | This reverts commit c2d9ea952b4dcb91d05ee754e8d1a6ec6a0689b2. `QueryLegs` is now unused. We also decided we won't need it for implementing `Tunnel::path_ref()` as we are keeping the `MutableState` between `ClientCirc` and the reactor (see !2996).
* | tor-proto: Remove multi-path check from allow_stream_requests() (fmt).Gabriela Moldovan2025-05-201-1/+8
| |
* | tor-proto: Remove multi-path check from allow_stream_requests().Gabriela Moldovan2025-05-203-23/+35
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, `ClientCirc:allow_stream_requests()` would return an error when called on a multi-path tunnel. My main reason for removing the conflux set length check is because it enables us to remove the `QueryLegs` control command (which is something we were planning on doing anyway). Note that now that we've removed `ClientCirc::legs(), there's no way for a multi-path `ClientCirc` to access its circuit legs, but that is fine, because it's currently impossible to build multi-path `ClientCirc`s in arti anyway. This issue will be addressed in the fork, in the new `ClientTunnel` type that will be used for multi-path tunnels (a `ClientCirc` will only ever be single-path, so it won't need to have a `legs()` function at all). I am also removing the `TODO(conflux)` that justifies the now-removed check, because it's outdated (nowadays the `CellHandlers` are shared between the tunnel reactor and its circuits). That said, we *still* don't support onion service conflux, but that will be tackled separately because there are a bunch of issues that still need to be resolved to make it work (which I'll document separately). Note that I've also made some changes to pass the `LegId` of the circuit that received the incoming stream request to `StreamReqInfo` and `StreamTarget`. This is in preparation for supporting multipath onion service conflux, and because the `HopLocation` from `StreamTarget` *needs* a `LegId`.
* proto: temporarily suppress warning; see #2003.Nick Mathewson2025-05-152-2/+3
|
* tor-proto: Make TunnelMutableState docs link to MutableState.Gabriela Moldovan2025-05-151-11/+3
| | | | | These `TunnelMutableState` impls just delegate to `MutableState`, so we might as well link to the corresponding docs.
* tor-proto: Add note about raciness of last_hop_num.Gabriela Moldovan2025-05-151-0/+15
|
* tor-proto: Add TODO about possibly replacing LegIdKey with UniqId.Gabriela Moldovan2025-05-151-0/+3
|
* tor-proto: Remove the CircuitSharedState type alias.Gabriela Moldovan2025-05-151-6/+2
| | | | Hiding the underlying type makes the code less readable.
* tor-proto: Clarify the MutableState::path() docs.Gabriela Moldovan2025-05-151-1/+1
|
* tor-proto: Update the TunnelMutableState when a circuit is removed.Gabriela Moldovan2025-05-152-17/+28
| | | | | | | | This is messy, because `ClientCirc::{path_ref, n_hops, ..}` become fallible (we can't unwrap the result, because when a circuit is closed, its state gets removed from the `TunnelSharedState`, but its `ClientCirc` handle continues to exist, so any attempt to retrieve the state will result in an `Err`).
* tor-proto: Rework MutableState to work with multi-path circuits.Gabriela Moldovan2025-05-154-31/+176
| | | | | | | | | | We now have a new `TunnelSharedState` type for storing the shared state of a tunnel. It consists of the `MutableState`s of all the circuits in the tunnel, which are shared between it and `Circuit` (the circuit subcomponent of the reactor). The `TunnelSharedState` itself is shared between `ConfluxSet` (which manages the `Circuits`), and `ClientCirc` (the reactor handle used to access information about circuits, such as their `Path`).
* tor-proto: Add From<LegIdKey> impl for LegId.Gabriela Moldovan2025-05-151-0/+6
| | | | This will simplify some callsites.
* tor-proto: Encapsulate MutableState operations inside impl.Gabriela Moldovan2025-05-153-42/+66
| | | | | Not locking the `MutableState` mutex outside of this impl makes it easier to see it's currently impossible deadlock.
* tor-proto: Rename MutableState to CircuitState.Gabriela Moldovan2025-05-153-9/+9
| | | | | | This renaming is in preparation for the addition of a newtype wrapper for what used to be `Mutex<MutableState>`. That newtype wrapper will be called `MutableState`.
* tor-proto: Make the MutableState internals private.Gabriela Moldovan2025-05-152-5/+18
|
* tor-proto: Remove deprecated ClientCirc functions.Gabriela Moldovan2025-05-152-48/+13
| | | | | | These functions have been deprecated for a while, and are now complicating the `MutableState` changes we need to do for #1840, so it seems like a good time to remove them.
* Merge branch 'proto-change-bench-neasurement' into 'main'Nick Mathewson2025-05-1413-199/+102
|\ | | | | | | | | tor-proto: change bench measurement See merge request tpo/core/arti!2998
| * proto: use consts for bench throuputsLionel Goffaux2025-05-1410-16/+25
| |
| * proto: fix doc mismatch in benchmarksLionel Goffaux2025-05-142-2/+2
| |
| * proto: fix doc typosLionel Goffaux2025-05-149-11/+11
| |
| * proto: change bench measurementLionel Goffaux2025-05-1310-190/+84
| |
* | All crates: bump rust-version to 1.83.Nick Mathewson2025-05-131-1/+1
|/
* proto: use of Aes{128,256}{Dec,Enc} in the benchmarksLionel Goffaux2025-05-086-24/+24
|
* proto: fix name mismatch in the bench utils docLionel Goffaux2025-05-083-10/+10
|
* proto: fix typo s(t)ateLionel Goffaux2025-05-086-15/+15
|
* proto: extend benchmarksLionel Goffaux2025-05-0816-338/+994
|
* Use simpler way to refer to last byte of tag.Nick Mathewson2025-05-071-1/+1
|
* proto: Update CGO test vectorsNick Mathewson2025-05-074-149/+146
| | | | | These were generated with an updated version of the python reference implementation.
* proto: Clear low 6 bits of counter in CGO PRF.Nick Mathewson2025-05-071-3/+4
| | | | See torspec#332.
* cell,proto: Split request/response extensions into seprate typesNick Mathewson2025-05-073-15/+14
| | | | Implements part of proposal 358.
* cell: Use ExtList to implement CircRequestExt.Nick Mathewson2025-05-075-17/+20
| | | | This required some renaming, so that the types and their codes matched.
* Rename NtorV3Extension to CircRequestExtNick Mathewson2025-05-075-27/+28
| | | | | | | This type will, because of prop358, be shared by ntorv3, hs-ntor, and probably other future handshakes. There will also be a CircResponseExt type.
* tor_proto: name fields in bench_utils.Nick Mathewson2025-05-061-7/+10
|
* proto: Apply type-specific wrappers for tor1 cryptoNick Mathewson2025-05-066-79/+143
| | | | | | | | | | | | | Now instead of using CryptState for everything, we have specific types for each role and direction of crypto. This turned up a harmless-so-far bug in our onion service code: as an onion service, we were using _client_ crypto layers to respond to a client request. That's not correct, and wouldn't have worked with CGO. Instead, we need to use relay crypto layers, wrapped as client layers. Closes #1975.
* proto, cell: Remove RelayCellFormatTrait.Nick Mathewson2025-05-069-197/+119
| | | | | | | | | | | | | | | | The purpose of the trait was to parameterize the tor1 cell crypto on the different possible relay cell layouts. It made sense to have this trait when we thought we would implement the new cell layout for prop340 (packed-and-fragmented) well before we implemented CGO. But it now appears all but certain that CGO will land long before we make any more headway on prop340. Therefore, it doesn't make sense to carry the ability to customize `tor1` for other relay cell layouts. Removing this trait saves a fair bit of complexity.
* tor-proto: Rename some no-longer-apt tor1 members.Nick Mathewson2025-05-061-14/+13
|
* tor-proto: remove some now-unneeded accessors.Nick Mathewson2025-05-061-35/+15
|
* Emit SendmeTag directly from cell crypto.Nick Mathewson2025-05-067-100/+90
| | | | | | | | | | | | | | | | | | | | This changes the code to copy a SendmeTag rather than returning a slice. This isn't actually a big change: sending a slice already required 16 bytes (on 64-bit platforms), so sending a SendmeTag around isn't a big deal. We rely extensively on the compiler's ability to optimize away all the checking in code like this: ``` let slice: &[u8]; let a: [u8;N] = slice[0..N].try_into().expect("Nope"); ``` I've spot-checked it somewhat with "cargo-show-asm", but it could use more thorough checking. Closes #1956.
* Remove the last traces of CircTag.Nick Mathewson2025-05-065-21/+19
|
* proto: Use SendmeTag in place of CircTagNick Mathewson2025-05-062-54/+9
| | | | | This doesn't make much change yet, but does save us an allocation when handling SENDMEs.
* proto: Split out CGO BlkCipher trait for Encryption/DecryptionNick Mathewson2025-05-062-57/+172
| | | | | | This lets us use `Aes128Dec` and `Aes128Enc` in place of plain old `Aes128`, which can be less space-efficient depending on the back-end.
* Merge branch 'clientcirc_extend' into 'main'Nick Mathewson2025-05-061-6/+59
|\ | | | | | | | | | | | | tor-proto: New extend() and create_firsthop() to pick between ntor and ntor3 Closes #1970 See merge request tpo/core/arti!2967
| * proto: Fix documentation to avoid recommending ntor methodsNick Mathewson2025-04-281-6/+8
| | | | | | | | | | | | Since we have create_firsthop() and extend(), we should recommend them in our documentation, instead of recommending the no-longer-best methods.
| * proto: Provide and use a create_firsthop() wrapper too.Nick Mathewson2025-04-281-0/+23
| |