aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src/keystore/arti
Commit message (Collapse)AuthorAgeFilesLines
* arti, keymgr: s/IDEA/TODOGabriela Moldovan2026-06-171-1/+2
| | | | | | It's better to use "TODO" like we do in the rest of Arti, because otherwise this has a chance of being forgotten (because nobody really greps for "IDEA").
* arti: subcommands: keys: Rework output of keys listhjrgrn2026-06-171-0/+2
|
* 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.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Lay foundations for RSA keys in keystore.Wesley Aptekar-Cassels2025-09-301-4/+4
| | | | | | This currently can't be used due to upstream limitations in the ssh_key crate, which will be removed likely in the next release. In the meantime, we can put in all the groundwork.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | 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-2/+8
| | | | | | | | | | | | | | | | | | | * 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>>>`
* Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-091-1/+1
| | | | Made with https://crates.io/crates/typos-cli
* tor-keymgr: keystore::arti::ssh: Fix typo; simplify comments.playbahn2025-03-271-8/+7
| | | | Closes #1455
* tor-keymgr: keystore::arti::ssh: Rework tests: ssh-keygen interopplaybahn2025-03-261-37/+115
| | | | Part of #1455 [PATCH 3(v3)/4]
* tor-keymgr: keystore::arti::ssh: Rework ssh-keygen interop testsplaybahn2025-03-261-30/+52
| | | | Part of #1455 [PATCH 3(v2)/4]
* tor-keymgr: Remove unused importsplaybahn2025-03-261-1/+0
| | | | _sigh_
* tor-keymgr: keystore::arti::ssh: Add tests for ssh-keygen interopplaybahn2025-03-261-0/+61
| | | | | | | | | | | | Part of #1455 [PATCH 3/4] Abstract of the test(s): Encoded (key) A -> Decoded (key) A Decoded A -> Encoded B Encoded B -> Decoded B Assert that Decoded A == Decoded B
* tor-keymgr: Rename test constants to match file names.Gabriela Moldovan2025-02-061-15/+15
| | | | Part of #1396
* tor-keymgr: Use ParsedEd25519Cert when decoding certs.Gabriela Moldovan2025-01-131-2/+2
| | | | | | | 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: Use Ed25519Cert::decode to parse the certs.Gabriela Moldovan2025-01-131-4/+10
|
* tor-keymgr: Add cert parse error variant.Gabriela Moldovan2025-01-131-2/+14
| | | | | | | This will soon be used, when we modify the `ArtiNativeKeystore` cert lookup code to actually parse certificates before returning them. Part of #1768
* tor-keymgr: Add arti native keystore helper for parsing tor certs.Gabriela Moldovan2024-12-041-0/+41
| | | | | We'll soon use this in `ArtiNativeKeystore`'s `Keystore` implementation for parsing certs read from disk.
* tor-key-forge: Remove no longer needed KeyType::Unknown variant.Gabriela Moldovan2024-12-041-14/+0
| | | | | Items that have an unrecognized file extension now get mapped to `KeystoreItemType::Unknown`.
* tor-keymgr: Refactor common fs errors into a separate error enum.Gabriela Moldovan2024-10-081-45/+4
| | | | | | | | 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: Move the checked_op utils out of the arti module.Gabriela Moldovan2024-10-081-75/+0
| | | | We are about to use this for the ctor keystore implementation too.
* Rename tor-keys crate to tor-key-forgeDavid Goulet2024-09-043-3/+3
| | | | Signed-off-by: David Goulet <[email protected]>
* tor-keymgr: Use tor-keys crate and remove dead codeDavid Goulet2024-09-043-9/+15
| | | | | | | | | | | 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: Use CheckedDir::metadata() instead of PathBuf::try_exists().Gabriela Moldovan2024-08-081-0/+5
| | | | | 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.Gabriela Moldovan2024-08-081-1/+0
|
* tor-keymgr: Add new rel_path module with helpers for handling relative paths.Gabriela Moldovan2024-08-081-0/+75
|
* tor-keymgr: Correct message for mistrust errorIan Jackson2024-07-101-2/+2
|
* tor-keymgr: Add script for generating test key files.Gabriela Moldovan2024-05-151-0/+6
| | | | | | | | | | | `tor-keymgr/testdata` contains a bunch of OpenSSH keys used for testing. I meant to share the script I generated them with, but somehow never got around to it. Note: the OpenSSH keys generated by this script are going to look slightly different than the ones that are checked into the repo. This is because some of those original key files were generated ad-hoc (I manually modified them a while ago, but I forgot exactly how
* tor-keymgr: Make SshKeyData an opaque type.Gabriela Moldovan2024-05-071-2/+2
| | | | | | This helps prevent external users from creating `SshKeyData` out of unsupported types of `ssh_key::public::KeyData` and `ssh_key::private::KeypairData`.
* tor-keymgr: Do not make SshKeyData infallibly convertible from ↵Gabriela Moldovan2024-05-071-4/+4
| | | | KeyData/KeypairData.
* tor-keymgr: Dedupe all the convert functions.Gabriela Moldovan2024-05-072-141/+17
|
* tor-keymgr: Make an ArtiNativeKeystore-specific function private.Gabriela Moldovan2024-05-071-20/+16
| | | | | | | The `ssh_algorithm()` function was only meant for use in the ArtiNativeKeystore, for extracting the `KeyType` given the `SshAlgorithm` of a key read from disk, so it really shouldn't be crate-public.
* tor-keymgr: Move arti-specific ssh code to arti module.Gabriela Moldovan2024-05-072-1/+395
| | | | | | | | | Some of the types and impls from `key_type/ssh.rs` (such as `UnparsedOpenSshKey`) have nothing to do with `KeyType`, and are only used by the `ArtiNativeKeystore`, so I'm moving them to the `arti` keystore module. The shared ssh-related stuff now lives in the top-level `ssh.rs`.
* tor-keymgr: Use keystore_error_kind() to get the error kind.Gabriela Moldovan2024-01-151-1/+2
| | | | Closes #1215
* tor-keymgr: path errors: Add some xrefsIan Jackson2023-12-071-1/+6
|
* tor-keymgr: ArtiPathSyntaxError: rename from ArtiPathErrorIan Jackson2023-12-071-2/+2
| | | | | The previous name was ambiguous, and confusable with KeyPathError (of which it is, basically, a variant).
* tor-keymgr: Add an Arti keystore error type for keys with invalid key data.Gabriela Moldovan2023-11-211-0/+5
|
* tor-keymgr: Add a top-level error type.Gabriela Moldovan2023-11-211-0/+6
| | | | | | | | | | | | | Previously, the `tor_keymgr::Error` type was `Box<dyn KeystoreError>`. This forced us to impl `KeystoreError` for any error returned by the keymgr (including those that were not coming from a `Keystore` impl). Now, `tor_keymgr::Error` is an non-exhaustive enum and the `Box<dyn KeystoreError>` opaque error type is only returned from `Keystore` impls The reason we're keeping the `dyn KeystoreError` error type is because it enables `Keystore` implementors to use their own error types. Without it, they would have to choose from our (closed) set of error variants, which may not be suitable for their keystore. See #901.
* tor-keymgr: Inline SshKeyError variants into ArtiNativeKeystoreError.Gabriela Moldovan2023-11-201-2/+29
| | | | An `SshKeyError` *is* an Arti keystore error, so let's unify the two.
* tor-keymgr: Fix broken doc link.Gabriela Moldovan2023-10-191-1/+1
|
* tor-keymgr: Apply cargo fmt.Gabriela Moldovan2023-10-191-1/+1
|
* tor-keymgr: Rework the ArtiPath error types.Gabriela Moldovan2023-10-191-6/+5
|
* tor-keymgr: Give KeyType an Unknown variant.Gabriela Moldovan2023-10-191-1/+6
|
* tor-keymgr: Add an error type for invalid key paths.Gabriela Moldovan2023-10-191-1/+29
|
* tor-error: Remove KeystoreFsPermissions variant.Gabriela Moldovan2023-08-081-1/+1
| | | | | | | | According to the `ErrorKind` lumping guidelines, `KeystoreFsPermissions` should be lumped with `FsPermissions`: they represent the same type of error, and their "location" is the same ("Host"). Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1315#note_2916455
* keymgr: Rename KeyStore to Keystore globally.Gabriela Moldovan2023-06-291-3/+3
| | | | | We've been capitalizing the "s" in "KeyStore" inconsistently. This `s/KeyStore/Keystore/g` across the codebase.
* keymgr: Implement HasKind for ArtiNativeKeystoreError.Gabriela Moldovan2023-06-281-2/+7
|
* keymgr: Remove AsRef<dyn StdError> trait bound and unneeded impls.Gabriela Moldovan2023-06-261-7/+0
| | | | | | We don't really need the `AsRef<dyn StdError>` impls if we make `StdError` a supertrait of `KeystoreError` (and remove the `AsRef<dyn StdError>` trait bound).
* keymgr: Add the path to ArtiNativeKeystoreError Display impl.Gabriela Moldovan2023-06-261-3/+3
|
* keymgr: Replace Error with Box<dyn KeystoreError>.Gabriela Moldovan2023-06-261-2/+0
| | | | Part of #901