summaryrefslogtreecommitdiff
path: root/crates/tor-relay-crypto/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-relay-crypto: Temporarily comment out RelaySigningKeySpecifier.Gabriela Moldovan2024-10-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `RelaySigningKeySpecifier` is currently defined as: ```rust #[non_exhaustive] #[derive(Deftly, PartialEq, Debug, Constructor)] #[derive_deftly(KeySpecifier)] #[deftly(prefix = "relay")] #[deftly(role = "KP_relaysign_ed")] #[deftly(summary = "Relay medium-term signing keypair")] /// The key sepcifier of the relay medium-term signing key (RelaySigningKeypair) pub struct RelaySigningKeySpecifier; ``` This means there can only be a single `relaysign_ed` key with an `ArtiPath` of the form `relay/KP_relaysign_ed`. This is a problem, because relays storing their identity key offline will want to generate a number of `relaysign_ed` keys ahead of time, so we need the keystores to be able to contain multiple such keys. We will need their `ArtiPath` to encode a variable component (for example, a timestamp). We also need to teach `KeyMgr` to retrieve such keys (`KeyMgr::get` should return the first key that has a valid and timely certificate). This will involve extending the `KeySpecifier` trait with a function for obtaining the `KeySpecifier` of the certificate of the key, if there is one. For now, let's comment it out and rethink its `ArtiPath` as part of #1692.
* tor-key-forge: encapsulate `define_ed25519_keypair` macro depsSteven Engler2024-09-181-1/+1
| | | | | | | | | This re-exports the types/traits needed by the `define_ed25519_keypair` macro so that the macro caller doesn't need to import a bunch of extra packages in its Cargo.toml that it doesn't use, and so that the caller doesn't need a `use prelude::*` before invoking the macro. This makes the macro nicer to use for the caller, and should prevent the macro from causing "cannot find ... in this scope" errors.
* key-forge: Support extra docs and attributes to ed25519 keypairDavid Goulet2024-09-181-6/+12
| | | | Signed-off-by: David Goulet <[email protected]>
* relay-crypto: Initial import of new tor-relay-crypto crateDavid Goulet2024-09-183-0/+123
This adds a new crate called tor-relay-crypto which is responsible for declaring the relay keys and certificate that will be used by a relay and stored in a KeyMgr. This is in its own crate and considered pretty low level so other crates can use it to access the relay keys, like tor-proto, for cryptographic actions like channel authentication or descriptor signing. The lower level cryptographic keys are wrapped in a higher level object in this crate, using tor-key-forge crate, so we can have proper semantic and strong type check on those keys so they are not misused or confused with other keys. At this point, the key declaration might change once the KeyMgr supports attaching a certificate to a key. We are likely going to see more code related to certificate creation in this crate in the future. Part of #1604 Signed-off-by: David Goulet <[email protected]>