summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src
Commit message (Collapse)AuthorAgeFilesLines
* Use new DisplayRedacted/DebugRedacted code for HsId.Nick Mathewson2025-07-311-3/+6
| | | | Closes #2012.
* arti: hss: Add `arti hss ctor-migrate`hjrgrn2025-07-311-0/+61
|
* tor-keymgr: Add err::Error::KeystoreNotFoundhjrgrn2025-07-232-2/+9
|
* arti: keys: Add arti keys-rawhjrgrn2025-07-1412-254/+637
| | | | | | | | | | | | | | | | | | | * CLI: Add `keys-raw` and subcommand `remove-by-path` * arti: Add `arti::subcommand::raw` for the CLI `keys-raw` * tor-keymgr: Add `ArtiNativeKeystoreError::UnexpectedRawEntry`, `ArtiEphemeralKeystoreError::NotSupported` * tor-keymgr: Add `tor-keymgr::raw` module * tor-keymgr: Add `Keystore::remove_unchecked` * tor-keymgr: Change `Keystore::list` to return `KeystoreEntry` * tor-keymgr: Add field `KeystoreEntry::raw_id` * doc: Update keys.md * doc: Add raw.md * tor-keymgr: BREAKING: `UnrecognizedEntryError::new` associated function is now only accessible within the crate `tor-keymgr` * tor-keymgr: BREAKING: `UnrecognizedEntryId` is renamed to `UnrecognizedEntry` * tor-keymgr: BREAKING: `KeyMgr::list()` and `Keystore::list()` now return `Result<Vec<KeystoreEntryResult<KeystoreEntry>>>`
* Merge branch 'typos-20250709' into 'main'Nick Mathewson2025-07-093-3/+3
|\ | | | | | | | | Typo fixes (automatic and hand-verified) See merge request tpo/core/arti!3089
| * Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-093-3/+3
| | | | | | | | Made with https://crates.io/crates/typos-cli
* | keymgr: fix spelling of MethodNotSuppor(t)ed.Nick Mathewson2025-07-091-5/+5
|/
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* arti: Add keys list and keys list-keystoreshjrgrn2025-06-121-8/+160
|
* tor-keymgr: BREAKING: Refactor API: Keystore::listhjrgrn2025-05-3010-99/+473
| | | | | * Change return type `Result<Vec<(KeyPath, KeystoreItemType)>>` if favor of `Result<Vec<StdResult<(KeyPath, KeystoreItemType), UnrecognizedEntryError>>>`
* *: use std::io::Error::other in many placesNick Mathewson2025-05-151-4/+2
| | | | | | | The `IoError::other` function is an easier way to say `IoError::new(IoErrorKind::Other, ...)`. It's been around since 1.74, but clippy started warning about the more verbose version in 1.87.
* tor-keymgr: Refactor ItemMetadata to support certificate metadatashivam374832025-05-061-75/+159
|
* tor-keymgr: ephemeral type validationhashcatHitman2025-04-032-12/+77
|
* tor-keymgr: BREAKING: Refactor API: Keystore::insertplaybahn2025-04-026-65/+23
| | | | | | Drop redundant/unused param item_type: &KeystoreItemType from keystore::Keystore::insert. Method now uses param key: &dyn EncodableItem to obtain a KeystoreItemType
* tor-keymgr: keystore::ephemeral::insert: Drop item type validationplaybahn2025-04-021-20/+1
| | | | | | | | Motivation: Param _item_type is redundant since prev commit. No point in checking if key_data's item type and _item_type are the same, we do things as per key_data's item type from now on. - Removes a test for item type validation.
* tor-keymgr: Fix TODO: Refactor API: Keystore::insertplaybahn2025-04-024-28/+17
| | | | Makes param item_type redundant. Renames item_type -> _item_type.
* Merge branch 'unused' into 'main'Ian Jackson2025-04-011-0/+3
|\ | | | | | | | | Add some allow(unused) See merge request tpo/core/arti!2893
| * Add some allow(unused)Ian Jackson2025-03-271-0/+3
| | | | | | | | | | Fixes several warnings from cargo check --workspace --no-default-features
* | tor-keymgr: keystore::arti::ssh: Fix typo; simplify comments.playbahn2025-03-271-8/+7
| | | | | | | | Closes #1455
* | tor-keymgr: keystore::arti: Rework tests: ssh-keygen interopplaybahn2025-03-261-7/+4
| | | | | | | | Closes #1455 [PATCH 4(v3)/4]
* | tor-keymgr: keystore::arti::ssh: Rework tests: ssh-keygen interopplaybahn2025-03-261-37/+115
| | | | | | | | Part of #1455 [PATCH 3(v3)/4]
* | tor-keymgr: test_utils: TestSpecifier::path_prefix: Drop methodplaybahn2025-03-262-8/+7
| | | | | | | | Part of #1455
* | tor-keymgr: Fix clippy errorsplaybahn2025-03-262-2/+3
| |
* | tor-keymgr: test_utils: Fix unresolved importplaybahn2025-03-261-4/+8
| |
* | tor-keymgr: keystore::arti::tests: More intuitive assert_eq!playbahn2025-03-262-3/+2
| |
* | tor-keymgr: keystore::arti: Rework ssh-keygen interop testsplaybahn2025-03-261-63/+82
| | | | | | | | Closes #1455 [PATCH 4(v2)/4]
* | tor-keymgr: keystore::arti::ssh: Rework ssh-keygen interop testsplaybahn2025-03-261-30/+52
| | | | | | | | Part of #1455 [PATCH 3(v2)/4]
* | tor-keymgr: Rework utils for ssh-keygen interop testsplaybahn2025-03-261-52/+50
| | | | | | | | | | | | | | | | | | | | | | Part of #1455 [PATCH 2(v2)/4] - Rework sshkeygen::ed25519_encoded to also work as replacement for sshkeygen::exists - Drop sshkeygen::exists - Rename sshkeygen::{ed25519_encoded -> sshkeygen_ed25519_strings} - Pull out sshkeygen_ed25519_strings from mod sshkeygen - Drop mod sshkeygen
* | tor-keymgr: Remove unused importsplaybahn2025-03-262-2/+0
| | | | | | | | _sigh_
* | tor-keymgr: keystore::arti: Add tests for ssh-keygen interopplaybahn2025-03-261-65/+100
| | | | | | | | Closes #1455 [PATCH 4/4]
* | tor-keymgr: keystore::arti::ssh: Add tests for ssh-keygen interopplaybahn2025-03-261-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | Part of #1455 [PATCH 3/4] Abstract of the test(s): Encoded (key) A -> Decoded (key) A Decoded A -> Encoded B Encoded B -> Decoded B Assert that Decoded A == Decoded B
* | tor-keymgr: test_utils: Add ssh-keygen interop test utilsplaybahn2025-03-261-0/+53
| | | | | | | | | | | | | | | | | | | | Part of #1455 [PATCH 2/4] Utils include: - mod sshkeygen - sshkeygen::exists - check if ssh-keygen is available - sshkeygen::ed25519_encoded - generate encoded Ed25519 keys
* | tor-keymgr: test_utils: Fix typo: TestSpecifier::new paramplaybahn2025-03-261-2/+2
|/ | | | | | | TestSpecifier::new(prefix: ...) -> new(suffix: ...) Prefix is given by TestSpecifier::path_prefix() which returns const TEST_SPECIFIER_PATH = "..."
* tor-keymgr: Introduce ItemMetadata type for testing.vijayabhaskar_782025-03-261-86/+149
|
* Use an EntropicRng trait to enforce key generation rules.Nick Mathewson2025-03-241-8/+12
| | | | | | | | | | | We want to require that whenever we generate a key that's persistent (stored in KeyMgr), it's going to be made from a stronger-than-usual Rng. This trait helps us enforce that. We also add a FakeEntropicRng struct to use for testing. Note that this turned up a case that we'd missed, which required an internal change in tor-hsservice.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-182-2/+2
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* Merge branch '1889-resolve-some-todos' into 'main'gabi-2502025-03-142-185/+174
|\ | | | | | | | | | | | | tor-keymgr: Resolve TODOs from key_specifier::tests Closes #1889 See merge request tpo/core/arti!2849
| * tor-keymgr: Resolve TODOs from key_specifier::testshjrgrn2025-03-142-185/+174
| |
* | tor-hscrypto: Implement Display for TimePeriodhjrgrn2025-03-131-10/+1
|/
* Upgrade to derive_more 2Nick Mathewson2025-02-261-1/+1
| | | | | This took a little refactoring, since derive_more::Foo no longer re-exports std::ops::Foo.
* tor-keymgr: Use @ to annotate internal macro branches.Gabriela Moldovan2025-02-061-3/+3
|
* tor-keymgr: Define the test key constants using a macro.Gabriela Moldovan2025-02-061-42/+83
| | | | Closes #1396
* tor-keymgr: Rename test constants to match file names.Gabriela Moldovan2025-02-063-30/+30
| | | | Part of #1396
* tor-keymgr: Use ParsedEd25519Cert when decoding certs.Gabriela Moldovan2025-01-133-12/+13
| | | | | | | This helps us get rid of our uses of `KeyUnknownCert`. Needed because `KeyUnknownCert` can't readily be converted back to `EncodedEd25519Cert` (while `ParsedEd25519Cert` *can* -- see the `certs` module from `tor-relay-crypto`).
* tor-keymgr: Fix cert handling tests.Gabriela Moldovan2025-01-132-25/+62
| | | | | | This updates and reenables the cert management tests. Part of #1768
* tor-keymgr: Use Ed25519Cert::decode to parse the certs.Gabriela Moldovan2025-01-133-4/+17
|
* tor-keymgr: Add cert parse error variant.Gabriela Moldovan2025-01-131-2/+14
| | | | | | | This will soon be used, when we modify the `ArtiNativeKeystore` cert lookup code to actually parse certificates before returning them. Part of #1768
* tor-key-forge: Split out ItemType as a separate trait.Gabriela Moldovan2025-01-133-10/+16
| | | | | | | | This is necessary because `ParsedCert`s will not be `EncodableItem`s. This is because we cannot (and don't want to) write certificates that have not yet been validated to the keystore. They do need to be retrievable from the keystore though, so we also change `ErasedKey` to be `Box<dyn ItemType>` instead.
* tor-key-forge: Distinguish between parsed certs and encodable certs.Gabriela Moldovan2025-01-131-8/+9
| | | | | | | | | | | | | | | We need two different types to represent * certs that have been parsed, but not yet validated (`KeyUnknownCert`) * newly generated encodable certs (`EncodedEd25519Cert`) Currently, we don't use `KeyUnknownCert` anywhere, and instead use `EncodedEd25519Cert` to represent "parsed" but not-yet-validated certs. This approach is wrong and relies on a broken (no-op) `EncodedEd25519Cert::from_bytes` implementation. A future commit will address this problem by replacing `EncodedEd25519Cert::from_bytes` with `Ed25519Cert::decode` to actually parse the cert upon retrieving it from the keystore.
* tor-keymgr: Replace from_encodable_cert with validation function.Gabriela Moldovan2025-01-131-15/+5
| | | | | | | | In practice, we won't be able to obtain an `ToEncodableCert` type from an `EncodableItem` cert without validating it first, so we need to collapse `validate` into `from_encodable_cert`. Part of #1768