aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-11-12 11:06:11 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2016-12-03 16:01:49 +0100
commit3ab15750995624222fa32927fee7f9b1598ba3bf (patch)
tree88d7bd49d75f9e920042e8784e76b2afab55fd65
parentc51987f47307637beb6a1b75c351f273edda89cf (diff)
downloadlibnitrokey-3ab15750995624222fa32927fee7f9b1598ba3bf.tar.gz
libnitrokey-3ab15750995624222fa32927fee7f9b1598ba3bf.tar.bz2
Move temporary_password to packet end
To allow read-only backward compatibility for GET_CODE Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--include/stick10_commands_0.8.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/stick10_commands_0.8.h b/include/stick10_commands_0.8.h
index 5e05405..3644c4d 100644
--- a/include/stick10_commands_0.8.h
+++ b/include/stick10_commands_0.8.h
@@ -201,8 +201,13 @@ namespace nitrokey {
class GetHOTP : Command<CommandID::GET_CODE> {
public:
struct CommandPayload {
- uint8_t temporary_user_password[25];
uint8_t slot_number;
+ struct {
+ uint64_t challenge; //@unused
+ uint64_t last_totp_time; //@unused
+ uint8_t last_interval; //@unused
+ } __packed _unused;
+ uint8_t temporary_user_password[25];
bool isValid() const { return (slot_number & 0xF0); }
std::string dissect() const {
@@ -250,11 +255,11 @@ namespace nitrokey {
//user auth
public:
struct CommandPayload {
- uint8_t temporary_user_password[25];
uint8_t slot_number;
uint64_t challenge; //@unused
uint64_t last_totp_time; //@unused
uint8_t last_interval; //@unused
+ uint8_t temporary_user_password[25];
bool isValid() const { return !(slot_number & 0xF0); }
std::string dissect() const {