aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-10-13 16:56:44 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-10-13 16:56:44 +0200
commitba97d2efd73bd004bc3d1b0bf76e32e17e739144 (patch)
treeed54080aa4a167541866fbcb2d8eb7538b25b9c2
parent10631378c61b7ce54ad6f31dc1d16c3ba4c49d32 (diff)
downloadlibnitrokey-ba97d2efd73bd004bc3d1b0bf76e32e17e739144.tar.gz
libnitrokey-ba97d2efd73bd004bc3d1b0bf76e32e17e739144.tar.bz2
NK Storage: update counters before getting
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--NitrokeyManager.cc6
1 files changed, 6 insertions, 0 deletions
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;
}