summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
* Bump versions of 0.x tor-* and arti-* cratesIan Jackson2024-04-301-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for p in `cat ../u`; do cargo set-version --locked --offline -p $p; done where u contains tor-basic-utils tor-async-utils tor-error tor-config tor-units tor-geoip tor-rtcompat tor-rtmock tor-log-ratelim tor-rpcbase tor-memquota tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-hyper
* Circuit reactor: document some requirements and assumptionsJim Newsome2024-04-251-10/+42
| | | | | | | | There are some tricky bits here that implicitly assume particular behavior in other bits for correctness. Document these requirements and assumptions. Fixes arti#1373
* Add temporary allows for some dead code warningsIan Jackson2024-04-253-0/+3
|
* Use uXX::MAX in place of std::uXX::MAXNick Mathewson2024-04-222-3/+3
| | | | | | The old code produced a warning from clippy nightly; we may as well update to use the new associated consts. (They've been there since Rust 1.4x.)
* proto: Simplify a check-and-convert to use try_into+expectNick Mathewson2024-04-221-2/+2
|
* Merge branch 'counted_hashmap' into 'main'Ian Jackson2024-04-112-42/+565
|\ | | | | | | | | | | | | streammap: Use an internal counted_hashmap to simplify invariant checking Closes #1344 See merge request tpo/core/arti!2058
| * counted_map: Use educe(Default).Nick Mathewson2024-04-021-12/+4
| |
| * counted_map: Use PhantomData<fn(P)->P>Nick Mathewson2024-04-021-4/+4
| | | | | | | | This is always Send+Sync, and invariant with P.
| * counted_map: Add some notes about correctness; downgrade unsafesNick Mathewson2024-04-022-13/+21
| | | | | | | | | | (We're letting the "unchecked" suffix of this function be enough to indicate that it's risky to use.)
| * streammap: Use an internal counted_hashmap to simplify invariant checkingNick Mathewson2024-03-282-43/+566
| | | | | | | | | | | | | | | | | | | | Instead of making `streammap.rs` responsible for keeping track of a count field, this lowers that functionality into a lower-level CountedHashMap type. Said type has a little more functionality than we need, to sketch out how we'd want to develop it moving forward if we find that it's useful elsewhere. Closes #1344.
* | remove unused dependenciestrinity-1686a2024-04-021-2/+0
| | | | | | | | Edited-by: Nick Mathewson <[email protected]>
* | Update unstable `tor/arti-*` crates to 0.17.0.Nick Mathewson2024-04-021-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with: ``` CRATES=" tor-basic-utils tor-async-utils tor-error tor-config tor-events tor-units tor-geoip tor-rtcompat tor-rtmock tor-log-ratelim tor-rpcbase tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-hspow tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-congestion tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-config arti-hyper arti-bench arti-testing " for crate in $CRATES; do cargo set-version -p "$crate" 0.17.0 done ```
* | Bump patchlevel versions on non-{tor/arti} crates.Nick Mathewson2024-04-021-1/+1
|/ | | | | | | | | | | | | | | | These have all had backward-compatible changes. Generated with: ``` cargo set-version --bump patch -p fs-mistrust cargo set-version --bump patch -p test-temp-dir cargo set-version --bump patch -p fslock-guard cargo set-version --bump patch -p hashx cargo set-version --bump patch -p equix cargo set-version --bump patch -p caret cargo set-version --bump patch -p safelog cargo set-version --bump patch -p retry-error ```
* Make filter conditional, to fix build with hs-service disabled.Nick Mathewson2024-03-262-2/+6
|
* Refactor and simplify ClientCircSyncViewNick Mathewson2024-03-262-34/+24
| | | | | | | | With this patch, it holds only a reference to `&reactor.hops`, which greatly simplifies the reactor code's fight with the borrow checker. I've left some TODO comments about future directions here.
* Rename the old IncomingStreamRequestContext to StreamReqInfo.Nick Mathewson2024-03-263-9/+7
| | | | (Doing this to prevent us having two structs with the same name.)
* Add an IncomingStreamRequestFilter to check early propertiesNick Mathewson2024-03-265-12/+136
| | | | | | | Based on designs in #1124. Note that there is a TODO here about a hack I had to do to appease the borrow checker.
* Define a type for a synchronous (blocking) view of a circuit state.Nick Mathewson2024-03-263-0/+40
| | | | | We'll use this as an argument for the callback that checks stream requests to make sure they're permitted.
* proto: Make StreamMap keep a count of open streams.Nick Mathewson2024-03-261-0/+34
|
* proto: Prevent general state-transitions on StreamEntNick Mathewson2024-03-262-38/+60
| | | | | | We want to keep an accurate count of the number of open streams, so we have to stop exposing `&mut StreamEnt` outside of the streammap module.
* proto: Refactor circuit::streammap::StreamEntNick Mathewson2024-03-262-40/+51
| | | | | | | This is the first part of a refactoring that will let us keep code from the outside of `streammap` from changing a stream from one state to another. And we need to do _that_ so that StreamMap can count how many open streams it has.
* Push HandshakeRole down one level.Nick Mathewson2024-03-261-5/+4
|
* Provide spec links for relay crypto formats.Nick Mathewson2024-03-261-2/+10
|
* Clean up match statement a little.Nick Mathewson2024-03-261-7/+7
|
* We now need circuit::handshake to exist unconditionally.Nick Mathewson2024-03-262-2/+15
|
* Refactor the logic for constructing crypt layers.Nick Mathewson2024-03-263-77/+95
| | | | | | | | | | | The key insights here are: - That relay cell format and crypto protocols aren't orthogonal: Once we have GCO, it will require V1. - That we only need the actual functions for layer construction to be generic; we don't need to proliferate generic parameters everywhere. - That the circuit::handshake module already does most of what we want.
* Add and use RelayCellFormatTraitJim Newsome2024-03-204-113/+129
| | | | | | This lets us paramaterize types and functions by a particular relay cell format. We use this e.g. to statically parameterize the cell crypto functions, thereby removing some run-time branching in the hot path.
* Propagate RelayCellFormat selection up to where format decisions will be madeJim Newsome2024-03-204-30/+83
|
* Paramaterize layer crypto objects by cell formatJim Newsome2024-03-203-25/+49
|
* RelayCellBody: generalize over RelayCellFormatJim Newsome2024-03-201-13/+31
| | | | | Different formats will use different ranges for the `recognized` and `digest` fields.
* Add tor_proto::util::ct::is_zeroJim Newsome2024-03-201-0/+25
|
* RelayCellBody::is_recognized: improve doc commentNick Mathewson2024-03-201-1/+7
|
* RelayCellFormat::recognized -> is_recognizedJim Newsome2024-03-201-3/+3
|
* Run maint/add_warning.Nick Mathewson2024-03-1317-0/+17
|
* relay-cell: Update relay cell decoding API for prop340Jim Newsome2024-03-125-28/+104
| | | | | | | | | | | Prop 340: https://spec.torproject.org/proposals/340-packed-and-fragmented.html This updates the decoding API to support multiple versions of the relay cell encoding, including the new encoding proposed in prop340 that supports relay message packing and fragmentation. This commit doesn't actually add support for that new encoding yet.
* Rename UnparsedRelayCell -> UnparsedRelayMsgJim Newsome2024-03-1210-39/+39
| | | | | For consistency with the terminology proposed in https://gitlab.torproject.org/tpo/core/torspec/-/issues/253
* Fix typos in documentationTobias Stoeckmann2024-03-061-1/+1
|
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* Merge branch 'remove-semver' into 'main'Ian Jackson2024-03-051-1/+0
|\ | | | | | | | | Remove semver.md files from arti 1.2.0 release. See merge request tpo/core/arti!2022
| * Remove semver.md files from arti 1.2.0 release.Gabriela Moldovan2024-03-041-1/+0
| |
* | Merge branch 'deny-unchecked-duration-substraction' into 'main'Ian Jackson2024-03-051-0/+1
|\ \ | |/ |/| | | | | | | | | deny clippy::unchecked_duration_subtraction Closes #1304 See merge request tpo/core/arti!2008
| * deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
| |
* | tor-cert: Bump minor version.Gabriela Moldovan2024-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | We bumped the minor version of `tor_checkable`, which is used in the `tor-cell` public APIs (e.g. `Ed25519Cert` implements `tor_checkable::Timebound`, using `tor_checkable::TimeValidityError` as its error type). This bumps the minor version of `tor-cert` (including for its dependents).
* | Bump the minor version, for crates with breaking changes.Gabriela Moldovan2024-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | APIs were broken in these pre-1.0.0 crates: ``` tor-keymgr tor-config tor-checkable tor-circmgr tor-dirmgr tor-hsclient tor-hsservice tor-hsrproxy ``` Done with: ``` cargo set-version --bump minor -p tor-keymgr cargo set-version --bump minor -p tor-config cargo set-version --bump minor -p tor-checkable cargo set-version --bump minor -p tor-circmgr cargo set-version --bump minor -p tor-dirmgr cargo set-version --bump minor -p tor-hsclient cargo set-version --bump minor -p tor-hsservice cargo set-version --bump minor -p tor-hsrproxy ```
* | Bump patchlevel of pre-1.0.0 crates with new APIs.Gabriela Moldovan2024-03-041-3/+3
|/ | | | | | | | | | | | | | | | | | | | APIs were added: ``` tor-units tor-cell tor-proto tor-netdir arti-client ``` Done with: ``` cargo set-version --bump patch -p tor-units cargo set-version --bump patch -p tor-cell cargo set-version --bump patch -p tor-proto cargo set-version --bump patch -p tor-netdir cargo set-version --bump patch -p arti-client ```
* tor-proto: Note the addition of PendingClientCirc::peek_unique_id in semver.md.Gabriela Moldovan2024-02-281-1/+1
|
* tor-proto: Add function for peeking at pending circ unique ID.Gabriela Moldovan2024-02-271-0/+5
| | | | | | | | | `tor_circmgr::Error::Protocol` will soon include an optional `UniqId`. Since `Protocol` errors can be caused by pending circuits, we need to be able to peek at their `UniqId`. Part of #1297
* tor-circmgr: Add a helper for displaying optional UniqIds.Gabriela Moldovan2024-02-272-1/+18
| | | | | | | | Some of the `tor_circmgr::Error` variants will include the `UniqId` of the corresponding circuit, so we'll need to be able to display it without the `Circ ` prefix. Part of #1297
* tor_cell: never construct empty DATA messages.Nick Mathewson2024-02-132-11/+11
| | | | | | | We never actually constructed these before, but now we enforce it at the API level. Part of #1269.
* Bump minor versionsIan Jackson2024-02-051-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump the minor version of these crates, and update the in-tree dependencies. Recently published as fresh crates, let's just assume there are breaking changes: fslock-guard test-temp-dir Breaking API change affecting many many downstream crates: tor-rtcompat Downstream crates which we're (conservatively) assuming have tor-rtcompat types in their APIs: tor-rtmock tor-log-ratelim tor-rpcbase tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-hspow tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-congestion tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-config arti-hyper arti-bench arti-testing