From 587d24002711d905f95a8749694b15f5ca68656d Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Sat, 23 Jul 2016 13:46:46 +0200 Subject: Check has command failed or not on device Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index bd4b705..8b0fff6 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -115,9 +115,11 @@ namespace nitrokey{ strcpy((char *) (auth.temporary_password), temporary_password); auth.crc_to_authorize = WriteToHOTPSlot::CommandTransaction::getCRC(payload); Authorize::CommandTransaction::run(*device, auth); + auto auth_successful = device->last_command_sucessfull(); auto resp = WriteToHOTPSlot::CommandTransaction::run(*device, payload); - return false; + auto write_successful = device->last_command_sucessfull(); + return auth_successful && write_successful; } enum totp_config{digits8=0, enter=1, tokenID=2}; -- cgit v1.2.3