aboutsummaryrefslogtreecommitdiff
path: root/include/stick10_commands_0.8.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-11-18 12:52:50 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2016-12-03 16:01:50 +0100
commit9c2feef240e396648dfb2378f7d2428b0593c9f2 (patch)
tree3b28b50a3aae29c2ad7ca7c1e57001d70ce139e5 /include/stick10_commands_0.8.h
parentcbccc871329c5522449010ae5007278123508820 (diff)
downloadlibnitrokey-9c2feef240e396648dfb2378f7d2428b0593c9f2.tar.gz
libnitrokey-9c2feef240e396648dfb2378f7d2428b0593c9f2.tar.bz2
Support longer secrets (40 bytes) for NK Pro 0.8
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include/stick10_commands_0.8.h')
-rw-r--r--include/stick10_commands_0.8.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/stick10_commands_0.8.h b/include/stick10_commands_0.8.h
index e880c0a..f0e28a6 100644
--- a/include/stick10_commands_0.8.h
+++ b/include/stick10_commands_0.8.h
@@ -75,7 +75,23 @@ namespace nitrokey {
}
} __packed;
- typedef Transaction<command_id(), struct CommandPayload, struct EmptyPayload>
+
+ struct ResponsePayload {
+ union {
+ uint8_t data[40];
+ } __packed;
+
+ bool isValid() const { return true; }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << "data:" << std::endl
+ << ::nitrokey::misc::hexdump((const char *) (&data), sizeof data);
+ return ss.str();
+ }
+ } __packed;
+
+
+ typedef Transaction<command_id(), struct CommandPayload, struct ResponsePayload>
CommandTransaction;
};