aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * tor-keymgr: Extend parse_openssh! to support expanded ed25519 keypairs.Gabriela Moldovan2023-09-261-5/+46
| |
| * tor-keymgr: Implement EncodableKey for ExpandedKeypair.Gabriela Moldovan2023-09-263-6/+44
| |
| * tor-keymgr: Assign a custom algorithm name for expanded ed25519 keys.Gabriela Moldovan2023-09-261-16/+42
| | | | | | | | | | | | | | 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.
* | tor-keymgr: Add TODO about key file extensions.Gabriela Moldovan2023-09-261-0/+9
| |
* | tor-keymgr: Make SshKeyData accessors more idiomatic.Gabriela Moldovan2023-09-262-9/+11
| |
* | tor-keymgr: Fix broken doc link.Gabriela Moldovan2023-09-261-1/+1
| |
* | tor-keymgr: Make SshKeyData non-exhaustive.Gabriela Moldovan2023-09-261-1/+1
| | | | | | | | | | We will need to add another variant to this when we add support for certificates.
* | tor-keymgr: Derive Clone, Debug for SshKeyData.Gabriela Moldovan2023-09-261-1/+1
|/
* tor-keymgr: Rename as_ssh_keypair_data to as_ssh_key_data.Gabriela Moldovan2023-09-263-8/+8
| | | | | This function no longer returns `KeypairData` (it now returns `SshKeyData`).
* tor-keymgr: Add tests for OpenSSH public key parsing.Gabriela Moldovan2023-09-261-0/+26
|
* tor-keymgr: Use a macro to make the tests less repetitive.Gabriela Moldovan2023-09-261-33/+45
|
* tor-keymgr: Add TODO about rethinking KeyType.Gabriela Moldovan2023-09-261-0/+8
|
* tor-keymgr: Make parse_ssh_format_erased handle public keys too (fmt).Gabriela Moldovan2023-09-261-8/+15
|
* tor-keymgr: Make parse_ssh_format_erased handle public keys too.Gabriela Moldovan2023-09-261-57/+5
| | | | | This rewrites `KeyType::parse_ssh_format_erased` to use the new `parse_openssh!` macro.
* tor-keymgr: Add helpers for parsing OpenSSH public and private keys.Gabriela Moldovan2023-09-261-0/+103
| | | | | | | | | `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).
* tor-keymgr: Implement ToEncodableKey for HsIdKey.Gabriela Moldovan2023-09-251-3/+3
|
* tor-keymgr: Implement EncodableKey for ed25519 public keys.Gabriela Moldovan2023-09-251-3/+5
|
* tor-keymgr: Implement EncodableKey for x25519 public keys.Gabriela Moldovan2023-09-251-0/+26
|
* tor-keymgr: Add KeyType variants for public keys.Gabriela Moldovan2023-09-252-4/+15
|
* tor-keymgr: Make EncodableKey support public keys too.Gabriela Moldovan2023-09-254-22/+61
| | | | | | | | | 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.
* tor-keymgr: Represent unparsed ssh key as strings.Gabriela Moldovan2023-09-252-10/+10
| | | | | | | | 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]`).
* tor-hsclient, arti-client, tor-keymgr, tor-netdoc: Use a keypair instead of ↵Gabriela Moldovan2023-09-252-4/+8
| | | | StaticSecret (fmt).
* tor-hsclient, arti-client, tor-keymgr, tor-netdoc: Use a keypair instead of ↵Gabriela Moldovan2023-09-254-20/+29
| | | | | | | | | | | | | 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).
* tor-hsservice: Support storing desc signing keys in the keystore.Gabriela Moldovan2023-09-221-1/+14
|
* tor-hsservice: Support storing HsIdKeys in the keystore.Gabriela Moldovan2023-09-221-1/+35
|
* tor-hsservice: Add key specifier for blinded_id keypairs.Gabriela Moldovan2023-09-221-1/+13
|
* tor-keymgr: Remove redundant _private suffix from key extension.Gabriela Moldovan2023-09-122-4/+4
| | | | The privateness of the keys is encoded in their name.
* tor-keymgr, tor-hsservice: Run rustfmt to make derives uglierIan Jackson2023-08-231-3/+13
|
* tor-keymgr, tor-hsservice: deser for ArtiPathComponent and HsNicknameIan Jackson2023-08-231-0/+25
|
* tor-keymgr: Improve ArtiPathComponent a bitIan Jackson2023-08-231-0/+15
| | | | And add a TODO about the error type.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-235-0/+5
|
* Resolve warnings about ambiguous/redundant doc linksNick Mathewson2023-08-221-1/+1
| | | | | 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.
* keymgr: Write a registry sketch.Gabriela Moldovan2023-08-161-2/+49
| | | | This comment will form the basis for the protocol name registry.
* tor-keymgr: Re-export ssh-key.Gabriela Moldovan2023-08-163-13/+14
| | | | | | | | | | 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
* keymgr: Implement as_ssh_keypair_data for curve25519 keys.Gabriela Moldovan2023-08-161-4/+13
|
* keymgr: Import internal! (fmt).Gabriela Moldovan2023-08-161-4/+2
|
* keymgr: Import internal!.Gabriela Moldovan2023-08-161-3/+3
|
* keymgr: Remove unused helper.Gabriela Moldovan2023-08-161-33/+0
| | | | | This helper is no longer needed (the logic from `parse_ssh_format_erased` changed).
* tor-keymgr: Test x25519 key parsing.Gabriela Moldovan2023-08-161-0/+30
|
* keymgr: Do not expect x25519 keys to be stored as ed25519 ssh keys.Gabriela Moldovan2023-08-161-13/+48
| | | | | | | | | | | | | | | | | | | | | | 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
* keymgr: Bump ssh-key to 0.6.0.Gabriela Moldovan2023-08-161-1/+10
| | | | This brings in the changes from #936.
* tor-error: Remove KeystoreFsPermissions variant.Gabriela Moldovan2023-08-081-1/+1
| | | | | | | | 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
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* keymgr: Add TODO regarding SshEncodableKey impl for x25519.Gabriela Moldovan2023-08-021-0/+1
|
* keymgr: Implement SshEncodableKey for ed25519::Keypair.Gabriela Moldovan2023-08-022-4/+10
|
* keymgr: Remove KeyType::to_ssh_format.Gabriela Moldovan2023-08-022-11/+15
| | | | | | | | 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`.
* keymgr: Replace EncodableKey::to_bytes() with SSH-specific function.Gabriela Moldovan2023-08-023-12/+18
| | | | | | | | | | | 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
* keymgr: Add TODO regarding generate() being racy.Gabriela Moldovan2023-07-271-0/+3
|
* keymgr: Document the TOCTOU issue with generate().Gabriela Moldovan2023-07-271-0/+16
|
* keymgr: Make the return value of generate() indicate if a new key was created.Gabriela Moldovan2023-07-271-3/+5
|