diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-07-23 13:46:46 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-01 13:54:56 +0200 |
commit | 587d24002711d905f95a8749694b15f5ca68656d (patch) | |
tree | d385dbb19e028d386f20691ac4386a5965814384 /NitrokeyManager.cc | |
parent | 6eec45d9f1dfdfc14d9f5b3ef9f6de03b4277b85 (diff) | |
download | libnitrokey-587d24002711d905f95a8749694b15f5ca68656d.tar.gz libnitrokey-587d24002711d905f95a8749694b15f5ca68656d.tar.bz2 |
Check has command failed or not on device
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r-- | NitrokeyManager.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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}; |