aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsclient/src/keys.rs
Commit message (Collapse)AuthorAgeFilesLines
* hsclient, hsservice: Use unquoted paths in ctor_path attrGabriela Moldovan2026-04-161-1/+1
|
* hsclient, hsservice: Remove no longer needed conversion functionsGabriela Moldovan2026-01-061-29/+1
|
* keymgr: Use d-d to generate CTorPath<->KeySpecifier conversionsGabriela Moldovan2026-01-061-1/+1
|
* keymgr: Make CTorPath more like the client/service specifiers (fmt)Gabriela Moldovan2026-01-061-1/+1
|
* keymgr: Make CTorPath more like the client/service specifiersGabriela Moldovan2026-01-061-2/+2
| | | | | | | | | | | | | 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: Push error handling into the from_ctor_path() functionsGabriela Moldovan2026-01-061-4/+10
|
* keymgr: Specify ctor conversion functions as moduleGabriela Moldovan2026-01-061-20/+19
| | | | | | | 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-1/+18
| | | | | This enables us to implement `KeyMgr::describe()`, which relies on the ability to extract the key specifier of the key from its `KeyPath`.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | 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.
* tor-hsclient: Implement ctor_path for client keys.Gabriela Moldovan2024-10-081-1/+8
|
* tor-hsclient: Use the new "restricted discovery" terminology.Gabriela Moldovan2024-10-031-4/+5
| | | | Part of #1476
* tor_keymgr: add get_keypair_specifier() to KeySpecifier, and derive itAdam Joseph F0B74D717CDE8412A3E0D4D5F29AC8080DA8E1E02024-09-091-0/+1
| | | | | | | This commit adds a new method `get_keypair_specifier()` to `KeySpecifier`. This method is used to indicate when one KeySpecifier (e.g. `KP_hs_id`) is the public part of another keypair (e.g. `KS_hs_id`). It will return the containing keypair in this case, and `None` otherwise.
* Switch to derive-deftlyIan Jackson2024-04-031-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the combination of a number of separate commits, many of which were generated by seddery, and then rebased and squashed. Cargo.toml perl -i~ -pe 's{^derive-adhoc}{derive-deftly = "0.10"}' crates/*/Cargo.toml (not regenerated during rebase) update Cargo.lock `cargo fetch` without --locked (regenerated during rebase) seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{^use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bdefine_derive_adhoc\b}{define_derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bAdhoc\b}{Deftly}g if m{derive}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[derive_adhoc\b}{#[derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc\b}{derive_deftly_adhoc} if m{use.*deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc!}{derive_deftly_adhoc!}' (not regenerated during rebase) Manually add `#[derive_deftly_adhoc]` where needed. seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[adhoc\b}{#[deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc_template}{derive_deftly_template}' (not regenerated during rebase) Manually fix up an import Manually update some builder attrs Manually fix up tor_rtmock::time_core This was missed in my seddery, due to me rebasing the branch and not redoing the seddery.
* tor-hsclient: Remove client nickname from the client key specifiers (fmt).Gabriela Moldovan2024-02-221-3/+1
|
* tor-hsclient: Remove client nickname from the client key specifiers.Gabriela Moldovan2024-02-221-34/+1
| | | | Closes #1283
* tor-hsclient: Rename HsClientSpecifier to HsClientNickname.Gabriela Moldovan2024-01-311-10/+8
| | | | | Service nicknames are represented by `HsNickname`, so let's rename `HsClientSpecifier` to `HsClientNickname`.
* tor-persist: Make all Slugs non-empty.Gabriela Moldovan2024-01-311-2/+0
| | | | | | | | This also removes a TODO regarding adding a `Nickname` type for representing `HsClientSpecifier` and `HsNickname` (we don't need it if `Slug`s are non-empty). Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1931#note_2990227
* tor-keymgr: Abolish ArtiPathComponent.Gabriela Moldovan2024-01-311-1/+1
| | | | | | `ArtiPathComponent`s are really just `Slugs`. Part of #1193, #1092
* tor-hsclient: Use Slug for HsClientSpecifier (fmt).Gabriela Moldovan2024-01-311-11/+3
|
* tor-hsclient: Use Slug for HsClientSpecifier.Gabriela Moldovan2024-01-311-4/+20
|
* tor-hsclient: Derive the KeySpecifier implementation (fmt).Gabriela Moldovan2024-01-101-4/+12
|
* tor-hsclient: Derive the KeySpecifier implementation.Gabriela Moldovan2024-01-101-49/+17
| | | | | | | | This addresses a `TODO HSS` about deriving the `KeySpecifier` implementation for client key specifiers. Note that we no longer have a key specifier type for intro auth keys (which are not supported anyway, see #1037).
* tor-keymgr: ArtiPathSyntaxError: rename from ArtiPathError (fmt)Ian Jackson2023-12-071-1/+2
|
* tor-keymgr: ArtiPathSyntaxError: rename from ArtiPathErrorIan Jackson2023-12-071-2/+2
| | | | | The previous name was ambiguous, and confusable with KeyPathError (of which it is, basically, a variant).
* tor-hsclient: Deprecate HsClientSecretKeysBuilder::ks_hsc_intro_auth().Gabriela Moldovan2023-11-201-1/+6
|
* tor-hsclient: Add TODO about using the new define_key_specifiers! macro.Gabriela Moldovan2023-10-301-0/+2
|
* tor-keymgr: Rename KeyPathError to ArtiPathUnavailableError (fmt).Gabriela Moldovan2023-10-191-2/+5
|
* tor-keymgr: Rename KeyPathError to ArtiPathUnavailableError.Gabriela Moldovan2023-10-191-2/+2
|
* tor-keymgr: Remove From<ArtiPathError> impl for KeyPathError.Gabriela Moldovan2023-10-191-2/+2
|
* tor-hsclient, arti-client: Make BadClientSpecifier wrap an ArtiPathError.Gabriela Moldovan2023-10-191-3/+3
|
* tor-keymgr: Use ArtiPathError for invalid ArtiPaths.Gabriela Moldovan2023-10-191-6/+7
|
* tor-hsclient: Update HsClientSecretKeys docs.Gabriela Moldovan2023-09-251-1/+1
|
* tor-hsclient, arti-client, tor-keymgr, tor-netdoc: Use a keypair instead of ↵Gabriela Moldovan2023-09-251-1/+1
| | | | StaticSecret (fmt).
* tor-hsclient, arti-client, tor-keymgr, tor-netdoc: Use a keypair instead of ↵Gabriela Moldovan2023-09-251-3/+3
| | | | | | | | | | | | | StaticSecret. Previously, when retrieving `KS_hsc_desc_enc` keys (or any other x25519 keys) from the keystore, the keymgr would discard the public part of the key (SSH private keys contain the public part of the key too). Instead of discarding the public key and returning just the `StaticSecret`, the keymgr now returns a `StaticKeypair`. This makes the x25519 `EncodableKey`/`ToEncodableKey` implementation consistent with the ed25519 one (which retrieves key pairs rather than "unescorted" secrets).
* tor-keymgr: Fix typo in key names.Gabriela Moldovan2023-09-121-4/+4
| | | | The secret keys are prefixed with `KS`, not `KP`.
* hsclient: Make HsClientSpecifier a newtype instead of a type alias.Gabriela Moldovan2023-06-291-1/+11
|
* arti-client, hsclient: Typealias HsClientSpecifier to ArtiPathComponent.Gabriela Moldovan2023-06-291-25/+2
| | | | `ArtiPathComponent` is a more generic version of `HsClientSpecifier`.
* keymgr: Move the HS client and service key specifiers out of tor-keymgr.Gabriela Moldovan2023-06-151-1/+77
| | | | | | The HS `HsClientSpecifier` and `HsClientSecretKeySpecifier` are moved to `tor-hsclient`. The HS service secret key specifier stubs are moved to `tor-hsservice`.
* hsclient: Change builder error return type to ConfigBuildError.Gabriela Moldovan2023-06-151-1/+1
| | | | | | It's not perfectly clear what this error type should be, so let's use `ConfigBuildError` for now (it makes things easier in `arti-client`, as we already have an `ErrorDetail` for it).
* Fix a docs reference to refer to HsClientIntroAuthKeypairIan Jackson2023-05-221-1/+1
| | | | | | | | Fixes warning from cargo -o doc --document-private-items --all-features --workspace This was evidentlhy overlooked during recent replacement of unescorted private keys in the code.
* netdoc, hsclient: Update remaining ed25519::SecretKey usersNick Mathewson2023-05-181-3/+3
| | | | | | Fortunately, these are all in experimental code. Closes #798
* hsclient: Use a real HsDesc instead of an unparsed string.Gabriela Moldovan2023-05-031-3/+3
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* hsclient keys: Be more explicit about HsClientSecretKeys nullableIan Jackson2023-03-011-5/+9
| | | | | It can contain no keys; state this more prominently, and explain what it represents. Also fix a few typos etc.
* hsclient keys: Add a todo to remove spurious OptionIan Jackson2023-03-011-0/+3
|
* hsclient keys: Compare all empty sets of keys as equalIan Jackson2023-03-011-1/+5
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1034#note_2881575
* hsclient keys: Provide :none() and Default and .is_empty()Ian Jackson2023-03-011-1/+22
|
* hsclient keys: Fix a missing full stopIan Jackson2023-03-011-1/+1
|
* hsclient state: Test most important code pathsIan Jackson2023-03-011-2/+8
|
* hsclient: Provide some missing debug impls and trace messagesIan Jackson2023-03-011-0/+12
|
* HS secret keys: Move aggregate/config to tor-hsclientIan Jackson2023-03-011-0/+79
| | | | | | | | Provide a more cookied "secret keys for use to connecting to a particular HS" type, with a builder. This wants to use config stuff, so oughtn't to be in tor-*crypto. The individual types remain there.