diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2021-09-08 14:13:35 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2021-09-08 14:13:35 +0200 |
commit | 4c3902d15fb7c1089c1b72b63c882837fa54d63d (patch) | |
tree | bf5d01a00cee6af610ba14f4b81510ee4f342bad /openpgp | |
parent | 0c0621ed263657e1d1348a62d7ceb59f2823bf76 (diff) |
openpgp: Avoid catchall.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/crypto/backend/nettle/ecdh.rs | 12 |
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) |