summaryrefslogtreecommitdiff
path: root/crates/tor-cell
Commit message (Collapse)AuthorAgeFilesLines
* Bump all the unstable tor- and arti- crates to 0.40.0.Gabriela Moldovan2026-03-021-11/+11
| | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.40.0 done
* Bump the versions of the non-{arti-,tor-} cratesGabriela Moldovan2026-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The non-{arti-,tor-} crates are: ``` ./maint/list-crates | rg -v '^(tor|arti)' oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error futures-copy ``` Because this release bumps the MSRV, I am bumping the minor version of all of them. MINOR=" oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error futures-copy " for crate in $MINOR; do cargo set-version --bump minor -p $crate; done ```
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* Bump MSRV from 1.86 to 1.89Gabriela Moldovan2026-02-161-1/+1
| | | | | | | As agreed at our last team meeting. See https://gitlab.torproject.org/tpo/core/arti/#minimum-supported-rust-version
* proto: Implement a Canonicity structDavid Goulet2026-02-121-0/+12
| | | | | | | | | | | | | | | | | This struct will be put in a Channel and derived from the received NETINFO cell. This follows the C-tor implementation for which we have two indicator of canonicity: 1. Peer is canonical: the address they advertise in the NETINFO cell matches the one we see on the TCP connection. 2. Canonical to peer: the peer sees us as canonical. Those flag will get used to select "the best" channel. Signed-off-by: David Goulet <[email protected]>
* cell: Add an accessor for the linkspecs of an EXTEND2Gabriela Moldovan2026-02-051-0/+5
|
* release: Bump `arti-*` and `tor-*` crates to 0.39.0Wesley Aptekar-Cassels2026-02-021-11/+11
| | | | | | | | | | Done via: ``` for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.39.0 done ```
* Merge branch 'main' into 'main'gabi-2502026-02-021-1/+1
|\ | | | | | | | | fix(minver): Update paste dependency to be minver compatible See merge request tpo/core/arti!3610
| * fix(minver): Update paste dependency to be minver compatibleSamuel Cobb2026-01-261-1/+1
| |
* | maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
|/ | | | This adds the lint to all our crates.
* proto: Authenticate a relay channelDavid Goulet2026-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a bit loaded but it is coherent. First, we set Eq and PartialEq to the channel message Authenticate so we can compare it with the one we expected. Second, the AuthenticationCell enum is introduced to store either an AUTH_CHALLENGE or an AUTHENTICATE since one side of the handshake can only have one. This allows us to store one or the other in UnverifiedRelayChannel. Depending on what we have, the authentication process is different as it dictates which side we are on (initiator vs responder). Keep in mind that the handshake code enforces receiving a AUTH_CHALLENGE along side CERTS. And same goes for AUTHENTICATE which means that if we have an AUTH_CHALLENGE in the UnverifiedRelayChannel, it is certain that the other side wants to authenticate and we are the initiator. Finally, the sending of CERTS and AUTHENTICATE by the initiator is now in UnverifiedRelayChannel::check() done right after verifying the channel CERTS and holding a "VerifiedChannel" object. This means that the last piece, sending the `NETINFO` by the initiator will be done in the check() but in a future commit. This leaves the VerifiableChannel::finish() to send nothing and only finalize the channel with the NETINFO (canonicity). Signed-off-by: David Goulet <[email protected]>
* cargo: Update `arti-*` and `tor-*` to `0.38.0`Clara Engler2026-01-121-11/+11
| | | | | | | | | Done using the following: ```bash for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.38.0 done ```
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-041-3/+0
| | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* Pin our derive-deftly version to ~1.6.0 everywhereIan Jackson2025-12-031-1/+1
| | | | | | | | | | | We are supposed to pin whenever we enable the `beta` cargo feature, see https://docs.rs/derive-deftly/latest/derive_deftly/doc_changelog/index.html#beta-features Empirically, we somehow failed to do that in tor-circmgr. In practice not pinning makes little difference since cargo wants to pick the same version everywhere, but we should be correct. But it is more maintainable to pin everywhere.
* Update to derive-deftly 1.6.0Ian Jackson2025-12-031-1/+1
| | | | | | | | | This has: * Fixes to hygiene spans from the new modules feature, needed for my WIP netdoc encoder derive. * A substantially richer `${error }` construct.
* Bump all the unstable tor- and arti- crates to 0.37.0.Gabriela Moldovan2025-12-021-11/+11
| | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.37.0 done
* cell: Add missing docs to internal macroGabriela Moldovan2025-12-011-0/+2
|
* Merge branch 'bug2172' into 'main'Nick Mathewson2025-11-241-1/+1
|\ | | | | | | | | | | | | tor-llcrypto: Stop deriving Deref in CtByteArray Closes #2172 See merge request tpo/core/arti!3432
| * tor-llcrypto: Stop deriving Deref in CtByteArrayNeel Chauhan2025-11-241-1/+1
| |
* | Bump derive-deftly to 1.5.0Ian Jackson2025-11-071-1/+1
| | | | | | | | | | | | | | This has the meta attributes with optional values feature and also hygiene rework for modules. The breaking changes don't break arti.
* | Merge branch 'deftly-1.4' into 'main'opara2025-11-061-1/+1
|\ \ | | | | | | | | | | | | Bump derive-deftly to 1.4.0 See merge request tpo/core/arti!3448
| * | Bump derive-deftly to 1.4.0Ian Jackson2025-11-061-1/+1
| |/ | | | | | | | | | | This will let us use the new modules feature. There are no breaking changes to beta features in 1.4.0.
* | Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-065-5/+5
| | | | | | | | Run maint/add_warning
* | Decorate a use with an allowIan Jackson2025-11-061-0/+1
|/ | | | | | | This seems to depend on cfgs. As I say in #1060, I don't think precise cfg decoration of imports is sensible. Also, it shouldn't be my job to fix whatever this is...
* maint: bump minor versions of all published cratesSteven Engler2025-10-291-12/+12
| | | | | | | ```bash readarray -t publish < <(cargo metadata --format-version 1 | jq -r '.packages[] | select((.id | startswith("path+file:///")) and (.rust_version != null) and (.publish == null or .publish == true or .publish != [])) | .name') for package in "${publish[@]}"; do echo "$package:"; cargo set-version --bump minor -p "$package"; done ```
* proto: Add the channel authentication dataDavid Goulet2025-10-231-0/+5
| | | | | | | | | | | This commit only adds a struct holding all the authentication data that needs to be built during the verification process after all handshake cells needed for authentication have been sent. It lives in the VerifiedChannel struct so it can be used to build the AUTHENTICATE cell and be sent before the NETINFO. Signed-off-by: David Goulet <[email protected]>
* Bump MSRV from 1.85.1 to 1.86Clara Engler2025-10-211-1/+1
|
* Remove a couple of unused imports.Nick Mathewson2025-10-161-1/+0
|
* release: Bump versions.Wesley Aptekar-Cassels2025-10-021-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we've updated our MSRV, we must bump the minor version for every package. This was done as follows: cargo set-version -p arti 1.6.0 cargo set-version -p oneshot-fused-workaround 0.4.0 cargo set-version -p slotmap-careful 0.4.0 cargo set-version -p test-temp-dir 0.5.0 cargo set-version -p fslock-guard 0.4.0 cargo set-version -p hashx 0.5.0 cargo set-version -p equix 0.4.0 cargo set-version -p caret 0.7.0 cargo set-version -p fs-mistrust 0.12.0 cargo set-version -p safelog 0.6.0 cargo set-version -p retry-error 0.8.0 xargs -I P <<END cargo set-version -p P 0.35.0 tor-basic-utils tor-error tor-general-addr tor-geoip tor-rtcompat tor-rtmock tor-async-utils tor-config tor-config-path tor-rpc-connect tor-log-ratelim tor-rpcbase tor-memquota tor-units tor-llcrypto tor-bytes tor-protover tor-checkable tor-cert tor-key-forge tor-hscrypto tor-socksproto tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-persist tor-keymgr tor-chanmgr tor-ptmgr tor-dircommon tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-dirserver tor-hsclient tor-hsservice tor-hsrproxy tor-relay-crypto arti-client arti-relay arti-rpcserver arti-ureq arti-rpc-client-core END
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* tor-cell: add `Display` impl for `XonKbpsEwma`Steven Engler2025-09-221-0/+9
|
* tor-cell: add pub `PAYLOAD_MAX_SIZE_{ALL,ANY}`Steven Engler2025-09-151-0/+50
|
* Bump MSRV from 1.85 to 1.85.1Nick Mathewson2025-09-091-1/+1
| | | | Closes #2107
* padding: Report when we have received padding or data.Nick Mathewson2025-09-021-0/+11
| | | | (This was so much easier than reporting on the send side.)
* Update to derive-deftly 1.3.0Ian Jackson2025-09-021-1/+1
|
* Remove semver.md filesNick Mathewson2025-08-281-2/+0
|
* Bump the minor version of every published crate except for `arti`.Nick Mathewson2025-08-281-12/+12
| | | | | | | | Per policy, we bump the minor version of every tor-*, arti-* crate on each release. We have updated our MSRV, so we're treating this as a breaking change for our non-(arti/tor)-prefixed crates too.
* proto: Remove the AUTHORIZE as a parsable cellDavid Goulet2025-08-214-51/+2
| | | | | | | | | | | | | The AUTHORIZE cell command is simply reserved but not defined. The tor specification, at this point in time, is allowing such cell before the handshake starts but it is very unclear on what ordering is allowed nor how many can are allowed. C-tor silents drop them like VPADDING and so clearly unused. Instead of dealing with it, simply remove its support but keeping its reserved number. Signed-off-by: David Goulet <[email protected]>
* proto: Make the OutboundClientHandshake use new cell handlerDavid Goulet2025-08-201-1/+1
| | | | | | | | | | | | | | | | | Use the ChannelFrame<> for the entirety of the outbound client handshake that is the ClientInitiator channel type. With this change, the codec.rs code is not needed anymore along its CodecError as well which has been normalized onto the crate::Error instead in order to simplify error handling and avoid duplication of error types. Unit tests have been modified to reflect this change of what can be done with a channel frame. Also renamed to focus on client behavior. Part of #1597 Signed-off-by: David Goulet <[email protected]>
* cell: Add helper functionsDavid Goulet2025-08-201-0/+5
| | | | | | | | | | | | Add is_known_cmd() to the restricted_msg!() macro which can be used to learn if a specific ChanCmd is part of the restricted set or not. Then add a simple function to get the link protocol version from a channel codec. Part of #1597 Signed-off-by: David Goulet <[email protected]>
* tor-hsservice: Change capping of PoW effort.Wesley Aptekar-Cassels2025-08-132-10/+1
| | | | | | | | This caps the PoW effort during sorting, rather than at intake. This allows us to record efforts that are capped in our metrics histogram while only recording metrics after the PoW solve has actually been verified.
* tor-cell: fix comment in `ChannelCodec::encode`Steven Engler2025-08-121-1/+3
| | | | | | This comment isn't correct if the encode() was given a non-empty buffer (for example if two cells were written to the same buffer, the second encode() would be given a non-empty buffer, so `pos != 5`).
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0716-41/+42
| | | | | | | | | | | | | | 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.
* Merge branch 'msrv-fixes' into 'main'Nick Mathewson2025-08-052-12/+13
|\ | | | | | | | | Resolve a few issues that had been waiting for an MSRV update. See merge request tpo/core/arti!3129
| * tor-cell: Check strictly-ascending property more efficientlyNick Mathewson2025-08-052-12/+13
| | | | | | | | | | | | I had been planning to use `[]::is_sorted` here, once we had MSRV >= 1.82, but it turns out that we wanted strictly ascending sequence, whereas `is_sorted` checks for a non-descreasing sequence.
* | Merge branch 'prop362-fixups' into 'main'wesleyac2025-08-051-0/+10
|\ \ | |/ |/| | | | | Fix a few TODOs for PoW See merge request tpo/core/arti!3106
| * tor-cell: Add ProofOfWorkV1::cap_effort function.Wesley Aptekar-Cassels2025-08-051-0/+10
| |
* | Merge branch 'msrv-1.85' into 'main'Nick Mathewson2025-08-051-2/+2
|\ \ | |/ |/| | | | | | | | | Bump MSRV to Rust 1.85 Closes #2095 See merge request tpo/core/arti!3128
| * Bump to hex-literal 1.0Nick Mathewson2025-08-051-1/+1
| | | | | | | | | | (We were unable to do this before, since it required a rust version we didn't have.)
| * Set MSRV to 1.85.Nick Mathewson2025-08-051-1/+1
| |