summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Merge branch 'mod-module-files' into 'main'Nick Mathewson2025-01-071-0/+1
|\ | | | | | | | | clippy: deny `mod_module_files` See merge request tpo/core/arti!2689
| * clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | | | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* | fix: fix typosDimitris Apostolou2025-01-064-4/+4
|/
* tor-keymgr: Replace internal error with keystore corruption error.Gabriela Moldovan2024-12-042-1/+5
| | | | | This replaces a placeholder error with a concrete `KeystoreCorruptionError` variant.
* tor-keymgr: Add tests for ArtiNativeKeystore's handling of certs.Gabriela Moldovan2024-12-041-1/+29
|
* tor-keymgr: Add support for certs in ArtiNativeKeystore::insert().Gabriela Moldovan2024-12-041-5/+8
|
* tor-keymgr: Add support for certs in ArtiNativeKeystore::get().Gabriela Moldovan2024-12-041-8/+36
| | | | | This makes `ArtiNativeKeystore::get` deserialize the keystore item as a cert, if its `KeystoreItemType` is `Cert`.
* tor-keymgr: Add arti native keystore helper for parsing tor certs.Gabriela Moldovan2024-12-042-0/+42
| | | | | We'll soon use this in `ArtiNativeKeystore`'s `Keystore` implementation for parsing certs read from disk.
* tor-keymgr: Add tests for the new cert mgmt functions.Gabriela Moldovan2024-12-041-1/+172
|
* tor-keymgr: s/TestKey/TestItem in tests.Gabriela Moldovan2024-12-041-55/+55
| | | | | We're about to reuse TestKey as our test key "certificate", so let's preemptively rename it to something more fitting.
* tor-keymgr: Add a test certificate specifier to test_utils.Gabriela Moldovan2024-12-041-1/+34
| | | | This is about to be used in a couple of places.
* tor-keymgr: s/key/item in error message test.Gabriela Moldovan2024-12-042-2/+2
|
* tor-keymgr: Rename error variant.Gabriela Moldovan2024-12-043-14/+13
|
* tor-keymgr: Remove unused KeyType import.Gabriela Moldovan2024-12-041-1/+1
|
* tor-keymgr: Add KeyMgr::get_or_generate_key_and_cert.Gabriela Moldovan2024-12-041-0/+119
|
* tor-keymgr: Add KeyMgr::get_key_and_cert() (fmt).Gabriela Moldovan2024-12-041-5/+7
|
* tor-keymgr: Add KeyMgr::get_key_and_cert().Gabriela Moldovan2024-12-042-2/+96
|
* tor-keymgr: Remove no-longer-needed explicit link targets.Gabriela Moldovan2024-12-041-2/+2
| | | | | These aren't needed anymore now that `KeySpecifierComponent` is in scope.