| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| |
| |
| |
| | |
Removed unnecessary lint
Closes #2556
See merge request tpo/core/arti!4210
|
| | | |
|
| | |
| |
| |
| | |
Removed unnecessary lint
|
| |/ |
|
| |
|
|
| |
Starting with rdrand 0.9, the crate supports aarch64.
|
| |
|
|
|
| |
ExpandedKeypair already implements Ed25519SigningKey, so there is no
reason to not implement Ed25519PublicKey on it.
|
| |
|
|
| |
This eliminates some string slicing.
|
| |
|
|
|
|
|
|
| |
This commit adds #[allow(clippy::string_slice)] to all functions in the
code where string slices are used, alongside a TODO comment.
We do this add the function header to have it consistent, as things like
expression based allow's are still experimental.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit executes maint/add_warning with the just added change to
deny string slices except in tests.
I recommend auditing this by checking out the previous commit followed
by running the script yourself and then verifying that the diff is
identical to this commit.
This commit makes cargo clippy fail. We will add exceptions in the next
commit.
|
| |
|
|
|
|
|
|
|
|
|
| |
When the circ-padding feature is enabled, we use maybenot, which does
not yet support rand 0.10. In the meantime, enabling this feature pulls
in rand 0.9. This is not ideal, but should be okay as a temporary
situation.
This also replaces the use of ReseedingRng (which was removed in 0.10)
with the reseeding_rng crate. This is somewhat less performant, but it
should be okay.
|
| | |
|
| |
|
|
|
| |
It is harmless to derive Deftly without doing more. Do that, rather
than cfg'ing the use of derive_deftly::Deftly.
|
| |
|
|
|
|
|
|
|
|
| |
This commit adds .to_bytes() to RsaIdentity which is similar to
.as_bytes() except that it returns the RsaIdentity as a byte array.
We are going to need this at a few places in tor-dirserver. The naming
was inspired from x25519-dalek which has similar .as_bytes() and
.to_bytes() methods. Besides, copying 20 bytes shall be okay and it
avoids having to write ugly try_into() constructs.
|
| |
|
|
|
|
|
|
|
| |
`clippy::collapsible_if` started triggering after bumping the MSRV to
1.88.
Since this triggers from a lot of places, and since there even are a
couple of instances where we explicitly allow `clippy::collapsible_ifs`,
I've opened #2342 for deciding what to do about it.
|
| |
|
|
|
|
|
|
| |
This is intended to be analogous to `RsaIdentity::from_hex()`.
I've found myself wanting this a few times, and it makes it easy to grab
a `master-key-ed25519` from the consensus and paste it into the code
without needing to do extra conversions.
|
| | |
|
| |
|
|
| |
This adds the lint to all our crates.
|
| |
|
|
|
|
|
|
|
|
| |
This commit adds the method `as_hex_upper(&self) -> String` to
`RsaIdentity`, which returns the `RsaIdentity` as a hexadecimal string
in uppercase.
Although this type already implements `ToString`, this result is
unsuitable for working with consensuses because they neither contain a
`$` prefix, nor are encoded in lowercase.
|
| |
|
|
|
|
|
|
|
| |
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]>
|
| |\
| |
| |
| |
| |
| |
| | |
tor-llcrypto: Stop deriving Deref in CtByteArray
Closes #2172
See merge request tpo/core/arti!3432
|
| | | |
|
| |/
|
|
| |
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.
|
| |\
| |
| |
| |
| | |
tor-key-forge: Add RSA key types.
See merge request tpo/core/arti!3236
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
As discussed with gabi on IRC today.
|
| | |
| |
| |
| |
| |
| |
| | |
Some things I'm still considering here:
* We may want to define a tor_llcrypto::pk::rsa::Signature newtype.
* We likely want to rename tor_llcrypto::pk::rsa::PrivateKey to RsaKeypair.
|
| | |
| |
| |
| | |
This feature has been removed from nightly, in favor of doc_cfg.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The macros to deftly derive `ConstantTimeEq` and `PartialEq` (for
`ConstantTimeEq`) are now only defined in `tor-llcrypto` and exported.
The macro to deftly derive `ConstantTimeEq` is now struct only and uses
`subtle::Choice::from(1)` for improved clarity.
Signed-off-by: hashcatHitman <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
I didn't even realize I was still conditionally using it on a feature.
That's what I get for always testing with all-features.
Signed-off-by: hashcatHitman <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is my initial attempt at deriving ConstantTimeEq and PartialEq.
This includes the previously missed HsSvcNtorKeypair and
HsClientDescEncKeypair types.
In tor-llcrypto, a few implementations still had to be done by hand, and
some types which previously derived normal PartialEq now derive it with
ConstantTimeEq.
I could not figure out how to properly set up the macros such that they
could be used both in the current crate and in others, so for the moment
they are duplicated. Just so I can get feedback. Ideally, this will be
replaced with a better solution before merge.
Signed-off-by: hashcatHitman <[email protected]>
|
| |/
|
|
|
|
|
| |
Exposed `as_bytes` on `curve25519::StaticSecret`, allowing a shared
reference to the secret bytes rather than needing to copy them.
Signed-off-by: hashcatHitman <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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_llcrypto::pk::ed25519::PublicKey` is based on `ed25519_dalek::VerifyingKey`
and not `ed25519_dalek::SigningKey`.
|
| |
|
|
| |
See #2060.
|
| |
|
|
|
|
| |
- Replaced `once_cell::sync::Lazy` with `std::sync::LazyLock`.
Signed-off-by: hashcatHitman <[email protected]>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
This Rng combines inputs from several sources,
including OsRng, to minimize the likelihood
of falling to a vulnerability in any particular one.
|
| |
|
|
| |
- The Rng::gen() functions have been renamed to Rng::random().
|
| |
|
|
|
|
|
|
|
| |
dalek-cryptography is still on rand 0.8, so we need a compatibility
shim for the Rng.
Fortunately, since we merged interface-abstraction-of-the-daleks
(!2868), we no longer need to propagate this compatibility layer
throughout our codebase.
|
| |
|
|
|
|
|
|
|
|
|
| |
With this change, we'll no longer need to expose the types from
dalek-cryptography as part of our API, and we'll have more freedom
to switch ed25519 implementations, or to upgrade to a newer
`rand` ahead of their schedule.
Unlike with x25519-dalek, I had to tweak the API a bit: There's no
way to get a &PublicKey out of a Keypair now, and implementing the
old ed25519-dalek traits seemed unnecessary.
|
| |
|
|
|
|
|
| |
With this change, we'll no longer need to expose the types from
dalek-cryptography as part of our API, and we'll have more freedom
to switch curve25519 implementations, or to upgrade to a newer
`rand` ahead of their schedule.
|
| |
|
|
|
|
| |
Denies 'mod.rs' files for consistency.
https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
(fmt)
|
| |
|
|
| |
It's not documented anywhere ATM. I will do that in a followup MR.
|