| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
This adds the lint to all our crates.
|
| |
|
|
| |
Fixes a clippy warning.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Previously, the `arti_path` was needed to build the various `ArtiPath`
errors, but that's no longer the case.
|
| |
|
|
|
| |
The `ArtiPath` is included in the `KeyPathError::Arti` outer error type,
so there is no need to include it in `ArtiPathError` too.
|
| |
|
|
|
| |
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.
|
| |
|
|
| |
This never returns any other type of error.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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()`).
|
| |
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
`KeyMgr::describe()` now works for `CTorPath`s too, so the key path
validation can be the same as for `ArtiPath`s.
|
| | |
|
| |
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
This enables us to implement `KeyMgr::describe()`, which relies on the
ability to extract the key specifier of the key from its `KeyPath`.
|
| |
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
| |
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]>
|
| | |
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
|
|
| |
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.
|
| |
|
|
| |
This feature has been removed from nightly, in favor of doc_cfg.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```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)]
| ^^^^^^^^^^^^^^^^^^^^^^
```
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
Closes #2012.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>>>`
|
| |\
| |
| |
| |
| | |
Typo fixes (automatic and hand-verified)
See merge request tpo/core/arti!3089
|
| | |
| |
| |
| | |
Made with https://crates.io/crates/typos-cli
|
| |/ |
|