Add debug PRINTF

This commit is contained in:
Charles-Edouard de la Vergne 2024-03-14 09:00:33 +01:00
parent 3e98639670
commit 2d309b8c79
No known key found for this signature in database
GPG Key ID: F12296941B7BB9C6

View File

@ -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);
@ -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);