diff --git a/openpgp-card/src/card_do.rs b/openpgp-card/src/card_do.rs index 6f3a2bf..b46e1a0 100644 --- a/openpgp-card/src/card_do.rs +++ b/openpgp-card/src/card_do.rs @@ -507,7 +507,7 @@ impl Display for KeyInformation { /// KeyStatus is contained in `KeyInformation`. It encodes if key material on a card was imported /// or generated on the card. -#[derive(Debug, PartialEq, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Clone, Copy)] #[non_exhaustive] pub enum KeyStatus { NotPresent, @@ -558,7 +558,7 @@ impl Display for ApplicationIdentifier { } /// 6 Historical Bytes -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct HistoricalBytes { /// category indicator byte cib: u8, @@ -574,7 +574,7 @@ pub struct HistoricalBytes { } /// Card Capabilities (see 6 Historical Bytes) -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct CardCapabilities { command_chaining: bool, extended_lc_le: bool, @@ -598,7 +598,7 @@ impl Display for CardCapabilities { } /// Card service data (see 6 Historical Bytes) -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct CardServiceData { select_by_full_df_name: bool, // Application Selection by full DF name (AID) select_by_partial_df_name: bool, // Application Selection by partial DF name @@ -754,7 +754,7 @@ impl Display for ExtendedLengthInfo { } /// Cardholder Related Data (see spec pg. 22) -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct CardholderRelatedData { name: Option>, lang: Option>, @@ -781,7 +781,7 @@ impl Display for CardholderRelatedData { /// 4.4.3.5 Sex /// /// Encoded in accordance with -#[derive(Debug, PartialEq, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum Sex { NotKnown, Male, @@ -829,7 +829,7 @@ impl From for Sex { /// Individual language for Language Preferences (4.4.3.4), accessible via `CardholderRelatedData`. /// /// Encoded according to -#[derive(Debug, PartialEq, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum Lang { Value([u8; 2]), Invalid(u8), @@ -882,7 +882,7 @@ impl From<&[u8; 2]> for Lang { } /// PW status Bytes (see spec page 23) -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct PWStatusBytes { pub(crate) pw1_cds_valid_once: bool, pub(crate) pw1_pin_block: bool, diff --git a/openpgp-card/src/errors.rs b/openpgp-card/src/errors.rs index f140d6e..76c9c0f 100644 --- a/openpgp-card/src/errors.rs +++ b/openpgp-card/src/errors.rs @@ -50,7 +50,7 @@ impl From for Error { } /// OpenPGP card "Status Bytes" (ok statuses and errors) -#[derive(thiserror::Error, Debug, PartialEq, Copy, Clone)] +#[derive(thiserror::Error, Debug, PartialEq, Eq, Copy, Clone)] #[non_exhaustive] pub enum StatusBytes { #[error("Command correct")] diff --git a/openpgp-card/src/keys.rs b/openpgp-card/src/keys.rs index 3e27677..e3511e6 100644 --- a/openpgp-card/src/keys.rs +++ b/openpgp-card/src/keys.rs @@ -339,10 +339,10 @@ fn card_algo_rsa(algo_info: AlgoInfo, key_type: KeyType, rsa_bits: u16) -> Resul Ok((**algo.last().unwrap()).clone()) } else { // RSA with this bit length is not in algo_info - return Err(Error::UnsupportedAlgo(format!( + Err(Error::UnsupportedAlgo(format!( "RSA {} unsupported according to algo_info", rsa_bits - ))); + ))) } } diff --git a/tools/src/bin/opgpcard/main.rs b/tools/src/bin/opgpcard/main.rs index ec3136c..ca2639e 100644 --- a/tools/src/bin/opgpcard/main.rs +++ b/tools/src/bin/opgpcard/main.rs @@ -586,7 +586,7 @@ fn pick_card_for_reading(ident: Option) -> Result) -> Result'"); println!(); - return Err(anyhow::anyhow!("Specify card")); + Err(anyhow::anyhow!("Specify card")) } } }