aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-keymgr: Use a macro to declare the KeyType enum (fmt).Gabriela Moldovan2023-10-241-46/+46
|
* tor-keymgr: Use a macro to declare the KeyType enum.Gabriela Moldovan2023-10-241-40/+62
| | | | | The bad identation is there to make reviewing the diff easier (the macro will be reindented in a future commit).
* tor-keymgr: Stop open-coding range operations.Gabriela Moldovan2023-10-241-6/+1
|
* tor-keymgr: Rename key_stores to secondary_stores for clarity.Gabriela Moldovan2023-10-241-8/+8
| | | | | | The name `key_stores` was a bit misleading, as this field only contains the _secondary_ key stores (the primary/default key store is stored in a separate field).
* tor-keymgr: list() should include the keys from the default key store.Gabriela Moldovan2023-10-241-2/+1
| | | | | `KeyMgr::list()` was supposed to look in _all_ key stores, not just the secondary ones.
* tor-keymgr: Remove now-outdated TODO HSS.Gabriela Moldovan2023-10-241-9/+0
| | | | Key file extensions now have `_private`/`_public` suffixes again.
* tor-keymgr: Add TODO explaining why we're not using strum.Gabriela Moldovan2023-10-241-0/+7
|
* tor-keymgr: Use the right extension for expanded ed25519 keys.Gabriela Moldovan2023-10-241-1/+1
| | | | | | This line was out of sync with `KeyType::arti_extension`, which uses `ed25519_expanded_private` as the extension (and not `ed25519_expanded`).
* tor-keymgr: Fix substring bounds check.Gabriela Moldovan2023-10-241-1/+16
| | | | The upper limit is exclusive, so this condition was off by one.
* tor-keymgr: Add tests for get_or_generate.Gabriela Moldovan2023-10-191-0/+63
|
* tor-keymgr: Add KeyMgr::get_or_generate.Gabriela Moldovan2023-10-191-0/+23
|
* tor-keymgr: Add get_or_create_with_derived.Gabriela Moldovan2023-10-191-0/+34
|
* tor-keymgr: Fix broken doc link.Gabriela Moldovan2023-10-191-1/+1
|
* tor-keymgr: Rename KeyPathError to ArtiPathUnavailableError (fmt).Gabriela Moldovan2023-10-195-11/+23
|
* tor-keymgr: Rename KeyPathError to ArtiPathUnavailableError.Gabriela Moldovan2023-10-194-16/+16
|
* tor-keymgr: Remove From<ArtiPathError> impl for KeyPathError.Gabriela Moldovan2023-10-191-6/+0
|
* tor-keymgr: Make KeyType::Unknown a fields-variant.Gabriela Moldovan2023-10-192-10/+16
| | | | | This makes it clearer than the underlying `String` represents the `arti_extension` of the key.
* tor-keymgr: Expand on the KeyPathError docs.Gabriela Moldovan2023-10-191-0/+3
|
* tor-keymgr: Apply cargo fmt.Gabriela Moldovan2023-10-193-8/+11
|
* tor-keymgr: Make error handling less repetitive using a closure.Gabriela Moldovan2023-10-191-9/+8
|
* tor-keymgr: Rework the ArtiPath error types.Gabriela Moldovan2023-10-193-22/+30
|
* tor-keymgr: Add TODO about removing metadata handling from keymgr.Gabriela Moldovan2023-10-191-0/+3
|
* tor-keymgr: Add TODO about using derive-adhoc.Gabriela Moldovan2023-10-191-0/+2
|
* tor-keymgr: Add KeyPathPattern constructor that does not match any valid paths.Gabriela Moldovan2023-10-191-0/+7
|
* tor-keymgr: Add a get_with_type keymgr function.Gabriela Moldovan2023-10-191-1/+28
|
* tor-keymgr: Add KeyMgr::list_matching for retrieving keys that match a given ↵Gabriela Moldovan2023-10-192-3/+33
| | | | pattern.
* tor-keymgr: Add function for listing all entries in a keystore.Gabriela Moldovan2023-10-193-5/+163
|
* tor-keymgr: Add From<&str> impl for KeyType.Gabriela Moldovan2023-10-191-0/+45
|
* tor-keymgr: Give KeyType an Unknown variant.Gabriela Moldovan2023-10-197-95/+121
|
* tor-keymgr: Add matching functionality and types for representing patterns.Gabriela Moldovan2023-10-192-1/+76
|
* tor-keymgr: Implement KeySpecifier for ArtiPath, CTorPath, KeyPath.Gabriela Moldovan2023-10-191-0/+36
| | | | | | | Many keymgr APIs require a `&dyn KeySpecifier`, which essentially represents an `ArtiPath` and an optional `CTorPath`. Implementing `KeySpecifier` for `ArtiPath`/`CTorPath`/`KeyPath` will enable keymgr users to pass a `ArtiPath`/`CTorPath`/`KeyPath` to these APIs.
* tor-keymgr: Use ArtiPathError for invalid ArtiPaths (fmt).Gabriela Moldovan2023-10-191-2/+10
|
* tor-keymgr: Use ArtiPathError for invalid ArtiPaths.Gabriela Moldovan2023-10-193-65/+112
|
* tor-keymgr: Add an error type for invalid key paths.Gabriela Moldovan2023-10-191-1/+29
|
* tor-keymgr: Add ArtiPathError, KeyPathError (fmt).Gabriela Moldovan2023-10-191-1/+3
|
* tor-keymgr: Add ArtiPathError, KeyPathError.Gabriela Moldovan2023-10-192-1/+34
|
* tor-keymgr: Add an enum for representing an ArtiPath or a CTorPath.Gabriela Moldovan2023-10-192-2/+30
| | | | | | This will enable the future `KeyMgr::list_matching()` API to return a list that contains results from (potentially) multiple different keystore backends.
* tor-keymgr: Add some more derives for ArtiPath and CTorPath.Gabriela Moldovan2023-10-191-2/+2
|
* tor-keymgr: Disallow consecutive . in pathsNeel Chauhan2023-10-161-6/+6
|
* tor-keymgr: Encode whether the key is public or private in the file extension.Gabriela Moldovan2023-10-132-5/+7
| | | | | | | | | | | | | | 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)
* tor-keymgr: Make generate_with_derived validate any existing key pairs.Gabriela Moldovan2023-10-091-4/+40
|
* tor-keymgr: Add KeyMgr::generate_with_derived for generating keypairs.Gabriela Moldovan2023-10-091-6/+130
| | | | | | | | | | | | | | | | When generating a keypair, `KeyMgr::generate` inserts a single entry representing the keypair into the keystore. However, for some keypairs, the keystore will need contain a separate entry containing just the public part of the keypair. This commit introduces `KeyMgr::generate_with_derived`, which generates 2 entries in the specified keystore: one for the keypair and another for the public key, which makes it easier to insert keypairs and their corresponding public keys into the keystore without to fall out of sync. Previously, generating a (public, private) keypair involved generating a new keypair with `KeyMgr::generate` and manually inserting the corresponding public key entry.
* tor-keymgr: Factor the generate() function into a separate trait.Gabriela Moldovan2023-10-093-51/+52
| | | | | | `EncodableKey` is a trait for encoding keypairs and public keys. Keygen only makes sense for key_pairs_ (it doesn't make sense for public keys), so it makes sense to move `generate()` out of `EncodableKey`,
* tor-keymgr: Implement ArtiNativeKeystore::insert for public keys.Gabriela Moldovan2023-10-031-3/+7
|
* tor-hsservice: Add more key roles.Gabriela Moldovan2023-10-031-2/+26
| | | | | | This adds a couple of new `HsSvcKeyRoles` for: * `KS_hs_id` keypairs * `KP_hs_blind_id` public keys keys
* Merge branch 'keymgr-blinded-keys' into 'main'gabi-2502023-09-263-27/+162
|\ | | | | | | | | tor-keymgr: Support storing `ed25519::ExpandedKeypair`s in the keystore See merge request tpo/core/arti!1619
| * tor-keymgr: Fix clippy warning (fmt).Gabriela Moldovan2023-09-261-4/+1
| |
| * tor-keymgr: Fix clippy warning.Gabriela Moldovan2023-09-261-1/+1
| |
| * tor-keymgr: Add a TODO regarding parsing errors.Gabriela Moldovan2023-09-261-0/+3
| |
| * tor-keymgr: Test expanded expanded-ed25519 SSH key parsing.Gabriela Moldovan2023-09-261-0/+30
| |