| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
| |
Closes #1362 #1367
|
| |
|
|
|
| |
I think it makes more sense for parse_ssh_format_erased to be a function
of the key than of `KeyType`.
|
| |
|
|
|
|
|
|
|
|
| |
`UnparsedOpenSshKey` was originally only meant to be used for the
`ArtiNativeKeystore`.
I am about to make it private to the arti module, so I'm updating the
ephemeral keystore tests to not use it.
Part of #1362
|
| |
|
|
|
|
|
| |
This doesn't need to be public anymore now that the test keys are
exported from `test_utils`.
Addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2076#note_3016577
|
| |
|
|
|
|
|
| |
This is used by `ArtiNativeKeystore` and the `EphemeralKeystore`.
Moving it to test_utils means `EphemeralKeystore` no longer needs to
import test helpers from the arti module.
|
| |
|
|
|
| |
Closes #1363 and addresses a handful of TODOs about `include_str!`ing
the same key multiple times from various test modules.
|
| | |
|
| | |
|
| |
|
|
|
| |
Change Path::display to this new function, in call sites where it's
being used for a diagnostic.
|
| |\
| |
| |
| |
| | |
Fix rust-analyzer problems seen with default features on Windows
See merge request tpo/core/arti!2009
|
| | |
| |
| |
| |
| | |
The PermissionsExt::from_mode function is not available on Windows and
disabled in all other places of the file. Do so here as well.
|
| |/
|
|
|
|
|
| |
The slugs used for ArtiPath must be separated by slashes, which Windows
systems wouldn't do properly because paths are separated by backslashes.
Implement a platform-independent way of slug creation.
|
| |
|
|
| |
Closes #1215
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
The previous name was ambiguous, and confusable with KeyPathError
(of which it is, basically, a variant).
|
| |
|
|
|
|
|
| |
`ArtiNativeKeystore::list` now returns an error if the parent directory
of any of its keys doesn't pass the `CheckedDir::read_dir` validation.
Part of #1117
|
| |
|
|
|
|
|
| |
This updates `ArtiNativeKeystore` to use the new `remove_file` API from
arti!1759.
Part of #1117
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
An `SshKeyError` *is* an Arti keystore error, so let's unify the two.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are 2 reasons to make this change:
* because having the word `private` in the extension will make it more
difficult to accidentally misuse or misplace a private key (see
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1618#note_2947461)
* because `Keystore`s will soon grow a `list()` function returning all
`(ArtiPath, KeyType)`s in the keystore, and in order for
`ArtiNativeKeystore` to implement this function, it will need to be
able to reverse the `KeyType -> file extension` mapping (if two
different `KeyType`s are mapped to the same extension,
`ArtiNativeKeystore`s won't be able to reverse the mapping)
|
| | |
|
| |
|
|
|
| |
This function no longer returns `KeypairData` (it now returns
`SshKeyData`).
|
| |
|
|
|
|
|
|
|
| |
Previously, `EncodableKey::to_keypair_data` could only be used for
encoding private keys (its return type was `KeypairData`). Now
`EncodableKey::to_keypair_data` can return public key data (`KeyData`)
too.
Note: `to_keypair_data()` will be renamed in a future commit.
|
| |
|
|
|
|
|
|
| |
The underlying representation of an `UnparsedOpenSshKey` is now a
`String`. This will make it easier to support storing public keys in the
keystores: in the future, we will use `PublicKey::from_openssh` to parse
public keys, and `PublicKey::from_openssh` expects a string slice
(unlike `PrivateKey::from_openssh`, which takes a `&[u8]`).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
StaticSecret.
Previously, when retrieving `KS_hsc_desc_enc` keys (or any other x25519
keys) from the keystore, the keymgr would discard the public part of the
key (SSH private keys contain the public part of the key too). Instead
of discarding the public key and returning just the `StaticSecret`, the
keymgr now returns a `StaticKeypair`. This makes the x25519
`EncodableKey`/`ToEncodableKey` implementation consistent with the
ed25519 one (which retrieves key pairs rather than "unescorted"
secrets).
|
| |
|
|
| |
The privateness of the keys is encoded in their name.
|
| | |
|
| |
|
|
|
|
|
|
| |
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
|
| | |
|
| |
|
|
|
|
|
|
| |
This function isn't actually needed (it's not the responsibility of
`KeyType` to encode keys).
This commit also rewrites `ArtiNativeKeystore::insert` to use the new
`as_ssh_keypair_data` function instead of `to_ssh_format`.
|
| | |
|
| | |
|
| | |
|
| | |
|