From 46e7d3a181fab92fb8e394ed9b579b2b2f6a54a0 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Fri, 31 Mar 2023 00:41:12 +0200 Subject: [PATCH] Fix otp processing if other applications were processed before. Signed-off-by: Pol Henarejos --- src/usb/hid/hid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/usb/hid/hid.c b/src/usb/hid/hid.c index 2bdc6b8..b21cd3b 100644 --- a/src/usb/hid/hid.c +++ b/src/usb/hid/hid.c @@ -311,8 +311,10 @@ void tud_hid_set_report_cb(uint8_t itf, apdu.data = otp_frame_rx; apdu.nc = 64; apdu.rdata = otp_frame_tx; + apdu.header[0] = 0; apdu.header[1] = 0x01; apdu.header[2] = slot_id; + apdu.header[3] = 0; int ret = otp_process_apdu(); if (ret == 0x9000 && res_APDU_size > 0) { otp_send_frame(apdu.rdata, apdu.rlen);