diff options
-rw-r--r-- | NitrokeyManager.cc | 2 | ||||
-rw-r--r-- | include/device_proto.h | 2 | ||||
-rw-r--r-- | include/stick10_commands.h | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 7f3bfd0..4c2c834 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -198,7 +198,7 @@ namespace nitrokey{ } case DeviceModel::STORAGE: { std::string counter = std::to_string(hotp_counter); - strcpyT(payload.slot_counter, counter.c_str()); + strcpyT(payload.slot_counter_s, counter.c_str()); break; } default: diff --git a/include/device_proto.h b/include/device_proto.h index 45f165b..7316dc8 100644 --- a/include/device_proto.h +++ b/include/device_proto.h @@ -105,7 +105,7 @@ namespace nitrokey { uint8_t command_id; uint8_t device_status; //@see stick20::device_status uint8_t progress_bar_value; - } storage_status __packed; + } __packed storage_status; } __packed; uint32_t crc; diff --git a/include/stick10_commands.h b/include/stick10_commands.h index a947e1e..f02fd70 100644 --- a/include/stick10_commands.h +++ b/include/stick10_commands.h @@ -104,7 +104,10 @@ class WriteToHOTPSlot : Command<CommandID::WRITE_TO_SLOT> { uint8_t keyboard_layout; //disabled feature in nitroapp as of 20160805 } slot_token_fields; }; - uint64_t slot_counter; + union{ + uint64_t slot_counter; + uint8_t slot_counter_s[8]; + } __packed; bool isValid() const { return !(slot_number & 0xF0); } std::string dissect() const { |