From eb318bc381b8ba58940a15cd0f964af648545940 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Fri, 23 Sep 2022 18:13:01 +0200 Subject: [PATCH] Return error on bad CLA. Signed-off-by: Pol Henarejos --- src/fido/fido.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fido/fido.c b/src/fido/fido.c index 1f478fe..61ec800 100644 --- a/src/fido/fido.c +++ b/src/fido/fido.c @@ -307,7 +307,7 @@ bool check_user_presence() { if (user_present_time_limit == 0 || user_present_time_limit+TRANSPORT_TIME_LIMIT < board_millis()) { if (wait_button_pressed() == true) //timeout return false; - user_present_time_limit = board_millis(); + //user_present_time_limit = board_millis(); } #endif return true; @@ -336,6 +336,8 @@ static const cmd_t cmds[] = { }; int fido_process_apdu() { + if (CLA(apdu) != 0x00) + return SW_CLA_NOT_SUPPORTED(); for (const cmd_t *cmd = cmds; cmd->ins != 0x00; cmd++) { if (cmd->ins == INS(apdu)) {