From 93350afd317250b4c5d4c2519dc7a9248f68cfdb Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Sat, 23 Jul 2016 14:00:49 +0200 Subject: Get TOTP writing feedback Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'NitrokeyManager.cc') diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 8b0fff6..5ef340c 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -144,9 +144,11 @@ namespace nitrokey{ strcpy((char *) (auth.temporary_password), temporary_password); auth.crc_to_authorize = WriteToTOTPSlot::CommandTransaction::getCRC(payload); Authorize::CommandTransaction::run(*device, auth); + auto auth_successful = device->last_command_sucessfull(); auto resp = WriteToTOTPSlot::CommandTransaction::run(*device, payload); - return false; + auto write_successful = device->last_command_sucessfull(); + return auth_successful && write_successful; } const char * NitrokeyManager::get_totp_slot_name(uint8_t slot_number) { -- cgit v1.2.1