summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* keymgr: Move FS operations out of ssh.rsGabriela Moldovan2023-06-203-17/+42
| | | | | | | This moves the filesystem calls from the `ssh` module to `ArtiNativeKeyStore`. While `ArtiNativeKeyStore` shouldn't be concerning itself with filesystem operations either, that refactoring will be tackled separately (see arti#899).
* keymgr: Create a temporary error type for the key types we don't support yet.Gabriela Moldovan2023-06-202-1/+9
|
* keymgr: Create a separate error source for key corruption errors.Gabriela Moldovan2023-06-202-37/+41
|
* Merge branch 'update-keymgr-todo' into 'main'Alexander Færøy2023-06-203-3/+4
|\ | | | | | | | | keymgr: Change "TODO hs" to "TODO HSS". See merge request tpo/core/arti!1264
| * keymgr: Defer key bundle support until "Basic Service" milestone.Gabriela Moldovan2023-06-202-2/+3
| | | | | | | | We don't really need "key bundles" for the client keys.
| * keymgr: Change "TODO hs" to "TODO HSS".Gabriela Moldovan2023-06-201-1/+1
| | | | | | | | | | We probably don't need to support passphrases for the "Basic Client" milestone, so let's update this TODO accordingly.
* | keymgr: Fix broken docs.Gabriela Moldovan2023-06-201-1/+1
| |
* | arti-client, keymgr: Introduce Mistrust settings and enforce FS permissions.Gabriela Moldovan2023-06-201-5/+35
| |
* | keymgr: Add TODO about separation of concerns wrt FS operations.Gabriela Moldovan2023-06-201-0/+8
| |
* | keymgr: Add an error variant for fs_mistrust errors.Gabriela Moldovan2023-06-202-0/+14
| | | | | | | | | | This will be useful later, when `KeyMgr` will start validating permissions and paths.
* | keymgr: Add a FsErrorSource to Error::Fs.Gabriela Moldovan2023-06-201-1/+21
|/ | | | | | In the future, the potential causes of an `Error::Filesystem` error will include permission errors as well as other errors (not just `io::Error`s).
* keymgr: Add Diziet's notes about storing public keys in the key store.Gabriela Moldovan2023-06-151-0/+36
|
* keymgr, arti-client: KeyMgr should return Ok(None) if the key is not found.Gabriela Moldovan2023-06-151-4/+4
| | | | | | | This simplifies usage quite a bit and will enable us to implement a dummy `KeyMgr` that doesn't depend on the error types from tor-keymgr (which will replace the "real" `KeyMgr` if the keymgr feature is disabled).
* keymgr: Add TODO regarding KeyStore rename.Gabriela Moldovan2023-06-151-0/+4
|
* keymgr: Add TODO about KeyType refactorings.Gabriela Moldovan2023-06-151-0/+3
|
* keymgr: Add the key type to the `arti_extension`.Gabriela Moldovan2023-06-151-1/+2
|
* keymgr: Add TODO regarding some error refactorings.Gabriela Moldovan2023-06-151-0/+14
|
* keymgr: Move the HS client and service key specifiers out of tor-keymgr.Gabriela Moldovan2023-06-153-115/+0
| | | | | | The HS `HsClientSpecifier` and `HsClientSecretKeySpecifier` are moved to `tor-hsclient`. The HS service secret key specifier stubs are moved to `tor-hsservice`.
* keymgr: Expand the TODOs regarding HS service key specifiers.Gabriela Moldovan2023-06-151-3/+18
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* keymgr: Expand HsClientSpecifier docs, add TODO about refactoring.Gabriela Moldovan2023-06-151-0/+7
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* keymgr: Introduce ToEncodableKey to simplify lookups.Gabriela Moldovan2023-06-153-13/+51
| | | | | | | This means `KeyMgr` users don't need to specify the underlying key type (e.g. `ed25519::Keypair`) when retrieving keys. Instead, they can just specify the type required (as long as it implements `ToEncodableKey`), e.g. `HsClientIntroAuthKeypair`.
* arti-client: Make the client use the KeyMgr.Gabriela Moldovan2023-06-151-0/+6
| | | | | `TorClient` now uses a `KeyMgr` to retrieve the `HsClientSecretKeys` client auth keys passed to `get_or_launch_connection`.
* keymgr: Add key manager implementation stub.Gabriela Moldovan2023-06-152-0/+114
|
* keymgr: Implement `SshKeyType::read_ssh_format_erased` for `KeyType`.Gabriela Moldovan2023-06-151-4/+49
| | | | | | | | | | | This adds a proof-of-concept `SshKeyType::read_ssh_format_erased` implementation for `KeyType`. The implementation decodes an OpenSSH key and converts it to one of the key types used internally by Arti. The value returned is type-erased, and will be downscast later down the line by the `KeyMgr` (note: `KeyMgr` doesn't exist yet). The `SshKeyType::write_ssh_format` will be implemented once these APIs are a bit more stable.
* keymgr: Add ArtiNativeKeyStore implementation skeleton.Gabriela Moldovan2023-06-1510-0/+558
This adds implementation stubs for `ArtiNativeKeyStore`, and introduces the traits needed to make the `KeyStore` APIs work.