| Commit message (Collapse) | Author | Age | Files | Lines | |
|---|---|---|---|---|---|
| * | tor-keymgr: Rename key_stores to secondary_stores for clarity. | Gabriela Moldovan | 2023-10-24 | 1 | -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 Moldovan | 2023-10-24 | 1 | -2/+1 |
| | | | | | | `KeyMgr::list()` was supposed to look in _all_ key stores, not just the secondary ones. | ||||
| * | tor-keymgr: Add tests for get_or_generate. | Gabriela Moldovan | 2023-10-19 | 1 | -0/+63 |
| | | |||||
| * | tor-keymgr: Add KeyMgr::get_or_generate. | Gabriela Moldovan | 2023-10-19 | 1 | -0/+23 |
| | | |||||
| * | tor-keymgr: Add get_or_create_with_derived. | Gabriela Moldovan | 2023-10-19 | 1 | -0/+34 |
| | | |||||
| * | tor-keymgr: Rename KeyPathError to ArtiPathUnavailableError (fmt). | Gabriela Moldovan | 2023-10-19 | 1 | -1/+1 |
| | | |||||
| * | tor-keymgr: Rename KeyPathError to ArtiPathUnavailableError. | Gabriela Moldovan | 2023-10-19 | 1 | -3/+3 |
| | | |||||
| * | tor-keymgr: Add TODO about removing metadata handling from keymgr. | Gabriela Moldovan | 2023-10-19 | 1 | -0/+3 |
| | | |||||
| * | tor-keymgr: Add a get_with_type keymgr function. | Gabriela Moldovan | 2023-10-19 | 1 | -1/+28 |
| | | |||||
| * | tor-keymgr: Add KeyMgr::list_matching for retrieving keys that match a given ↵ | Gabriela Moldovan | 2023-10-19 | 1 | -2/+32 |
| | | | | | pattern. | ||||
| * | tor-keymgr: Add function for listing all entries in a keystore. | Gabriela Moldovan | 2023-10-19 | 1 | -1/+6 |
| | | |||||
| * | tor-keymgr: Give KeyType an Unknown variant. | Gabriela Moldovan | 2023-10-19 | 1 | -22/+26 |
| | | |||||
| * | tor-keymgr: Use ArtiPathError for invalid ArtiPaths. | Gabriela Moldovan | 2023-10-19 | 1 | -7/+8 |
| | | |||||
| * | tor-keymgr: Make generate_with_derived validate any existing key pairs. | Gabriela Moldovan | 2023-10-09 | 1 | -4/+40 |
| | | |||||
| * | tor-keymgr: Add KeyMgr::generate_with_derived for generating keypairs. | Gabriela Moldovan | 2023-10-09 | 1 | -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 Moldovan | 2023-10-09 | 1 | -9/+15 |
| | | | | | | | `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: Make SshKeyData accessors more idiomatic. | Gabriela Moldovan | 2023-09-26 | 1 | -1/+1 |
| | | |||||
| * | tor-keymgr: Rename as_ssh_keypair_data to as_ssh_key_data. | Gabriela Moldovan | 2023-09-26 | 1 | -2/+2 |
| | | | | | | This function no longer returns `KeypairData` (it now returns `SshKeyData`). | ||||
| * | tor-keymgr: Make EncodableKey support public keys too. | Gabriela Moldovan | 2023-09-25 | 1 | -5/+5 |
| | | | | | | | | | | 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. | ||||
| * | Run maint/add_warning to add lint block everywhere | Ian Jackson | 2023-08-23 | 1 | -0/+1 |
| | | |||||
| * | tor-keymgr: Re-export ssh-key. | Gabriela Moldovan | 2023-08-16 | 1 | -3/+5 |
| | | | | | | | | | | | 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: Replace EncodableKey::to_bytes() with SSH-specific function. | Gabriela Moldovan | 2023-08-02 | 1 | -4/+8 |
| | | | | | | | | | | | | 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 Moldovan | 2023-07-27 | 1 | -0/+3 |
| | | |||||
| * | keymgr: Document the TOCTOU issue with generate(). | Gabriela Moldovan | 2023-07-27 | 1 | -0/+16 |
| | | |||||
| * | keymgr: Make the return value of generate() indicate if a new key was created. | Gabriela Moldovan | 2023-07-27 | 1 | -3/+5 |
| | | |||||
| * | keymgr: Make Keystore::generate() return a Result. | Gabriela Moldovan | 2023-07-27 | 1 | -3/+3 |
| | | |||||
| * | keymgr: Move duplicated match block to KeyMgr::select_keystore(). | Gabriela Moldovan | 2023-07-24 | 1 | -22/+14 |
| | | |||||
| * | keymgr: Add KeyMgr::generate() for generating new keys. | Gabriela Moldovan | 2023-07-24 | 1 | -1/+69 |
| | | |||||
| * | keymgr: Add function for generating EncodableKeys. | Gabriela Moldovan | 2023-07-24 | 1 | -0/+7 |
| | | |||||
| * | keymgr: Add a Keystore::contains accessor. | Gabriela Moldovan | 2023-07-24 | 1 | -0/+26 |
| | | |||||
| * | keymgr: Use KeystoreId instead of a static string. | Gabriela Moldovan | 2023-07-21 | 1 | -16/+33 |
| | | |||||
| * | keymgr, tor-error: Remove unused error type and HasKind. | Gabriela Moldovan | 2023-07-21 | 1 | -20/+2 |
| | | |||||
| * | keymgr: Use BadApiUsage instead of KeystoreMisuse. | Gabriela Moldovan | 2023-07-21 | 1 | -9/+7 |
| | | | | | Trying to use a keystore that doesn't exist is `bad_api_usage!`. | ||||
| * | keymgr: Remove unused KeystoreSelector::All variant. | Gabriela Moldovan | 2023-07-21 | 1 | -28/+0 |
| | | | | | | | This also removes the corresponding `KeyMgrError::UnsupportedKeystoreSelector` error, because it's not needed anymore. | ||||
| * | Revert "keymgr: Require callers to be explicit about which keystore to get ↵ | Gabriela Moldovan | 2023-07-21 | 1 | -16/+7 |
| | | | | | keys from." (fmt) | ||||
| * | Revert "keymgr: Require callers to be explicit about which keystore to get ↵ | Gabriela Moldovan | 2023-07-21 | 1 | -33/+22 |
| | | | | | | | | | | keys from." This reverts commit 38a6c74c7894dc96b16c9039cacc2a4023977b05. This also updates some tests to make them compile with the reverted version of the code. | ||||
| * | keymgr: Require callers to be explicit about where to remove keys from. | Gabriela Moldovan | 2023-07-20 | 1 | -15/+66 |
| | | | | | | As with `KeyMgr::insert`, only `KeystoreSelector::Id` and `KeystoreSelector::Default` are supported. | ||||
| * | keymgr: Add tests for KeyMgr. | Gabriela Moldovan | 2023-07-20 | 1 | -0/+213 |
| | | |||||
| * | keymgr: Require callers to be explicit about which keystore to get keys from. | Gabriela Moldovan | 2023-07-20 | 1 | -6/+19 |
| | | |||||
| * | keymgr: Move KeyMgr::get impl to Keymgr::get_from_store. | Gabriela Moldovan | 2023-07-20 | 1 | -26/+36 |
| | | | | | | | This refactoring will make more sense later, when we give `KeyMgr::get` an extra parameter that specifies which keystore to retrieve the key from. | ||||
| * | keymgr: Require callers to specify which keystore to insert keys in. | Gabriela Moldovan | 2023-07-20 | 1 | -26/+30 |
| | | | | | | | | | | | The caller uses `KeystoreSelector` to specify which keystore to insert the new key into (only `KeystoreSelector::Id` and `KeystoreSelector::Default` are supported for `insert`). The ability to insert keys in a particular keystore will come in handy when we implement the key management CLI (the CLI will have an option for specifying the keystore to access/modify). | ||||
| * | keymgr: Add an error type for misuse errors. | Gabriela Moldovan | 2023-07-20 | 1 | -2/+28 |
| | | | | | | | This error will be returned by `KeyMgr` if the caller tries to access a keystore that does not exist, or if the requested `KeystoreSelector` cannot be applied. | ||||
| * | keymgr: Add a function for looking keystores up by ID. | Gabriela Moldovan | 2023-07-20 | 1 | -0/+5 |
| | | | | | | This will be used by `KeyMgr::insert` after we add an additional argument to `insert` for specifying the keystore it should be using. | ||||
| * | keymgr: Iterate over all the stores, not just the secondary ones. | Gabriela Moldovan | 2023-07-20 | 1 | -1/+7 |
| | | |||||
| * | keymgr: Explicitly specify the default keystore for `KeyMgr`. | Gabriela Moldovan | 2023-07-20 | 1 | -4/+11 |
| | | |||||
| * | keymgr: Add a type alias for `Box<dyn Keystore>`. | Gabriela Moldovan | 2023-07-20 | 1 | -2/+5 |
| | | | | | This makes the code slightly less verbose. | ||||
| * | keymgr: Rename KeyStore to Keystore globally. | Gabriela Moldovan | 2023-06-29 | 1 | -6/+6 |
| | | | | | | We've been capitalizing the "s" in "KeyStore" inconsistently. This `s/KeyStore/Keystore/g` across the codebase. | ||||
| * | keymgr: Downgrade "TODO hs" to "TODO HSS". | Gabriela Moldovan | 2023-06-28 | 1 | -2/+2 |
| | | | | | | These TODOs can be deferred for now: we're not declaring the keymgr APIs stable until we add support for hidden services. | ||||
| * | keymgr: Replace Error with Box<dyn KeystoreError>. | Gabriela Moldovan | 2023-06-26 | 1 | -3/+3 |
| | | | | | Part of #901 | ||||
| * | keymgr: Downgrade 2 "TODO hs" to "TODO HSS". | Gabriela Moldovan | 2023-06-22 | 1 | -1/+1 |
| | | |||||
