summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src
Commit message (Collapse)AuthorAgeFilesLines
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* keymgr: Remove redundant field name in struct initGabriela Moldovan2026-01-061-1/+1
| | | | Fixes a clippy warning.
* keymgr: Add tests for the unhappy path of from_ctor_path()Gabriela Moldovan2026-01-061-2/+34
|
* keymgr: Derive PartialEq for CTorPathErrorGabriela Moldovan2026-01-061-1/+1
|
* keymgr: Update tests to use the new d-d macro annotation for CTorPaths (fmt)Gabriela Moldovan2026-01-061-1/+3
|
* keymgr: Update tests to use the new d-d macro annotation for CTorPathsGabriela Moldovan2026-01-061-28/+14
|
* keymgr: Use d-d to generate CTorPath<->KeySpecifier conversionsGabriela Moldovan2026-01-061-26/+54
|
* keymgr: Add a CTorKeySpecifier trait (fmt)Gabriela Moldovan2026-01-061-4/+4
|
* keymgr: Add a CTorKeySpecifier traitGabriela Moldovan2026-01-062-1/+18
|
* keymgr: Make CTorPath more like the client/service specifiers (fmt)Gabriela Moldovan2026-01-064-12/+21
|
* keymgr: Make CTorPath more like the client/service specifiersGabriela Moldovan2026-01-064-74/+50
| | | | | | | | | | | | | This will make it easier to see the correspondence between CTorPaths and the HS client/service key specifiers. Initially, I was hoping this would make it easier to write a d-d macro that automatically derives a `CTorPath` variant (e.g. `HsClientDescEncKeypair`) from the KeySpecifier type name (`HsClientDescEncKeypairSpecifier`), but alas, I don't think d-d can "chop off" name suffixes ("Specifier", in this case). `from_ctor_path()`/`ctor_path()` implementations for converting `CTorPath`s to and from key specifiers.
* keymgr: Fix some recently broken doc linksGabriela Moldovan2026-01-063-6/+6
|
* keymgr: Resolve a handful of clippy warnings (fmt)Gabriela Moldovan2026-01-061-2/+1
|
* keymgr: Resolve a handful of clippy warningsGabriela Moldovan2026-01-062-4/+4
|
* keymgr: Push error handling into the from_ctor_path() functionsGabriela Moldovan2026-01-062-16/+9
|
* keymgr: Replace placeholder errors with CTorPathError (fmt)Gabriela Moldovan2026-01-061-4/+4
|
* keymgr: Replace placeholder errors with CTorPathErrorGabriela Moldovan2026-01-063-10/+35
|
* keymgr: Remove unused argument in helper function (fmt)Gabriela Moldovan2026-01-061-6/+1
|
* keymgr: Remove unused argument in helper functionGabriela Moldovan2026-01-061-3/+1
| | | | | Previously, the `arti_path` was needed to build the various `ArtiPath` errors, but that's no longer the case.
* keymgr: Remove redundant ArtiPath from error contextGabriela Moldovan2026-01-062-21/+6
| | | | | The `ArtiPath` is included in the `KeyPathError::Arti` outer error type, so there is no need to include it in `ArtiPathError` too.
* keymgr: Split out ArtiPathError from KeyPathErrorGabriela Moldovan2026-01-063-20/+31
| | | | | This makes the error handling around `KeyPath`s a bit more sensible, IMO, and it will make it easier to extend it for `CTorPath` errors.
* keymgr: Make describe_via_components() return BugGabriela Moldovan2026-01-061-1/+1
| | | | This never returns any other type of error.
* keymgr: Move Unrecognized errors out of KeyPathError (fmt)Gabriela Moldovan2026-01-061-3/+3
|
* keymgr: Move Unrecognized errors out of KeyPathErrorGabriela Moldovan2026-01-063-17/+14
| | | | | | | | | | | | | | | | | | | | | Out of all the variants in `KeyPathError`, `Unrecognized` is the odd one out, because unlike the others, which are mainly just lower level parsing errors, `Unrecognized` is a higher level error constructed in `KeyMgr::describe()`. `KeyMgr::describe()` now returns an `Option`, because * the failure to describe a user provided `KeyPath` may or may not be an error * previously, `describe()` would only ever return `Ok` or `Err(KeyPathError::Unrecognized)`, which essentially a binary result. Also, `describe()` would never return any of the other `KeyPathError` kinds, which further suggests `Unrecognized` doesn't belong there The `Unrecognized` variant still exists, but is now part of `KeystoreCorruptionError`, (returned from `KeyMgr::validate_entry_integrity()`).
* keymgr: Fix clippy warning when KeySpecifier is used in tor-keymgrGabriela Moldovan2026-01-061-0/+1
| | | | | | | | | If you try to use this macro within `tor-keymgr` (as we do in the tests), clippy complains about the unreachable catch-all branch for `KeyPath`s (we can't get rid of the catch-all, because outside of `tor-keymgr` KeyPath` is non-exhaustive; but we should probably just go ahead and make `KeyPath` exhaustive at this point, because it's very unlikely it will ever grow new variants).
* proto: Use describe() unconditionally in validate_entry_integrity()Gabriela Moldovan2026-01-061-12/+5
| | | | | `KeyMgr::describe()` now works for `CTorPath`s too, so the key path validation can be the same as for `ArtiPath`s.
* keymgr: Update test d-d macro with new ctor_path functionsGabriela Moldovan2026-01-061-17/+24
|
* keymgr: Specify ctor conversion functions as moduleGabriela Moldovan2026-01-061-9/+13
| | | | | | | This is similar to `#[serde(with = "...")]`, and feels a bit nicer than having to specify two separate functions for the conversions (because with two separate functions, you *can* technically only specify one of them, which shouldn't be allowed).
* keymgr: Extend KeySpecifier macro to support CTorPath conversionsGabriela Moldovan2026-01-061-2/+22
| | | | | This enables us to implement `KeyMgr::describe()`, which relies on the ability to extract the key specifier of the key from its `KeyPath`.
* keymgr: Make parse_key_path() only parse ArtiPathsGabriela Moldovan2026-01-061-18/+23
| | | | | | Unlike `ArtiPath`s, C Tor paths don't need to be parsed, because we have a predefined list of allowed C Tor paths (`CTorPath` is an enum with variants for each supported key type).
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-043-10/+0
| | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* 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
|/