summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr
Commit message (Collapse)AuthorAgeFilesLines
...
| * keymgr: Add support for x25519 keys.Gabriela Moldovan2023-06-272-12/+10
| |
| * keymgr: Return a concrete type from read_ed25519_keypair.Gabriela Moldovan2023-06-271-8/+9
| | | | | | | | | | This also fixes a bug which caused the function to always return a type-erased `()` instead of the actual key!
| * keymgr: Move TODO closer to the code it refers to.Gabriela Moldovan2023-06-271-10/+9
| |
| * keymgr: Map KeyType::X25519StaticSecret to an SshKeyAlgorithm.Gabriela Moldovan2023-06-271-1/+1
| |
| * keymgr: Define an SshKeyAlgorithm enum.Gabriela Moldovan2023-06-271-2/+40
| | | | | | | | | | | | | | | | | | This previously just re-exported `ssh_key::Algorithm`. However, we will need to support x25519 keys (which aren't supported by the `ssh_key` crate), so we define our own enum for the key algorithm. In addition to the `Algorithm` variants from `ssh_key`, our enum also has an `X25519` variant.
* | keymgr: Downgrade "TODO hs" to "TODO HSS".Gabriela Moldovan2023-06-283-5/+5
| | | | | | | | | | These TODOs can be deferred for now: we're not declaring the keymgr APIs stable until we add support for hidden services.
* | keymgr: Downgrade some TODOs to "TODO HSS".Gabriela Moldovan2023-06-282-6/+6
| | | | | | | | These don't need to be blockers for the next release.
* | keymgr: Remove outdated TODOs regarding error handling.Gabriela Moldovan2023-06-282-4/+0
| | | | | | | | These were tackled in #901.
* | keymgr: Implement HasKind for ArtiNativeKeystoreError.Gabriela Moldovan2023-06-281-2/+7
| |
* | keymgr: Implement HasKind for SshKeyError.Gabriela Moldovan2023-06-281-2/+1
|/
* keymgr: Add regression test for tor_keymgr::Error recursion bug.Gabriela Moldovan2023-06-271-0/+39
|
* keymgr: Fix infinite recursion in Error impl.Gabriela Moldovan2023-06-271-2/+1
| | | | | The `source` impl `tor_keymgr::Error` was just calling itself recursively.
* keymgr: Document why we need the StdError impl for tor_keymgr::Error.Gabriela Moldovan2023-06-261-0/+5
|
* keymgr: Remove AsRef<dyn StdError> trait bound and unneeded impls.Gabriela Moldovan2023-06-264-22/+1
| | | | | | 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 file path to SshKeyError context.Gabriela Moldovan2023-06-262-9/+29
|
* keymgr: Add the path to ArtiNativeKeystoreError Display impl.Gabriela Moldovan2023-06-261-3/+3
|
* keymgr: Replace Error with Box<dyn KeystoreError>.Gabriela Moldovan2023-06-266-189/+74
| | | | Part of #901
* keymgr: Add helper for boxing SshKeyError.Gabriela Moldovan2023-06-261-0/+7
|
* keymgr: Implement KeystoreError for SshKeyError.Gabriela Moldovan2023-06-261-2/+18
|
* keymgr: Add some initial variants to SshKeyError.Gabriela Moldovan2023-06-261-1/+20
|
* keymgr: Define an error type for the ssh module.Gabriela Moldovan2023-06-261-0/+8
|
* keymgr: Define an error type for ArtiNativeKeyStore.Gabriela Moldovan2023-06-262-0/+75
| | | | Part of #901
* keymgr: Implement KeystoreError for Bug.Gabriela Moldovan2023-06-261-0/+2
| | | | | | | This also implements `AsRef<StdError>` for `Bug` to satisfy the `KeystoreError: AsRef<dyn StdError>` trait bound. Part of #901
* keymgr: Create a KeyStoreError trait for keystore errors.Gabriela Moldovan2023-06-263-1/+35
| | | | | | The new `BoxedError` type will replace `tor_keymgr::Error`. Part of #901
* keymgr: Remove blank line to satisfy maint/cargo_sort.Gabriela Moldovan2023-06-221-1/+0
|
* keymgr: Make the dummy types non_exhaustive.Gabriela Moldovan2023-06-221-0/+3
|
* keymgr: Add a TODO regarding missing dummy impls.Gabriela Moldovan2023-06-221-1/+3
|
* keymgr: Update outdated docs.Gabriela Moldovan2023-06-221-23/+10
|
* keymgr: Remove outdated TODOs.Gabriela Moldovan2023-06-221-9/+0
|
* keymgr: Remove unnecessary dummy types.Gabriela Moldovan2023-06-222-19/+4
| | | | We don't need dummy impls for `Error` and `Result`.
* keymgr: Move dummy implementation to tor-keymgr.Gabriela Moldovan2023-06-224-11/+157
|
* keymgr: Remove unnecessary pub(crate).Gabriela Moldovan2023-06-221-5/+5
|
* keymgr: Define a `keymgr` feature.Gabriela Moldovan2023-06-222-0/+22
| | | | | | | The dummy key manager impl from `arti-client` will be moved to `tor-keymgr` soon. This commit adds a `keymgr` feature flag to `tor-keymgr` which will eventually be used to choose between the real key manager API and the dummy one.
* keymgr: Downgrade 2 "TODO hs" to "TODO HSS".Gabriela Moldovan2023-06-222-2/+2
|
* keymgr: Remove outdated TODO.Gabriela Moldovan2023-06-221-1/+0
| | | | This TODO talks about a change we've decided not to implement.
* Merge branch 'stderr' into 'main'Alexander Færøy2023-06-211-0/+2
|\ | | | | | | | | lints: Promote clippy::print_stderr and clippy::print_stdout See merge request tpo/core/arti!1271
| * lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
| |
* | keymgr: Fix clippy lints.Gabriela Moldovan2023-06-211-1/+1
| |
* | keymgr: Remove outdated TODO.Gabriela Moldovan2023-06-211-2/+0
| | | | | | | | This TODO was addressed in #899
* | keymgr: Make ArtiNativeKeyStore::key_path() return a relative path.Gabriela Moldovan2023-06-211-15/+19
| | | | | | | | | | | | | | | | | | This also updates `ArtiNativeKeyStore`'s `KeyStore::remove` implementation to build the absolute path of the file being removed, by joining `self.keystore_dir` and the relpath returned by `ArtiNativeKeyStore::key_path()`. This addresses #908
* | keymgr: Derive Into for ArtiPath.Gabriela Moldovan2023-06-211-1/+1
| | | | | | | | | | Sometimes we need the underlying String (for example to create a PathBuf).
* | Merge branch 'keymgr-api-consistency' into 'main'Ian Jackson2023-06-214-43/+48
|\ \ | | | | | | | | | | | | keymgr: Remove Error::NotFound, update KeyMgr, KeyStore APIs. See merge request tpo/core/arti!1280
| * | keymgr: Remove Error::NotFound, update KeyMgr, KeyStore APIs.Gabriela Moldovan2023-06-214-43/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the `NotFound` `tor_keymgr::Error` variant. Since `KeyMgr` and `KeyStore` users will need to be able to distinguish between "not found" errors and other I/O errors, this also changes the return types of the `get()` and `remove()` functions of `KeyStore` and `KeyMgr`, which now return `Ok(None)` instead of `Error::NotFound`. This makes the `KeyStore` API consistent with `KeyMgr::get`, which already has a return type of `Result<Option<K>>` (rather than `Result<K>`). This also prepares us for #901, which will make key store errors opaque. Without this change: * we'd have to create a `struct NotFoundError;` error type. Its `HasKind` impl would need to return a new `ErrorKind::KeyStoreErrorNotFound` `ErrorKind` variant * callers would have to match the `error_kind()` of the error to figure out whether the key simply can't be found (`ErrorKind::KeyStoreErrorNotFound`), or if something went wrong (any other `ErrorKind`). Given the above, I think `Result<Option<()>>` makes for a more ergonomic API. Part of #901
* | | Merge branch 'keymgr-rm-cond' into 'main'Ian Jackson2023-06-211-10/+4
|\| | | | | | | | | | | | | | keymgr: Remove unnecessary condition. See merge request tpo/core/arti!1277
| * | keymgr: Remove unnecessary condition.Gabriela Moldovan2023-06-211-10/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't need to special-case `NotFound` errors because `ssh_key::PrivateKey::from_openssh` doesn't read from disk (so it shouldn't be returning `NotFound` errors in the first place). Previously, this condition made sense because we were using `ssh_key::PrivateKey::read_openssh_file` instead of `ssh_key::PrivateKey::from_openssh`, which _does_ read from disk. This condition should have been removed in !1263 (the refactoring where we switched to `from_openssh`). (Also, after #901 is implemented, we probably won't have an `Error::NotFound` error anymore).
* / keymgr: Remove outdated TODO.Gabriela Moldovan2023-06-211-8/+0
|/ | | | | This TODO describes something we're not planning to implement, so let's just remove it.
* keymgr: Fix clippy lints.Gabriela Moldovan2023-06-202-3/+3
|
* keymgr: Address clippy lints and run cargo fmt.Gabriela Moldovan2023-06-201-1/+6
|
* keymgr: Enforce keystore_dir properties for every key read/written from the ↵Gabriela Moldovan2023-06-201-16/+19
| | | | keystore.
* keymgr: Update function names and docs to reflect reality.Gabriela Moldovan2023-06-203-9/+9
| | | | | | The functions that handle OpenSSH-formatted keys now no longer read or write from disk. This commit updates their names and doc strings to stop suggesting they do.