Skip to content

Avoid unnecessary commands when querying the retry counts #200

@robinkrahl

Description

@robinkrahl

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;
}

Isn’t it possible to directly use the response of GetDeviceStatus for Storage devices?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions