Skip to content

Commit

Permalink
Add debug PRINTF
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Mar 14, 2024
1 parent 3e98639 commit 2d309b8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/gpg_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ void gpg_io_do(unsigned int io_flags) {
break;
}

PRINTF("[IO] - io_do: 1st APDU=0x %02x.%02x.%02x.%02x - %d (0x%x)\n",
G_gpg_vstate.io_cla,
G_gpg_vstate.io_ins,
G_gpg_vstate.io_p1,
G_gpg_vstate.io_p2,
G_gpg_vstate.io_lc,
G_gpg_vstate.io_lc);
while (G_gpg_vstate.io_cla & CLA_APP_CHAIN) {
G_io_apdu_buffer[0] = ((SW_OK >> 8) & 0xFF);
G_io_apdu_buffer[1] = (SW_OK & 0xFF);
Expand All @@ -338,6 +345,13 @@ void gpg_io_do(unsigned int io_flags) {
if ((G_gpg_vstate.io_length + G_gpg_vstate.io_lc) > GPG_IO_BUFFER_LENGTH) {
return;
}
PRINTF("[IO] - io_do: Next APDU=0x %02x.%02x.%02x.%02x - %d (0x%x)\n",
G_gpg_vstate.io_cla,
G_gpg_vstate.io_ins,
G_gpg_vstate.io_p1,
G_gpg_vstate.io_p2,
G_gpg_vstate.io_lc,
G_gpg_vstate.io_lc);
memmove(G_gpg_vstate.work.io_buffer + G_gpg_vstate.io_length,
G_io_apdu_buffer + OFFSET_CDATA,
G_gpg_vstate.io_lc);
Expand Down

0 comments on commit 2d309b8

Please sign in to comment.