diff --git a/fido2/device.h b/fido2/device.h index 0c11fe8..d440ca6 100644 --- a/fido2/device.h +++ b/fido2/device.h @@ -30,6 +30,7 @@ void main_loop_delay(); void heartbeat(); +void device_reboot(); void authenticator_read_state(AuthenticatorState * ); diff --git a/pc/device.c b/pc/device.c index 0944254..cf91610 100644 --- a/pc/device.c +++ b/pc/device.c @@ -43,7 +43,11 @@ void device_set_status(uint32_t status) __device_status = status; } - +void device_reboot() +{ + printf1(TAG_RED, "REBOOT command recieved!\r\n"); + exit(100); +} int udp_server() { diff --git a/targets/stm32l432/src/nfc.c b/targets/stm32l432/src/nfc.c index d49782d..ed01e9a 100644 --- a/targets/stm32l432/src/nfc.c +++ b/targets/stm32l432/src/nfc.c @@ -757,10 +757,10 @@ void apdu_process(uint8_t buf0, uint8_t *apduptr, APDU_STRUCT *apdu) break; case APDU_SOLO_RESET: - if (apdu.lc == 18 && !memcmp(apdu.data, "Reset solo please>", 18)) { + if (apdu.lc == 4 && !memcmp(apdu.data, "\x12\x56\xab\xf0", 4)) { printf1(TAG_NFC, "Reset...\r\n"); delay(10); - NVIC_SystemReset(); + device_reboot(); while(1); } else { printf1(TAG_NFC, "Reset FAIL\r\n");