From f3c5653a0193312a47fe52a9132cf0f5a8bd83eb Mon Sep 17 00:00:00 2001
From: Szczepan Zalega <szczepan@nitrokey.com>
Date: Mon, 18 Mar 2019 16:19:53 +0100
Subject: Storage v0.54: send slot counter as binary integer, instead of string
 repr

Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
---
 NitrokeyManager.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index 7b8deaa..9562be1 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -556,8 +556,12 @@ using nitrokey::misc::strcpyT;
           break;
         }
         case DeviceModel::STORAGE: {
-          string counter = to_string(hotp_counter);
-          strcpyT(payload.slot_counter_s, counter.c_str());
+          if (get_minor_firmware_version() <= 53) {
+            string counter = to_string(hotp_counter);
+            strcpyT(payload.slot_counter_s, counter.c_str());
+          } else {
+            payload.slot_counter = hotp_counter;
+          }
           break;
         }
         default:
-- 
cgit v1.2.3