feat: v1.5.6, piv-meta supports 9a,9c,9d,9e

This commit is contained in:
2023-05-13 00:45:45 +08:00
parent d3c666de4c
commit 709f83ce77
3 changed files with 13 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -336,7 +336,7 @@ dependencies = [
[[package]]
name = "card-cli"
version = "1.5.5"
version = "1.5.6"
dependencies = [
"authenticator",
"base64 0.13.1",

View File

@@ -1,6 +1,6 @@
[package]
name = "card-cli"
version = "1.5.5"
version = "1.5.6"
authors = ["Hatter Jiang <jht5945@gmail.com>"]
edition = "2018"

View File

@@ -34,9 +34,17 @@ impl Command for CommandImpl {
let mut yk = opt_result!(YubiKey::open(), "YubiKey not found: {}");
let slot_id = match slot {
"9a" => SlotId::Authentication,
"9c" => SlotId::Signature,
"9d" => SlotId::KeyManagement,
"9e" => SlotId::CardAuthentication,
_ => {
let retired_slot_id = opt_result!(RetiredSlotId::from_str(slot), "Slot not found: {}");
debugging!("Slot id: {}", retired_slot_id);
let slot_id = SlotId::Retired(retired_slot_id);
SlotId::Retired(retired_slot_id)
}
};
json.insert("slot", slot.to_string());
if let Ok(meta) = metadata(&mut yk, slot_id) {