Reset shall call for user presence and can only be called within the 10 seconds from boot.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-09-22 19:25:04 +02:00
parent 2d5fffedb9
commit d95bc1aba6

View File

@@ -20,10 +20,16 @@
#include "file.h"
#include "fido.h"
#include "apdu.h"
#include "ctap.h"
#include "bsp/board.h"
extern void scan_all();
int cbor_reset() {
if (board_millis() > 10000)
return CTAP2_ERR_NOT_ALLOWED;
if (check_user_presence() == false)
return CTAP2_ERR_USER_ACTION_TIMEOUT;
initialize_flash(true);
scan_all();
return 0;