diff --git a/openpgp-card/src/apdu.rs b/openpgp-card/src/apdu.rs index e14c4f0..41eb698 100644 --- a/openpgp-card/src/apdu.rs +++ b/openpgp-card/src/apdu.rs @@ -29,7 +29,7 @@ pub(crate) fn send_command( where C: CardTransaction + ?Sized, { - log::debug!(" -> full APDU command: {:x?}", cmd); + log::debug!(" -> full APDU command: {:02x?}", cmd); let mut resp = RawResponse::try_from(send_command_low_level( card_tx, @@ -69,7 +69,7 @@ where } log::debug!( - " <- APDU response [len {}]: {:x?}", + " <- APDU response [len {}]: {:02x?}", resp.raw_data().len(), resp ); @@ -158,11 +158,11 @@ where let serialized = partial.serialize(ext_len, expect_response)?; - log::trace!(" -> chained APDU command: {:x?}", &serialized); + log::trace!(" -> chained APDU command: {:02x?}", &serialized); let resp = card_tx.transmit(&serialized, buf_size)?; - log::trace!(" <- APDU response: {:x?}", &resp); + log::trace!(" <- APDU response: {:02x?}", &resp); if resp.len() < 2 { return Err(Error::ResponseLength(resp.len())); @@ -200,11 +200,11 @@ where return Err(Error::CommandTooLong(serialized.len())); } - log::trace!(" -> APDU command: {:x?}", &serialized); + log::trace!(" -> APDU command: {:02x?}", &serialized); let resp = card_tx.transmit(&serialized, buf_size)?; - log::trace!(" <- APDU response: {:x?}", resp); + log::trace!(" <- APDU response: {:02x?}", resp); Ok(resp) } diff --git a/openpgp-card/src/lib.rs b/openpgp-card/src/lib.rs index 587b6c6..07e8146 100644 --- a/openpgp-card/src/lib.rs +++ b/openpgp-card/src/lib.rs @@ -128,7 +128,7 @@ pub trait CardTransaction { let resp = apdu::send_command(self, ad, true)?; let value = Value::from(resp.data()?, true)?; - log::trace!(" ARD value: {:x?}", value); + log::trace!(" ARD value: {:02x?}", value); Ok(ApplicationRelatedData(Tlv::new( Tags::ApplicationRelatedData,