From ba97d2efd73bd004bc3d1b0bf76e32e17e739144 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 13 Oct 2016 16:56:44 +0200 Subject: NK Storage: update counters before getting Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index d827292..ac6ce77 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -312,10 +312,16 @@ namespace nitrokey{ } uint8_t NitrokeyManager::get_user_retry_count() { + if(device->get_device_model() == DeviceModel::STORAGE){ + stick20::GetDeviceStatus::CommandTransaction::run(*device); + } auto response = GetUserPasswordRetryCount::CommandTransaction::run(*device); return response.data().password_retry_count; } uint8_t NitrokeyManager::get_admin_retry_count() { + if(device->get_device_model() == DeviceModel::STORAGE){ + stick20::GetDeviceStatus::CommandTransaction::run(*device); + } auto response = GetPasswordRetryCount::CommandTransaction::run(*device); return response.data().password_retry_count; } -- cgit v1.2.1