diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2024-02-20 13:06:22 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2024-02-20 14:20:16 +0100 |
commit | 4d0f02a366e1c9a746ffe6b8d3702f65db040814 (patch) | |
tree | 0d43e554d8aa09f7f3e1c5b4dbd8f7fb72179837 | |
parent | 40014c758c9fdfb5844fbf5cba95b7ea43d0ebac (diff) |
openpgp: Fix creating Brainpool keys with OpenSSL.
-rw-r--r-- | openpgp/src/crypto/backend/openssl/asymmetric.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/openpgp/src/crypto/backend/openssl/asymmetric.rs b/openpgp/src/crypto/backend/openssl/asymmetric.rs index 7da21b43..6fd9f6a7 100644 --- a/openpgp/src/crypto/backend/openssl/asymmetric.rs +++ b/openpgp/src/crypto/backend/openssl/asymmetric.rs @@ -538,13 +538,7 @@ where mpi::PublicKey, mpi::SecretKeyMaterial)> { - let nid = match curve { - Curve::NistP256 => Nid::X9_62_PRIME256V1, - Curve::NistP384 => Nid::SECP384R1, - Curve::NistP521 => Nid::SECP521R1, - _ => return Err(crate::Error::UnsupportedEllipticCurve(curve.clone()).into()), - }; - + let nid = (&curve).try_into()?; let group = EcGroup::from_curve_name(nid)?; let key = EcKey::generate(&group)?; |