Adjust ExtendedCap field names

This commit is contained in:
Heiko Schaefer 2021-08-25 13:32:30 +02:00
parent 159af0d98c
commit 20cfcead02
2 changed files with 9 additions and 9 deletions

View file

@ -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,
}
);
}

View file

@ -248,12 +248,12 @@ pub struct Historical {
#[derive(Debug, Eq, PartialEq)]
pub struct ExtendedCap {
pub features: HashSet<Features>,
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)