summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src
Commit message (Collapse)AuthorAgeFilesLines
* Add `hsc key ctor-migrate` subcommandhjrgrn2025-11-241-0/+4
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-0612-12/+12
| | | | Run maint/add_warning
* Lay foundations for RSA keys in keystore.Wesley Aptekar-Cassels2025-09-301-4/+4
| | | | | | This currently can't be used due to upstream limitations in the ssh_key crate, which will be removed likely in the next release. In the meantime, we can put in all the groundwork.
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* tor-keymgr: Fix `KeyMgr::list_keystores` descriptionhjrgrn2025-09-221-1/+1
|
* arti: keys: Add `keys check-integrity` CLI toolhjrgrn2025-09-041-3/+35
|
* misc: cleanup now that `_report!` macros support fieldsSteven Engler2025-08-181-1/+1
|
* clippy: fix `clippy::implicit_clone` errorsSteven Engler2025-08-112-2/+2
| | | | | | | | | | | | | | | | | ```text error: implicitly cloning a `String` by calling `to_string` on its dereferenced type --> crates/tor-config/src/lib.rs:109:32 | 109 | V::String(_, s) => s.to_string(), | ^^^^^^^^^^^^^ help: consider using: `s.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone note: the lint level is defined here --> crates/tor-config/src/lib.rs:20:9 | 20 | #![deny(clippy::implicit_clone)] | ^^^^^^^^^^^^^^^^^^^^^^ ```
* Fix warnings and errors from edition 2024.Nick Mathewson2025-08-071-4/+1
| | | | | | | | | | The two main causes of errors were: - Since some of the lifetime rules have changed, we no longer need to do as many "bind a variable and immediately return it" patterns, and so clippy now warns about them. - We needed to adjust the explicit captures (`use<...>`) in a couple of our RPIT instances.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0714-113/+158
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Update code for Edition 2024Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* Fix errors from rustdoc nightly.Nick Mathewson2025-08-051-1/+1
|
* 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
| |