diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-01-24 17:33:49 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-03-11 15:41:39 +0100 |
commit | 2543e09fa25fa8ed54920c519de32d4b4da074d4 (patch) | |
tree | c328c02c529fb8e6d275284c2edd1327fcc9856f /NitrokeyManager.cc | |
parent | 02ac032b7493749bfd64533fe0c7f1e8ff46fe75 (diff) | |
download | libnitrokey-2543e09fa25fa8ed54920c519de32d4b4da074d4.tar.gz libnitrokey-2543e09fa25fa8ed54920c519de32d4b4da074d4.tar.bz2 |
Read slot command support
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r-- | NitrokeyManager.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 09a0def..b12895d 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -468,6 +468,7 @@ namespace nitrokey{ 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); @@ -728,4 +729,23 @@ namespace nitrokey{ } } - } + uint32_t NitrokeyManager::get_TOTP_code(uint8_t slot_number, const char *user_temporary_password) { + return get_TOTP_code(slot_number, 0, 0, 0, user_temporary_password); + } + + stick10::ReadSlot::ResponsePayload NitrokeyManager::get_OTP_slot_data(const uint8_t slot_number) { + auto p = get_payload<stick10::ReadSlot>(); + p.slot_number = slot_number; + auto data = stick10::ReadSlot::CommandTransaction::run(*device, p); + return data.data(); + } + + stick10::ReadSlot::ResponsePayload NitrokeyManager::get_TOTP_slot_data(const uint8_t slot_number) { + return get_OTP_slot_data(get_internal_slot_number_for_totp(slot_number)); + } + + stick10::ReadSlot::ResponsePayload NitrokeyManager::get_HOTP_slot_data(const uint8_t slot_number) { + return get_OTP_slot_data(get_internal_slot_number_for_hotp(slot_number)); + } + +} |