aboutsummaryrefslogtreecommitdiff
path: root/libnitrokey/stick10_commands.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2019-06-19 14:45:16 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2019-06-19 14:45:16 +0200
commit3fc4193776b4ea29354838df024a72d7c8349ea9 (patch)
tree65f0cf56c96cb4a667e1fdbefdca054314a6bf5a /libnitrokey/stick10_commands.h
parent2c749223714c4d7815ca6b2d1888169a864a0fec (diff)
parent12c4198187de476a4e27da16c7b8737e6550973a (diff)
downloadlibnitrokey-3fc4193776b4ea29354838df024a72d7c8349ea9.tar.gz
libnitrokey-3fc4193776b4ea29354838df024a72d7c8349ea9.tar.bz2
Merge branch 'backward_compatibility'
Do the HOTP slot counter conversion from ASCII to binary only for Storage v0.53 and lower. Storage v0.54 returns binary counter.
Diffstat (limited to 'libnitrokey/stick10_commands.h')
-rw-r--r--libnitrokey/stick10_commands.h5
1 files changed, 5 insertions, 0 deletions
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); }