| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
| |
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`.
|
| | |
|
| | |
|
| |
|
|
| |
(These were broken by recent MRs so don't need a CHANGELOG update in !1950.)
|
| | |
|
| |
|
|
|
|
|
| |
This will be returned by `KeyMgr::generate` if the key to be generated
already exists and `overwrite` is `false`.
Part of #1074
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This will make it easier to replace `ArtiPathComponent` with `Slug`
later down the line.
Note this changes the syntax rules of `ArtiPathComponent`:
* previously `ArtiPathComponent`s could be unicode strings,
(now they are lowercase ASCII alphanumerics, plus `-`, `_`)
* previously `ArtiPathComponent`s couldn't start with `-` or `_`,
but now they can
Part of #1193, #1092
|
| | |
|
| |
|
|
|
| |
The previous name was ambiguous, and confusable with KeyPathError
(of which it is, basically, a variant).
|
| |
|
|
|
|
|
|
| |
This is a variant in KeyPathError, which contains the actual wrong
value, and the key name. But it is also a unit struct to return from
the trait impl.
This replaces ArtiPathError::InvalidDenotator.
|
| |
|
|
|
|
| |
This is a hostage to fortune.
(In a previous version of !1796 I wanted to make it untrue.)
|
| |
|
|
|
| |
This is a separate class of errors that deserves its own error type. We
will soon use `KeyPathError` in other contexts as well.
|
| |
|
|
|
|
|
| |
These impl only exist because they were needed back when we didn't
have the `tor_keymgr::Error` enum and all errors _had_ to implement
`KeystoreError`. They are not used or required anymore, so let's remove
them.
|
| | |
|
| |
|
|
|
|
| |
`KeystoreCorruptionError` is now part of `tor_keymgr::Error` and no
longer implements `KeystoreError` (the `KeystoreError` trait is now only
for keystore-specific errors).
|
| |
|
|
| |
We don't use this anymore.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
KeystoreCorruptionError is about to become a variant of the top-level
keymgr Error enum (which doesn't exist yet but will be introduced in a
future commit).
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
We've been capitalizing the "s" in "KeyStore" inconsistently. This
`s/KeyStore/Keystore/g` across the codebase.
|
| |
|
|
| |
These were tackled in #901.
|
| | |
|
| |
|
|
|
| |
The `source` impl `tor_keymgr::Error` was just calling itself
recursively.
|
| | |
|
| |
|
|
|
|
| |
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).
|
| |
|
|
| |
Part of #901
|
| |
|
|
|
|
|
| |
This also implements `AsRef<StdError>` for `Bug` to satisfy the
`KeystoreError: AsRef<dyn StdError>` trait bound.
Part of #901
|
| |
|
|
|
|
| |
The new `BoxedError` type will replace `tor_keymgr::Error`.
Part of #901
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This will be useful later, when `KeyMgr` will start validating
permissions and paths.
|
| |
|
|
|
|
| |
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).
|
| | |
|
|
|
This adds implementation stubs for `ArtiNativeKeyStore`, and introduces
the traits needed to make the `KeyStore` APIs work.
|