diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2019-06-19 12:06:00 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2019-06-19 14:41:16 +0200 |
commit | 2ca5deb106ede1ffd236f153abae8fe6e3b0401c (patch) | |
tree | 03ad86918b55e16c3ba00a8f3648cad10a526228 /libnitrokey | |
parent | 2c749223714c4d7815ca6b2d1888169a864a0fec (diff) | |
download | libnitrokey-2ca5deb106ede1ffd236f153abae8fe6e3b0401c.tar.gz libnitrokey-2ca5deb106ede1ffd236f153abae8fe6e3b0401c.tar.bz2 |
Add function reading HOTP slot details
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'libnitrokey')
-rw-r--r-- | libnitrokey/NitrokeyManager.h | 1 | ||||
-rw-r--r-- | libnitrokey/stick10_commands.h | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/libnitrokey/NitrokeyManager.h b/libnitrokey/NitrokeyManager.h index 0691035..33ede1b 100644 --- a/libnitrokey/NitrokeyManager.h +++ b/libnitrokey/NitrokeyManager.h @@ -299,6 +299,7 @@ char * strndup(const char* str, size_t maxlen); void enable_firmware_update_pro(const char *firmware_pin); void change_firmware_update_password_pro(const char *firmware_pin_current, const char *firmware_pin_new); + bool is_internal_hotp_slot_number(uint8_t slot_number) const; }; } diff --git a/libnitrokey/stick10_commands.h b/libnitrokey/stick10_commands.h index 178b23f..5e8a5aa 100644 --- a/libnitrokey/stick10_commands.h +++ b/libnitrokey/stick10_commands.h @@ -304,8 +304,13 @@ class GetHOTP : Command<CommandID::GET_CODE> { class ReadSlot : Command<CommandID::READ_SLOT> { public: + enum class CounterFormat { + ASCII = 0, + BINARY = 1, + }; struct CommandPayload { uint8_t slot_number; + CounterFormat data_format; //Storage v0.54+ only: slot_counter value format: 0 - in ascii, 1 - binary bool isValid() const { return !(slot_number & 0xF0); } |