diff --git a/openpgp-card/src/card_app.rs b/openpgp-card/src/card_app.rs index 08e05ce..5d7b34f 100644 --- a/openpgp-card/src/card_app.rs +++ b/openpgp-card/src/card_app.rs @@ -554,7 +554,9 @@ impl CardApp { let data = match algo { Algo::Rsa(rsa) => Self::rsa_algo_attrs(rsa)?, Algo::Ecc(ecc) => Self::ecc_algo_attrs(ecc.oid(), ecc.ecc_type()), - _ => unimplemented!(), + _ => { + return Err(anyhow!("Unexpected Algo {:?}", algo).into()); + } }; // Command to PUT the algorithm attributes diff --git a/openpgp-card/src/keys.rs b/openpgp-card/src/keys.rs index 4481815..11bfb7c 100644 --- a/openpgp-card/src/keys.rs +++ b/openpgp-card/src/keys.rs @@ -88,9 +88,11 @@ fn tlv_to_pubkey(tlv: &Tlv, algo: &Algo) -> Result { Ok(PublicKeyMaterial::E(ecc)) } - (_, _, _) => { - unimplemented!() - } + (_, _, _) => Err(anyhow!( + "Unexpected public key material from card {:?}", + tlv + ) + .into()), } }