aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src/keystore/arti.rs
Commit message (Collapse)AuthorAgeFilesLines
* Use new TimeBound name throughout the treeIan Jackson2026-07-161-1/+1
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* keymgr: Update tests to stop using RawKeystoreEntry (fmt)Gabriela Moldovan2026-05-181-3/+1
|
* keymgr: Update tests to stop using RawKeystoreEntryGabriela Moldovan2026-05-181-4/+3
| | | | `RawKeystoreEntry` no longer exists, so these tests need to be updated.
* keymgr: Remove RawKeystoreEntry (fmt)Gabriela Moldovan2026-05-181-1/+1
|
* keymgr: Remove RawKeystoreEntryGabriela Moldovan2026-05-181-5/+5
| | | | | | | | | | | | I think this adds unnecessary indirection, and it's a bit confusing to have two separate keystore entry types (we have `KeystoreEntry` too). This type exists just to server as a wrapper over the `RawEntryId` of an unrecognized keystore entry, and the `KeystoreId` of the keystore it was found in. This commit folds `RawKeystoreEntry` into `UnrecognizedEntry`, which was previously a thin wrapper over `RawKeystoreEntry`.
* tor-cert: Ed25519CertBuilder: do builder fn renameIan Jackson2026-04-291-1/+1
| | | | | | Change all call sites. This completes the rename.
* tor-keymgr: migrate to web-time-compat.Nick Mathewson2026-03-261-1/+1
|
* Fix typosTobias Stoeckmann2026-03-241-2/+4
| | | | Typos found with codespell
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* clippy: fix `clippy::implicit_clone` errorsSteven Engler2025-08-111-1/+1
| | | | | | | | | | | | | | | | | ```text error: implicitly cloning a `String` by calling `to_string` on its dereferenced type --> crates/tor-config/src/lib.rs:109:32 | 109 | V::String(_, s) => s.to_string(), | ^^^^^^^^^^^^^ help: consider using: `s.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone note: the lint level is defined here --> crates/tor-config/src/lib.rs:20:9 | 20 | #![deny(clippy::implicit_clone)] | ^^^^^^^^^^^^^^^^^^^^^^ ```
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-11/+13
| | | | | | | | | | | | | | 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.
* arti: keys: Add arti keys-rawhjrgrn2025-07-141-17/+111
| | | | | | | | | | | | | | | | | | | * CLI: Add `keys-raw` and subcommand `remove-by-path` * arti: Add `arti::subcommand::raw` for the CLI `keys-raw` * tor-keymgr: Add `ArtiNativeKeystoreError::UnexpectedRawEntry`, `ArtiEphemeralKeystoreError::NotSupported` * tor-keymgr: Add `tor-keymgr::raw` module * tor-keymgr: Add `Keystore::remove_unchecked` * tor-keymgr: Change `Keystore::list` to return `KeystoreEntry` * tor-keymgr: Add field `KeystoreEntry::raw_id` * doc: Update keys.md * doc: Add raw.md * tor-keymgr: BREAKING: `UnrecognizedEntryError::new` associated function is now only accessible within the crate `tor-keymgr` * tor-keymgr: BREAKING: `UnrecognizedEntryId` is renamed to `UnrecognizedEntry` * tor-keymgr: BREAKING: `KeyMgr::list()` and `Keystore::list()` now return `Result<Vec<KeystoreEntryResult<KeystoreEntry>>>`
* tor-keymgr: BREAKING: Refactor API: Keystore::listhjrgrn2025-05-301-19/+60
| | | | | * Change return type `Result<Vec<(KeyPath, KeystoreItemType)>>` if favor of `Result<Vec<StdResult<(KeyPath, KeystoreItemType), UnrecognizedEntryError>>>`
* *: use std::io::Error::other in many placesNick Mathewson2025-05-151-4/+2
| | | | | | | The `IoError::other` function is an easier way to say `IoError::new(IoErrorKind::Other, ...)`. It's been around since 1.74, but clippy started warning about the more verbose version in 1.87.
* tor-keymgr: BREAKING: Refactor API: Keystore::insertplaybahn2025-04-021-16/+8
| | | | | | Drop redundant/unused param item_type: &KeystoreItemType from keystore::Keystore::insert. Method now uses param key: &dyn EncodableItem to obtain a KeystoreItemType
* tor-keymgr: Fix TODO: Refactor API: Keystore::insertplaybahn2025-04-021-3/+5
| | | | Makes param item_type redundant. Renames item_type -> _item_type.
* tor-keymgr: keystore::arti: Rework tests: ssh-keygen interopplaybahn2025-03-261-7/+4
| | | | Closes #1455 [PATCH 4(v3)/4]
* tor-keymgr: test_utils: TestSpecifier::path_prefix: Drop methodplaybahn2025-03-261-1/+1
| | | | Part of #1455
* tor-keymgr: Fix clippy errorsplaybahn2025-03-261-1/+1
|
* tor-keymgr: keystore::arti::tests: More intuitive assert_eq!playbahn2025-03-261-2/+1
|
* tor-keymgr: keystore::arti: Rework ssh-keygen interop testsplaybahn2025-03-261-63/+82
| | | | Closes #1455 [PATCH 4(v2)/4]
* tor-keymgr: keystore::arti: Add tests for ssh-keygen interopplaybahn2025-03-261-65/+100
| | | | Closes #1455 [PATCH 4/4]
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* tor-keymgr: Rename test constants to match file names.Gabriela Moldovan2025-02-061-3/+3
| | | | Part of #1396
* tor-keymgr: Use ParsedEd25519Cert when decoding certs.Gabriela Moldovan2025-01-131-9/+9
| | | | | | | This helps us get rid of our uses of `KeyUnknownCert`. Needed because `KeyUnknownCert` can't readily be converted back to `EncodedEd25519Cert` (while `ParsedEd25519Cert` *can* -- see the `certs` module from `tor-relay-crypto`).
* tor-keymgr: Fix cert handling tests.Gabriela Moldovan2025-01-131-17/+43
| | | | | | This updates and reenables the cert management tests. Part of #1768
* tor-keymgr: Use Ed25519Cert::decode to parse the certs.Gabriela Moldovan2025-01-131-0/+4
|
* tor-keymgr: Add tests for ArtiNativeKeystore's handling of certs.Gabriela Moldovan2024-12-041-1/+29
|
* tor-keymgr: Add support for certs in ArtiNativeKeystore::insert().Gabriela Moldovan2024-12-041-5/+8
|
* tor-keymgr: Add support for certs in ArtiNativeKeystore::get().Gabriela Moldovan2024-12-041-8/+36
| | | | | This makes `ArtiNativeKeystore::get` deserialize the keystore item as a cert, if its `KeystoreItemType` is `Cert`.
* tor-keymgr: Add arti native keystore helper for parsing tor certs.Gabriela Moldovan2024-12-041-0/+1
| | | | | We'll soon use this in `ArtiNativeKeystore`'s `Keystore` implementation for parsing certs read from disk.
* tor-keymgr: Replace as_ssh_key_data with as_keystore_item (fmt).Gabriela Moldovan2024-12-041-1/+1
|
* tor-keymgr: Replace as_ssh_key_data with as_keystore_item.Gabriela Moldovan2024-12-041-7/+10
|
* tor-keymgr: Replace KeyType with KeystoreItemType (fmt).Gabriela Moldovan2024-12-041-3/+14
|
* tor-keymgr: Replace KeyType with KeystoreItemType.Gabriela Moldovan2024-12-041-25/+31
| | | | | This is part of the work needed to support storing certificates in the keystore (they won't have a `KeyType`, but rather `CertType`).
* tor-key-forge: Rename EncodableKey to EncodableItem.Gabriela Moldovan2024-12-041-2/+2
| | | | | | | | This is the first step in replacing `EncodableKey` with the new `EncodableItem` trait (see doc/dev/keymgr-certificates.md). (this refactoring is split over multiple commits to make reviewing easier)
* tor-keymgr: Add tests for CTorClientKeystore.Gabriela Moldovan2024-10-081-1/+1
|
* tor-keymgr: Move assert_found helper to test_utils.Gabriela Moldovan2024-10-081-14/+1
| | | | | This moves `assert_found` out of the `keystore::arti::test` so we can reuse it for testing other keystore implementations too.
* tor-keymgr: Rename Filesystem variant to Io for clarity (fmt).Gabriela Moldovan2024-10-081-35/+48
|
* tor-keymgr: Rename Filesystem variant to Io for clarity.Gabriela Moldovan2024-10-081-1/+1
| | | | | The `FilesystemError::Filesystem` variant was actually just for IO errors.
* tor-keymgr: Refactor common fs errors into a separate error enum.Gabriela Moldovan2024-10-081-25/+27
| | | | | | | | This will be reused by other on-disk key stores (such as the C Tor ones we're about to add). I recommend reviewing this commit using `git diff --color-moved=zebra --ignore-space-change`
* tor-keymgr: Rename RelKeyPath::new to RelKeyPath::arti.Gabriela Moldovan2024-10-081-1/+1
| | | | We're about to add a separate constructor for CTor paths.
* tor-keymgr: Move the checked_op utils out of the arti module.Gabriela Moldovan2024-10-081-3/+1
| | | | We are about to use this for the ctor keystore implementation too.
* tor-keymgr: Reimagine CTorPath as an enum.Gabriela Moldovan2024-10-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | C Tor's client restricted discovery keys don't have the service hsid encoded in the filename (the hsid of the service each key is associated with is encoded in contents of the key file). This means that given a key specifier like `HsClientDescEncKeypairSpecifier` (which is a wrapper over an HsId), we can't actually compute the relative path of the key in its `KeySpecifier::ctor_path()` implementation. To do so we would need to access the keystore to figure out which path contains the requested HsId, which we can't (and shouldn't!) do from within the `KeySpecifier` impl. This suggests the String newtype (representing a relative path) we previously had is not a good abstraction for `CTorPath`s. Moreover, `CTorPath` are static (they don't have dynamic components like `ArtiPath`), so it makes more sense to model `CTorPath` as an enum. The new `CTorPath::ClientHsDescEncKey(HsId)` variant will be used to instruct the C Tor client keystore to find the file that contains the specified `HsId`, while the `Service` variant will be used for hidden service keys.
* Rename tor-keys crate to tor-key-forgeDavid Goulet2024-09-041-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* tor-keymgr: Use tor-keys crate and remove dead codeDavid Goulet2024-09-041-1/+2
| | | | | | | | | | | Everything copied in the previous commits to tor-keys is now removed and tor-keys crate is used accross the code. Minor changes to tor-keys to accomodate this change. Part of #1137 Signed-off-by: David Goulet <[email protected]>
* tor-keymgr: Remove unnecessary io::Error handling.Gabriela Moldovan2024-08-081-6/+0
| | | | | | `fs-mistrust` always maps `io::ErrorKind::NotFound` to `fs_mistrust::Error::NotFound`, so these `io::ErrorKind::NotFound` branches were unreachable.
* tor-keymgr: Use CheckedDir::metadata() instead of PathBuf::try_exists().Gabriela Moldovan2024-08-081-12/+43
| | | | | We now use `CheckedDir::metadata()` to check if the path exists and is of the correct type.
* tor-keymgr: Use the new relative path wrapper (fmt).Gabriela Moldovan2024-08-081-9/+15
|