Browse Source

Display a more precise error message for unknown EC keys

pull/10/head
Rodolphe Breard 5 years ago
parent
commit
f1f95c4d99
  1. 7
      acme_common/src/crypto/openssl_keys.rs

7
acme_common/src/crypto/openssl_keys.rs

@ -23,8 +23,11 @@ macro_rules! get_key_type {
Id::EC => match $key.ec_key()?.group().curve_name() { Id::EC => match $key.ec_key()?.group().curve_name() {
Some(Nid::X9_62_PRIME256V1) => KeyType::EcdsaP256, Some(Nid::X9_62_PRIME256V1) => KeyType::EcdsaP256,
Some(Nid::SECP384R1) => KeyType::EcdsaP384, Some(Nid::SECP384R1) => KeyType::EcdsaP384,
_ => {
return Err("Unsupported EC key".into());
Some(nid) => {
return Err(format!("{:?}: Unsupported EC key.", nid).into());
}
None => {
return Err("None: Unsupported EC key".into());
} }
}, },
_ => { _ => {

Loading…
Cancel
Save