From c79b7abfb6a86822c88ed21bc6132f1d638f7eca Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Thu, 22 Aug 2019 15:12:59 +0300 Subject: [PATCH] add reset placeholder --- fido2/apdu.h | 4 ++++ targets/stm32l432/src/nfc.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/fido2/apdu.h b/fido2/apdu.h index 7ce8477..420fea6 100644 --- a/fido2/apdu.h +++ b/fido2/apdu.h @@ -42,6 +42,10 @@ extern int apdu_decode(uint8_t *data, size_t len, APDU_STRUCT *apdu); #define APDU_FIDO_U2F_AUTHENTICATE 0x02 #define APDU_FIDO_U2F_VERSION 0x03 #define APDU_FIDO_NFCCTAP_MSG 0x10 +#define APDU_FIDO_U2F_VENDOR_FIRST 0xc0 // First vendor defined command +#define APDU_FIDO_U2F_VENDOR_LAST 0xff // Last vendor defined command +#define APDU_SOLO_RESET 0xee + #define APDU_INS_SELECT 0xA4 #define APDU_INS_READ_BINARY 0xB0 #define APDU_GET_RESPONSE 0xC0 diff --git a/targets/stm32l432/src/nfc.c b/targets/stm32l432/src/nfc.c index 00a2d63..b2aded8 100644 --- a/targets/stm32l432/src/nfc.c +++ b/targets/stm32l432/src/nfc.c @@ -756,6 +756,12 @@ void apdu_process(uint8_t buf0, uint8_t *apduptr, APDU_STRUCT *apdu) } break; + case APDU_SOLO_RESET: + printf1(TAG_NFC, "Reset...\r\n"); + delay(10); + nfc_write_response(buf0, SW_INS_INVALID); + break; + default: printf1(TAG_NFC, "Unknown INS %02x\r\n", apdu->ins); nfc_write_response(buf0, SW_INS_INVALID);