From 20cfcead02c3afc5c3858cf5e7c0a912b4b51e1e Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Wed, 25 Aug 2021 13:32:30 +0200 Subject: [PATCH] Adjust ExtendedCap field names --- openpgp-card/src/card_do/extended_cap.rs | 12 ++++++------ openpgp-card/src/card_do/mod.rs | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openpgp-card/src/card_do/extended_cap.rs b/openpgp-card/src/card_do/extended_cap.rs index 6468e00..dbe7a80 100644 --- a/openpgp-card/src/card_do/extended_cap.rs +++ b/openpgp-card/src/card_do/extended_cap.rs @@ -65,12 +65,12 @@ impl TryFrom<&[u8]> for ExtendedCap { Ok(Self { features: ec.0, - sm: ec.1, + sm_algo: ec.1, max_len_challenge: ec.2, max_len_cardholder_cert: ec.3, max_len_special_do: ec.4, - pin_2_format: ec.5 == 1, // FIXME: error if != 0|1 - mse_command: ec.6 == 1, // FIXME: error if != 0|1 + pin_block_2_format_support: ec.5 == 1, // FIXME: error if != 0|1 + mse_command_support: ec.6 == 1, // FIXME: error if != 0|1 }) } } @@ -99,12 +99,12 @@ mod test { Features::AlgoAttrsChangeable, Features::KdfDo ]), - sm: 0x0, + sm_algo: 0x0, max_len_challenge: 0xbfe, max_len_cardholder_cert: 0x800, max_len_special_do: 0xff, - pin_2_format: false, - mse_command: false, + pin_block_2_format_support: false, + mse_command_support: false, } ); } diff --git a/openpgp-card/src/card_do/mod.rs b/openpgp-card/src/card_do/mod.rs index 79f3c5a..97eb3e3 100644 --- a/openpgp-card/src/card_do/mod.rs +++ b/openpgp-card/src/card_do/mod.rs @@ -248,12 +248,12 @@ pub struct Historical { #[derive(Debug, Eq, PartialEq)] pub struct ExtendedCap { pub features: HashSet, - sm: u8, + sm_algo: u8, max_len_challenge: u16, max_len_cardholder_cert: u16, pub max_len_special_do: u16, - pin_2_format: bool, - mse_command: bool, + pin_block_2_format_support: bool, + mse_command_support: bool, } /// Features (first byte of Extended Capabilities)