summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openpgp/src/crypto/backend/nettle/ecdh.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/openpgp/src/crypto/backend/nettle/ecdh.rs b/openpgp/src/crypto/backend/nettle/ecdh.rs
index 93d22a07..c26a843b 100644
--- a/openpgp/src/crypto/backend/nettle/ecdh.rs
+++ b/openpgp/src/crypto/backend/nettle/ecdh.rs
@@ -210,9 +210,15 @@ pub fn decrypt<R>(recipient: &Key<key::PublicParts, R>,
Sx.into()
}
- _ => {
- return Err(Error::UnsupportedEllipticCurve(curve.clone()).into());
- }
+ // Not implemented in Nettle
+ Curve::BrainpoolP256 | Curve::BrainpoolP512 =>
+ return
+ Err(Error::UnsupportedEllipticCurve(curve.clone()).into()),
+
+ // N/A
+ Curve::Unknown(_) | Curve::Ed25519 =>
+ return
+ Err(Error::UnsupportedEllipticCurve(curve.clone()).into()),
};
decrypt_unwrap(recipient, &S, ciphertext)