summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* 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
* tor-key-forge: Rename EncodableKey to EncodableItem.Gabriela Moldovan2024-12-041-1/+1
| | | | | | | | This is the first step in replacing `EncodableKey` with the new `EncodableItem` trait (see doc/dev/keymgr-certificates.md). (this refactoring is split over multiple commits to make reviewing easier)
* tor-keymgr: Add a KeyCertificateSpecifier trait (fmt).Gabriela Moldovan2024-12-041-3/+2
|
* tor-keymgr: Add a KeyCertificateSpecifier trait.Gabriela Moldovan2024-12-041-0/+1
| | | | This will be used for defining key certificate specifiers.
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* tor-keymgr: Remove now-unnecessary cfg_attr.Gabriela Moldovan2024-11-201-6/+0
| | | | This doesn't seem to be needed anymore.
* Disable a lot of dead code warnings (fmt)Ian Jackson2024-10-171-1/+4
|
* Disable a lot of dead code warningsIan Jackson2024-10-171-0/+3
| | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* arti-client: Use the configured C Tor client keystores.Gabriela Moldovan2024-10-081-1/+1
|
* arti-client: Use the configured C Tor keystores, if any.Gabriela Moldovan2024-10-081-0/+4
|
* tor-keymgr: Rename KeyPathRange to ArtiPathRange (fmt).Gabriela Moldovan2024-10-081-4/+4
|
* tor-keymgr: Rename KeyPathRange to ArtiPathRange.Gabriela Moldovan2024-10-081-1/+1
| | | | | This is only used for representing portions of `ArtiPath`s, so let's rename it accordingly.
* tor-keymgr: Reimagine CTorPath as an enum.Gabriela Moldovan2024-10-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | C Tor's client restricted discovery keys don't have the service hsid encoded in the filename (the hsid of the service each key is associated with is encoded in contents of the key file). This means that given a key specifier like `HsClientDescEncKeypairSpecifier` (which is a wrapper over an HsId), we can't actually compute the relative path of the key in its `KeySpecifier::ctor_path()` implementation. To do so we would need to access the keystore to figure out which path contains the requested HsId, which we can't (and shouldn't!) do from within the `KeySpecifier` impl. This suggests the String newtype (representing a relative path) we previously had is not a good abstraction for `CTorPath`s. Moreover, `CTorPath` are static (they don't have dynamic components like `ArtiPath`), so it makes more sense to model `CTorPath` as an enum. The new `CTorPath::ClientHsDescEncKey(HsId)` variant will be used to instruct the C Tor client keystore to find the file that contains the specified `HsId`, while the `Service` variant will be used for hidden service keys.
* tor-keymgr: Rename the primary keystore for clarity.Gabriela Moldovan2024-09-231-2/+2
| | | | | | | | | | Previously, arti's primary keystore was referred to as its "default" keystore. However, "default" is inaccurate here: there is no way to meaningfully override this "default" (the "default" store acts as the main keystore). Throughout the codebase, we query all keystores for keys (including the secondary ones), but only ever write to the default/primary keystore. This is OK for now, because it enables us to have one mutable keystore, and multiple secondary, read-only stores.
* tor-keymgr: put ephemeral keystore behind experimental featureSteven Engler2024-09-171-1/+7
| | | | Feature is named "ephemeral-keystore".
* Rename tor-keys crate to tor-key-forgeDavid Goulet2024-09-041-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* tor-keymgr: Use tor-keys crate and remove dead codeDavid Goulet2024-09-041-7/+9
| | | | | | | | | | | Everything copied in the previous commits to tor-keys is now removed and tor-keys crate is used accross the code. Minor changes to tor-keys to accomodate this change. Part of #1137 Signed-off-by: David Goulet <[email protected]>
* Change deftly syntax to post 0.12.1 versionIan Jackson2024-06-171-1/+1
| | | | | | | | | | | * Change `pub` to `export` * Change the `=` in define to `:` * Change `pub_template_semver_check` to `template_export_semver_check` Right now, 0.12.1 supports both syntaxes. I have verified this branch also compiles with https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/402 ee171ffaf56d7dcb7d75584054921153fe19b222
* Update to derive-deftly 0.12.1Ian Jackson2024-06-171-1/+1
| | | | | | * Bump in Cargo.toml * Deal with `${Xmeta as ...}` incompatible change, by always specifying an `as`, and changing `as tokens`.
* Merge branch 'keymgr-ephemeral-refactor' into 'main'gabi-2502024-05-091-0/+2
|\ | | | | | | | | | | | | tor-keymgr: Refactor code shared between ArtiNativeKeystore and ArtiEphemeralKeystore Closes #1362 and #1367 See merge request tpo/core/arti!2131
| * tor-keymgr: Move arti-specific ssh code to arti module.Gabriela Moldovan2024-05-071-0/+2
| | | | | | | | | | | | | | | | | | Some of the types and impls from `key_type/ssh.rs` (such as `UnparsedOpenSshKey`) have nothing to do with `KeyType`, and are only used by the `ArtiNativeKeystore`, so I'm moving them to the `arti` keystore module. The shared ssh-related stuff now lives in the top-level `ssh.rs`.
* | Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
|/ | | | This commit is automatically generated.
* tor-keymgr: added initial implementation for in-memory ArtiEphemeralKeystoreRichard Pospesel2024-04-101-0/+1
|
* tor-keymgr: Export KeyMgrBuilderError.Gabriela Moldovan2024-04-081-1/+1
| | | | | | `KeyMgrBuilderError` is used in `KeyMgrBuilder`'s public API. See https://gitlab.torproject.org/tpo/core/arti/-/issues/1358#note_3016025
* derive-deftly: Call pub_template_semver_checkIan Jackson2024-04-031-0/+2
| | | | | | | This is a new feature in d-d 0.10.0. Our currrent semver policy doesn't care about this, but let's not encode that property in the tree and leave ourselves a booby-trap.
* Switch to derive-deftlyIan Jackson2024-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* tor-keymgr: Downgrade a documentation TODO.Gabriela Moldovan2024-02-191-1/+1
| | | | | The tor-keymgr crate *is* documented, but could use a better README and some examples and/or usage guides.
* tor-keymgr: Make InvalidKeyPathComponentValue public.Gabriela Moldovan2024-02-191-3/+4
| | | | | It appears within the public API (it is the error type returned from `KeySpecifierComponent`), so let's make it public.
* tor-keymgr: Derive From for KeystoreSelector.Gabriela Moldovan2024-02-191-2/+2
| | | | We will soon use this in `KeyMgr`.
* tor-keymgr: Add KeystoreEntry.Gabriela Moldovan2024-02-191-1/+1
| | | | | | | | | | This type will soon replace `(KeyPath, KeyType)` in `KeyMgr::list_matching`. The KeystoreEntry documentation mentions a couple of functions that don't exist right now (they will be added in a subsequent commit). Part of #1271
* tor-keymgr: Rename KeyInfoExtractor to KeyPathInfoExtractor (fmt).Gabriela Moldovan2024-02-051-2/+2
|
* tor-keymgr: Rename KeyInfoExtractor to KeyPathInfoExtractor.Gabriela Moldovan2024-02-051-1/+1
| | | | | | This trait extracts a `KeyPathInfo`, not a `KeyInfo`. Part of #1115
* tor-keymgr: Abolish ArtiPathComponent.Gabriela Moldovan2024-01-311-1/+1
| | | | | | `ArtiPathComponent`s are really just `Slugs`. Part of #1193, #1092
* tor-keymgr: Turn some TODOs into #1115.Gabriela Moldovan2024-01-101-1/+1
|
* tor-keymgr: Turn a TODO HSS into #1193.Gabriela Moldovan2024-01-101-1/+1
|
* KeySpecifier d-a macro: Use doc-hidden re-exportsIan Jackson2024-01-041-1/+1
|
* KeySpecifier: Make KeySpecifierPattern a traitIan Jackson2024-01-041-1/+1
| | | | | | So now .arti_pattern() is a trait method. arti#1151 item 3.
* KeySpecifier d-a macro: Move to its own moduleIan Jackson2024-01-041-0/+3
| | | | This is going to expand and gain private helper methods.
* tor-keymgr: ArtiPathSyntaxError: rename from ArtiPathError (fmt)Ian Jackson2023-12-071-3/+3
|
* tor-keymgr: ArtiPathSyntaxError: rename from ArtiPathErrorIan Jackson2023-12-071-1/+1
| | | | | The previous name was ambiguous, and confusable with KeyPathError (of which it is, basically, a variant).
* tor-keymgr: Move ArtiPath etc. into new moduleIan Jackson2023-12-071-2/+4
| | | | Minimal changes to still compile and pass tests.
* tor-keymgr: provide KeySpecifierComponentViaDisplayFromStr and use itIan Jackson2023-12-071-1/+1
| | | | Now the only manual impl is TimePeriod, which is indeed special.
* tor-keymgr: Abolish the KeyDenotator trait in favour of KeyPathComponent (fmt).Gabriela Moldovan2023-12-051-3/+3
|
* tor-keymgr: Abolish the KeyDenotator trait in favour of KeyPathComponent.Gabriela Moldovan2023-12-051-1/+1
|
* tor-hsservice: Test the TryFrom<&KeyPath> KeySpecifier impl.Gabriela Moldovan2023-12-051-2/+2
|
* tor-keymgr: Add a module for test utilities.Gabriela Moldovan2023-12-051-0/+2
|
* tor-keymgr: Make DefaultKeySpecifier generate a key info extractor as well.Gabriela Moldovan2023-12-051-1/+1
|
* tor-keymgr: Introduce a KeySpecifierComponent trait.Gabriela Moldovan2023-12-051-1/+1
| | | | | | | | | Now the fields of a `DefaultKeySpecifier` no longer have to implement `Display` (they need to implement `KeySpecifierComponent`). See https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1733#note_2966400 Closes #1127
* tor-keymgr: Add a way of registering key info extractors using inventory.Gabriela Moldovan2023-12-051-1/+1
|