summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | dd(TorConfig): change the order of default vs magicNick Mathewson2026-05-272-23/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This affects the automatic builder code made by our derive_deftly macro. It is only relevant (for now) in the case of the `NonZero<>` types and their special handling. Previously, when a builder contained Option<U>, and we wanted to generate a configuration holding T, we would _first_ apply a transformation from Option<U> to Option<T> and _second_ unwrap the result or apply a default. Now, we _first_ convert from Option<U> to U by applying a default, and only _then_ perform any necessary conversion from U and T. This is only relevant in the case where U and T are different. It simplifies writing the defaults for `NonZero` options, and will significantly simplify the logic for setting builder defaults.
| * | | | | | config: Fix documentation of ResolutionResultsNick Mathewson2026-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It previously referred to a function that didn't exist.
| * | | | | | tor-basic-utils: Correct documentation for macro_first_nonempty.Nick Mathewson2026-05-271-5/+5
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | It looks like we renamed this macro, but didn't rename it in its documentation.
* | | | | | Merge branch 'rd-bandwidth' into 'main'Ian Jackson2026-05-273-0/+29
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Bandwidth support to Router Descriptors See merge request tpo/core/arti!4005
| * | | | | | tor-netdoc: Add bandwidth field to RouterDescClara Engler2026-05-262-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the bandwidth field to the RouterDesc struct as it is found within the spec. The legacy parser will not support it, hence why we do default values there.
| * | | | | | tor-netdoc: Add Bandwidth structClara Engler2026-05-262-0/+20
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | This commit adds the bandwidth struct for router descriptors which is present in the `bandwidth` item.
* | | | | | Merge branch 'relay-clippy' into 'main'Nick Mathewson2026-05-272-1/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix two unused warnings See merge request tpo/core/arti!4019
| * | | | | | tor-chanmgr: fix `unused_imports` warningSteven Engler2026-05-271-1/+3
| | | | | | |
| * | | | | | arti-relay: fix `unused_variables` warningSteven Engler2026-05-271-0/+1
| | | | | | |
* | | | | | | Merge branch 'doc-digest-reorg' into 'main'Clara Engler2026-05-2712-67/+178
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | tor-netdoc: Implement encoding for referenced doc digest in rs entries See merge request tpo/core/arti!3989
| * | | | | | tor-netdoc: Implement encoding for md rs digestIan Jackson2026-05-182-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not tested yet. It will be tested when we add round-trip tests for votes.
| * | | | | | tor-netdoc: Fix comment about from_unparsedIan Jackson2026-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't parse the keyword, only the value.
| * | | | | | tor-netdoc: Tidy doc_digest_parse2_m into doc_digest_item_mIan Jackson2026-05-182-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rename it so that it doesn't mention parse2, because we're going to want to encode too. * Remove the indirection: rename the one in md.rs to be the name that's used in `with = `. (Previously, things were more complicated so the extra layer of indirection was helpful.)
| * | | | | | tor-netdoc: rs referenced doc digests: Use FixedB64 (fmt)Ian Jackson2026-05-181-2/+1
| | | | | | |
| * | | | | | tor-netdoc: rs referenced doc digests: Use FixedB64Ian Jackson2026-05-187-43/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FixedB64 is the right type for these, when they are present. This abolishes some ad-hoc boilerplate. Sadly we still need a bit of that for Reasons.
| * | | | | | tor-netdoc: relay flags with: Use ns_type! rather than conditional importIan Jackson2026-05-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, this was't possible because derive-deftly wanted a string. But now it can take a type, and types can contain macro calls inside their generics etc. This makes the code much more local and direct.
| * | | | | | tor-netdoc: Fix comments in rs variety filesIan Jackson2026-05-183-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is router *status* not router *descriptor*.
| * | | | | | tor-netdoc: Fix NotPresent to use same Each valueIan Jackson2026-05-183-13/+93
| | | | | | |
| * | | | | | tor-netdoc: Document that parse2 vs encode multiplicity match req'tIan Jackson2026-05-183-4/+40
| | | | | | |
* | | | | | | Merge branch 'relay-destroy' into 'main'gabi-2502026-05-263-31/+161
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | proto: Add tests for DESTROY and TRUNCATE handling See merge request tpo/core/arti!4008
| * | | | | | proto: Remove TODOs about flushing pending dataGabriela Moldovan2026-05-262-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We decided the reactor is the wrong place to handle this. See discussion in #2490
| * | | | | | proto: Remove unused asyncGabriela Moldovan2026-05-201-3/+2
| | | | | | |
| * | | | | | proto: Make TRUNCATE trigger a proto violationGabriela Moldovan2026-05-202-5/+25
| | | | | | |
| * | | | | | proto: Add some tests for DESTROY handlingGabriela Moldovan2026-05-201-1/+60
| | | | | | |
| * | | | | | proto: Make do_create2_handshake() check EXTENDED2 was sentGabriela Moldovan2026-05-201-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an extra assertion that ensures the relay reactor does in fact send an EXTENDED2 on its towards-the-client channel after receiving the CREATED2 response from the fake hop. This check is nice to have in general, but the main reason I'm doing this now is because for the DESTROY tests I'm about to add, I need the inbound MPSC queue (towards the client) drained of these handshake messages in order to check that the "next" cell we've sent is a destroy. I could've added some custom code to drain it just for the purposes of that test, but I think it's better to have `do_create2_handshake()` take care of it.
| * | | | | | proto: Extend helper to check that DESTROY was sent in both directionsGabriela Moldovan2026-05-201-7/+21
| | | | | | |
| * | | | | | proto: Rename a test helper and adjust its docsGabriela Moldovan2026-05-201-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new name is (hopefully) a bit more descriptive. I'm planning on extending this function soon to support checking if a DESTROY has been sent on the outbound channel too, so I'm tweaking the docs a bit in preparation for that.
| * | | | | | proto: Return the CircId from test handshake helperGabriela Moldovan2026-05-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I'll soon need this for a DESTROY test.
| * | | | | | proto: Add test helper for sending AnyChanMsgsGabriela Moldovan2026-05-201-0/+5
| | | | | | |
| * | | | | | proto: Add a comment clarifying why we don't need to propagate DESTROYGabriela Moldovan2026-05-201-0/+7
| | | | | | |
| * | | | | | proto: Adjust DESTROY-related logs in the backward reactorGabriela Moldovan2026-05-201-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes a debug log to have the same format as the corresponding DESTROY-related log from the forward reactor. Part of #2490
| * | | | | | proto: Pass the cell by reference to resolve a warningGabriela Moldovan2026-05-201-3/+2
| | | | | | |
| * | | | | | proto: Log a message when a forward DESTROY comes alongGabriela Moldovan2026-05-201-3/+15
| | |/ / / / | |/| | | | | | | | | | | | | | | | Part of #2490
* | | | | | relay: Use futures::select instead of tokioDavid Goulet2026-05-262-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Avoid using super::super:: and instead importDavid Goulet2026-05-261-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Use a struct for key valid_until cacheDavid Goulet2026-05-262-88/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of a HashMap, use a struct that contains explicit valid_until value per key type as those won't change anytime soon. This is to have a smaller memory footprint and simpler design. Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Rename crypto task reconcile() to recompute_valid_until()David Goulet2026-05-262-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: .expect() on mutex lock failureDavid Goulet2026-05-262-26/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change made it that we don't need Result<> to be returned for two functions therefore affecting the callsites. Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Small move of imports (fmt)David Goulet2026-05-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Crypto task now listens for new consensusDavid Goulet2026-05-263-42/+108
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Add unit test for key view reconcile()David Goulet2026-05-262-1/+152
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Fix unit tests after crypto task rewriteDavid Goulet2026-05-261-56/+21
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Crypto task removal of get_ntor_keys()David Goulet2026-05-262-48/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the last piece that needed to be removed since we can use the view to get those keys. This also allows us to remove the temporary FullKeyView::keymgr() function and instead keep the keymgr access strictly to the view guard. Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Set the FullKeyView in InerTorRelayDavid Goulet2026-05-264-105/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is so we early set the FullKeyView and we use it accross the code from initialization. The try_generate_keys() now takes a view and locks it to make its changes. And we also make build_proto_relay_auth_material() use a view to simplify its code and also stop relying on the KeyMgr for key accessors. Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Crypto task uses the key view reconcile()David Goulet2026-05-261-38/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This effectively removes KeyChange and use the returned set of key types that were rotated. Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Add key view reconcile() for the valid_until cacheDavid Goulet2026-05-261-4/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rebuild the valid_until cache from the key manager and return which key has changed. Function is not used in this commit. Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Unify crypto task try_rotate_keys()David Goulet2026-05-261-32/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the try_rotate_keys() to be explicit about no locking and use it in the Reactor. We need this try_rotate_keys() independent function so our first generate all keys can call it which is done before the reactor starts. Because we need crypto material in order to initialize the ChanMgr, we have to generate keys before spawning the task. Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Spawn new crypto reactorDavid Goulet2026-05-262-59/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also remove unused code from this change. Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Crypto task try_generate_all is simplifiedDavid Goulet2026-05-261-28/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like previous commit, we only care now if a generate has been done. It is enough of a signal to rebuild our channel auth material and set ntor keys. Part of the refactoring into phases. Signed-off-by: David Goulet <[email protected]>
* | | | | | relay: Simplify the remove expired keys processDavid Goulet2026-05-261-37/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crypto task remove_expired_keys() only returns the next minimum expiry time of all keys it looked at if any remains. This is part of a broad refactoring of the task so we get to have three phases at each run that is: 1. Expire, 2. Rotate, 3. Reconcille With that design, we only need to know if a rotation happened and if so, we can signal other task that we did and rebuild the channel auth key material and ntor keys. The reconcille phase will be in charge of rebuilding the valid_until task of the view. Signed-off-by: David Goulet <[email protected]>