chore: output format

This commit is contained in:
2021-07-17 14:20:39 +08:00
parent 3edd523fda
commit 40de8f71af

View File

@@ -47,7 +47,8 @@ fn print_cert_info(yubikey: &mut YubiKey, slot: SlotId) -> XResult<()> {
let cert = match Certificate::read(yubikey, slot) {
Ok(c) => c,
Err(e) => {
debugging!("error reading certificate in slot {:?}: {}", slot, e);
let slot_id: u8 = slot.into();
debugging!("error reading certificate in slot {:?}, id: {:x}: {}", slot, slot_id, e);
return simple_error!("error reading certificate in slot {:?}: {}", slot, e);
}
};
@@ -57,7 +58,7 @@ fn print_cert_info(yubikey: &mut YubiKey, slot: SlotId) -> XResult<()> {
let fingerprint_sha256 = Sha256::digest(&buf);
let slot_id: u8 = slot.into();
success!("Slot: {}", format!("{:x}", slot_id));
success!("Slot: {:?}, id: {:x}", slot, slot_id);
rust_util::util_msg::when(MessageType::DEBUG, || {
let cert_pem_obj = Pem {