| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
We need to be able to store `HsBlindIdKeypair`s in the keystore, and
since blinded keys are expanded e25519 keypairs which don't have a
"standard" OpenSSH key encoding, we define a custom
`[email protected]` SSH key type for this purpose.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
We will need to add another variant to this when we add support for
certificates.
|
| |/ |
|
| |
|
|
|
| |
This function no longer returns `KeypairData` (it now returns
`SshKeyData`).
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This rewrites `KeyType::parse_ssh_format_erased` to use the new
`parse_openssh!` macro.
|
| |
|
|
|
|
|
|
|
| |
`KeyType::parse_ssh_format_erased` currently only handles private keys.
The code for parsing public keys is very similar, so we introduce a
macro to avoid code duplication.
Note: the macro is currently unused (it will be used in a future
commit).
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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 (fmt).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
| |
And add a TODO about the error type.
|
| | |
|
| |
|
|
|
| |
Nightly rustdoc now warns if you have a link that isn't necessary,
and if you have a link that might refer to two different things.
|
| |
|
|
| |
This comment will form the basis for the protocol name registry.
|
| |
|
|
|
|
|
|
|
|
| |
The `KeypairData` type from [ssh-key] at some point leaked into the
keymgr API (via the `EncodableKey` trait). Instead of re-exporting just
`KeypairData`, let's re-export the entire `ssh_key` crate
(`EncodableKey` implementors would need additional types from `ssh_key`
to construct a `KeypairData` object anyway).
[ssh-key]: https://crates.io/crates/ssh-key
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This helper is no longer needed (the logic from
`parse_ssh_format_erased` changed).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the Arti key store would store x25519 secret keys as ed25519
OpenSSH keys, which it would convert to x25519 upon loading (using the
conversion function added in !1297 (merged)). This approach isn't good
enough though: most people will probably want to bring their existing
x25519 keys, and in order to store those in OpenSSH format, we'd need
convert them to ed25519, which is impossible (because the secret part of
an x25519 key contains a SHA512'd secret, whereas the corresponding,
"un-expanded", ed25519 secret key contains the secret itself rather than
the SHA).
Now that `ssh-key` has support for ssh keys with [custom algorithm
names], we can store x25519 in OpenSSH format directly. This commit
changes the storage format used by the keymgr for x25519 client auth
keys (from ed25519-ssh to our own custom key type with an algorithm name
of `"[email protected]"`).
Closes #936
[custom algorithm names]: https://github.com/RustCrypto/SSH/pull/136
|
| |
|
|
| |
This brings in the changes from #936.
|
| |
|
|
|
|
|
|
| |
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`.
|
| |
|
|
|
|
|
|
|
|
|
| |
The `EncodableKey::to_bytes` function didn't make much sense, because
not all keys have a canonical byte representation.
This commit replaces `EncodableKey::to_bytes` with
`EncodableKey::as_ssh_keypair_data`. In the future, `EncodableKey` will
grow functions for encoding keys in other storage formats too.
Closes #965
|
| | |
|
| | |
|
| | |
|