summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-09-25 15:21:05 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-09-25 15:21:05 +0200
commit66e290c2e9550c6cd02efe895fb5e0b0220444d9 (patch)
treee8c1df362886c170f12e9776e64677eaee586afb /openpgp/src/crypto
parent7b90b8b0dbefb8c98c3eeec709a3899ed41b1089 (diff)
openpgp: Either derive both Eq and Hash, or impl both.
- crypto::mpi::SecretKeyMaterial is the sole exception to this rule, because we are trying to compare them in constant time. Add a hint for clippy that this is okay. - KeyHandle no longer implements Eq, so there is no point in implementing Hash. Simply remove it. - Implement Hash for SubpacketLength by hashing the serialized form. Manually implement Eq for consistency. - Fixes #567.
Diffstat (limited to 'openpgp/src/crypto')
-rw-r--r--openpgp/src/crypto/mpi.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/openpgp/src/crypto/mpi.rs b/openpgp/src/crypto/mpi.rs
index 5088e9f3..1c6757b2 100644
--- a/openpgp/src/crypto/mpi.rs
+++ b/openpgp/src/crypto/mpi.rs
@@ -613,6 +613,7 @@ impl Arbitrary for PublicKey {
/// extensions.
// Deriving Hash here is okay: PartialEq is manually implemented to
// ensure that secrets are compared in constant-time.
+#[allow(clippy::derive_hash_xor_eq)]
#[derive(Clone, Hash)]
pub enum SecretKeyMaterial {
/// RSA secret key.