Skip to content

Commit

Permalink
process non-sign commands if sign protocol interrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
djb committed Mar 22, 2016
1 parent 25c9b7a commit 42444ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/commander.c
Original file line number Diff line number Diff line change
Expand Up @@ -1375,9 +1375,7 @@ static void commander_parse(char *command)
TFA_VERIFY = 0;

if (found_cmd != CMD_sign) {
commander_fill_report(cmd_str(CMD_sign), NULL, DBB_ERR_IO_INVALID_CMD);
memset(sign_command, 0, COMMANDER_REPORT_SIZE);
goto exit;
goto other;
}

if (!memory_read_unlocked()) {
Expand Down Expand Up @@ -1419,6 +1417,7 @@ static void commander_parse(char *command)
goto exit;
}

other:
// Other commands
status = commander_touch_button(found_cmd);
if (status == DBB_TOUCHED || status == DBB_OK) {
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ static void tests_echo_tfa(void)
u_assert_str_has(utils_read_decrypted_report(), cmd_str(CMD_echo));

api_format_send_cmd(cmd_str(CMD_device), "info", PASSWORD_STAND);
u_assert_str_has(utils_read_decrypted_report(), flag_msg(DBB_ERR_IO_INVALID_CMD));
u_assert_str_has_not(utils_read_decrypted_report(), attr_str(ATTR_error));

api_format_send_cmd(cmd_str(CMD_sign), hash_sign, PASSWORD_STAND);
u_assert_str_has(utils_read_decrypted_report(), cmd_str(CMD_echo));
Expand Down

0 comments on commit 42444ee

Please sign in to comment.