diff --git a/Cargo.lock b/Cargo.lock index 5f32f7c..70caaa0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "card-cli" -version = "1.5.5" +version = "1.5.6" dependencies = [ "authenticator", "base64 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index d54c49e..444a61b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "card-cli" -version = "1.5.5" +version = "1.5.6" authors = ["Hatter Jiang "] edition = "2018" diff --git a/src/cmd_pivmeta.rs b/src/cmd_pivmeta.rs index c050057..df5f0b8 100644 --- a/src/cmd_pivmeta.rs +++ b/src/cmd_pivmeta.rs @@ -34,9 +34,17 @@ impl Command for CommandImpl { let mut yk = opt_result!(YubiKey::open(), "YubiKey not found: {}"); - 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); + 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); + SlotId::Retired(retired_slot_id) + } + }; json.insert("slot", slot.to_string()); if let Ok(meta) = metadata(&mut yk, slot_id) {