summaryrefslogtreecommitdiff
path: root/crates/arti-relay/src
Commit message (Collapse)AuthorAgeFilesLines
* relay: Modify RelayNtorKeys to use a constructorDavid Goulet2026-04-211-10/+23
| | | | | | | | | | | | Because of the sorting requirement and the fact that a `KeyMgr` can have multiple Ntor keys, the caller now explicitly extract the two Ntor keys it wants from the `KeyMgr` and then creates a `RelayNtorKeys` object with them. Future changes (#2495) will move this into a view and warn if there are more than 2 keys. Signed-off-by: David Goulet <[email protected]>
* proto: Make the CreateRequestHandler::new() take the ntor keysDavid Goulet2026-04-211-2/+8
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Use the new RelayNtorKeys for the create handlerDavid Goulet2026-04-211-28/+27
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Sort Ntor keys by valid_untilDavid Goulet2026-04-211-1/+15
| | | | | | | | | This is when we get them from the keystore so we can have a concept of ordering in the SmallVec. Future commit will transform this into a struct handling both keys. Signed-off-by: David Goulet <[email protected]>
* arti-relay: Use unquoted type in keypair_specifier attrGabriela Moldovan2026-04-161-2/+2
|
* arti-relay: improve ntor key loggingSteven Engler2026-04-141-5/+8
| | | | We only need the max, not the entire sorted list.
* arti-relay: log the public ntor keySteven Engler2026-04-141-3/+32
| | | | This is useful for testing.
* arti-relay: move key logging (part 3)Steven Engler2026-04-131-3/+0
| | | | Small cleanup.
* arti-relay: move key logging (part 2)Steven Engler2026-04-131-21/+21
| | | | Code movement only.
* arti-relay: move key logging (part 1)Steven Engler2026-04-131-0/+11
| | | | Set up function placeholder.
* arti-relay: Use a SmallVec for the ntor keysGabriela Moldovan2026-04-091-2/+4
| | | | Usually, there will only be two of these.
* proto: Add method for installing ntor keys in the create handlerGabriela Moldovan2026-04-091-1/+1
| | | | | This also updates the key rotation task to call the setter whenever the ntor keys get updated.
* arti-relays: Pass a CreateRequestHandler to the crypto task (fmt)Gabriela Moldovan2026-04-091-3/+8
|
* arti-relays: Pass a CreateRequestHandler to the crypto taskGabriela Moldovan2026-04-092-1/+4
| | | | This will need to be updated each time the ntor keys change.
* arti-relay: Add tests for the ntor key rotationGabriela Moldovan2026-04-091-0/+53
|
* arti-relay: Test that 1 ntor key gets generated on first runGabriela Moldovan2026-04-091-0/+7
|
* arti-relay: Dedupe test helperGabriela Moldovan2026-04-091-16/+10
| | | | | I am about to add another one of these, so I tried to deduplicate the impls a bit.
* arti-relays: Extend existing tests to check ntor key rotation (fmt)Gabriela Moldovan2026-04-091-1/+4
|
* arti-relays: Extend existing tests to check ntor key rotationGabriela Moldovan2026-04-091-2/+6
|
* arti-relay: Generate and rotate ntor keysGabriela Moldovan2026-04-091-10/+162
| | | | | | | | There is still some outstanding work here to read the lifetime and grace period from the consensus, but that will require some bigger changes to the rotation task. Closes #2451
* arti-relay: Add callbacks for deciding whether to expire and generateGabriela Moldovan2026-04-091-11/+26
| | | | | The logic for removing and generating ntor keys is going to be slightly different here.
* arti-relay: Replace have_rotated bools with KeyChange (fmt)Gabriela Moldovan2026-04-091-8/+14
|
* arti-relay: Replace have_rotated bools with KeyChangeGabriela Moldovan2026-04-091-15/+23
| | | | This will enable us to plug in the ntor key rotation logic.
* arti-relay: Add a struct describing a key change eventGabriela Moldovan2026-04-091-0/+19
| | | | | | This is just a wrapper over `bool` right now. It will helps us distinguish changes to the channel auth material from changes affecting the ntor circuit extension keys.
* arti-relay: s/have_rotated/have_removed for clarityGabriela Moldovan2026-04-091-2/+2
|
* relay: Pass advertise SocketAddr to channel builder instead of IpAddrDavid Goulet2026-04-092-6/+6
| | | | | | | | | | This trickles down to the tor-proto channel handshake code. But, the real need is in the channel builder in order to validate the outbound channel target. Fixes #2440 Signed-off-by: David Goulet <[email protected]>
* arti-relay: Fix test MockRuntime::advance_by() usageGabriela Moldovan2026-04-091-6/+2
| | | | | | | This was previously advancing time by more than intended (I think the intention here was to use something like `MockRuntime::jump_wallclock()`, but that function has no effect on sleeping futures, so I think we should continue using `advance_by()`).
* Merge branch 'rustls-defaults' into 'main'Nick Mathewson2026-04-081-2/+3
|\ | | | | | | | | | | | | Allow compile-time selection of rustls CryptoProvider; use aws-lc-rs by default. Closes #2448 See merge request tpo/core/arti!3857
| * arti-relay: Change CryptoProvider to aws-lc-rs.Nick Mathewson2026-04-081-2/+3
| |
* | Merge branch 'create-fast' into 'main'opara2026-04-084-2/+201
|\ \ | | | | | | | | | | | | Add support for handling CREATE_FAST cells and launching a circuit reactor See merge request tpo/core/arti!3846
| * | arti-relay: add support for a `CreateRequestHandler`Steven Engler2026-04-084-2/+201
| | |
* | | arti-relay: Retrieve the signing key cert from the keystoreGabriela Moldovan2026-04-081-8/+16
| | | | | | | | | | | | | | | | | | | | | The API for retrieving certs exists now, so we don't need to regenerate the cert each time. This addresses a TODO.
* | | arti-relay: Reuse cert_expiry calculationGabriela Moldovan2026-04-081-2/+3
| | | | | | | | | | | | For readability.
* | | arti-relay: Move comment closer to the durations it refers toGabriela Moldovan2026-04-081-2/+2
| | | | | | | | | | | | | | | We forgot to move this comment when we replaced the hard-coded durations with top-level constants.
* | | arti-relay: Use more descriptive names for the key lifetimesGabriela Moldovan2026-04-081-20/+20
| |/ |/|
* | arti-relay: Remove no-longer needed implsGabriela Moldovan2026-04-012-26/+5
| | | | | | | | | | The specifiers are local to the crate, so we don't need the `valid_until` accessors anymore.
* | arti-relay: Make the key specifiers pub(crate)Gabriela Moldovan2026-04-011-14/+14
| | | | | | | | These no longer need to be `pub` now that they're in `arti-relay`.
* | arti-relay: Move all key specifiers to a new keys module (fmt)Gabriela Moldovan2026-04-012-17/+13
| |
* | arti-relay: Move all key specifiers to a new keys moduleGabriela Moldovan2026-04-013-12/+332
|/ | | | | | | | | | | This extracts the key specifier types out of `tor-relay-crypto`, which * makes the code layout consistent with the hidden service crates (the key specifiers are defined in a `keys` module in `tor-hsservice`, while the key wrapper types live in `tor-hscrypto::pk`) * helps reduce the API surface: the key specifiers are only used in `arti-relay`, so we can move them there and make them `pub(crate)` instead of `pub`
* proto: Rename RelayIdentities to RelayChannelAuthMaterialDavid Goulet2026-03-302-19/+22
| | | | | | | | | | | | This object contains a melting pot of public keys, private keys and certificates. Rename it to reflect that it is channel authentication material and not "identities. https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374454 Signed-off-by: David Goulet <[email protected]>
* arti-relay: add `log_sensitive_information` config optionSteven Engler2026-03-242-0/+32
|
* arti-relay: change a 'debug' log to 'info'Steven Engler2026-03-241-2/+2
| | | | | I had intended for this to be 'info' in f287ec7910, but must have accidentally wrote 'debug'.
* Fix typosTobias Stoeckmann2026-03-242-2/+2
| | | | Typos found with codespell
* relay: Pass now() instead of the runtime in the crypto taskDavid Goulet2026-03-171-37/+31
| | | | | | | | | This way we get the whole task job to be aligned on one single now value to avoid potential inconsistencies between expiry and key generation. Fixes #2404 Signed-off-by: David Goulet <[email protected]>
* relay: Add crypto tasks unit testDavid Goulet2026-03-171-1/+242
| | | | | | Tests the key rotation code. Signed-off-by: David Goulet <[email protected]>
* relay: Use same wallclock() time when generating keysDavid Goulet2026-03-171-8/+6
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Make the crypto tasks use the runtime wallclockDavid Goulet2026-03-172-25/+42
| | | | | | This way we can unit tests properly. Signed-off-by: David Goulet <[email protected]>
* relay: Rewrite the rotation key logic in the crypto taskDavid Goulet2026-03-171-163/+245
| | | | | | | | | | | | | | | | | | | | | | This is almost a full rewrite of the crypto task which was needed in order to support our relay signing certificate to be put in the keystore which will be needed for the offline key feature. Instead of having rotate_key() do all the things, we now instead do two pass: 1. Remove all expired keys and certs. 2. Generate any missing keys. This still results in using the minimum valid_until of all our keys for the task sleep time. We can know cleanup the local trait used for this gymnastic and trade it for some more KeyMgr gymnastic. Fixes #2404 Signed-off-by: David Goulet <[email protected]>
* relay: Don't log warn if key already exists when generating oneDavid Goulet2026-03-171-4/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Remove leftover comment from previous code iterationDavid Goulet2026-03-171-4/+0
| | | | Signed-off-by: David Goulet <[email protected]>