aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2019-06-13 13:55:36 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2019-06-13 15:00:34 +0200
commit5d0789af44ffdcdd7d3de30582fe51d1d2ceb22d (patch)
treef1962b91d110eb698be6c76888b5aceea28593b3
parentb6685dc2d7620a4de36dd76d833f800d0a2aaac6 (diff)
downloadlibnitrokey-5d0789af44ffdcdd7d3de30582fe51d1d2ceb22d.tar.gz
libnitrokey-5d0789af44ffdcdd7d3de30582fe51d1d2ceb22d.tar.bz2
Define commands structs
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--libnitrokey/stick10_commands.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/libnitrokey/stick10_commands.h b/libnitrokey/stick10_commands.h
index f2ffba2..178b23f 100644
--- a/libnitrokey/stick10_commands.h
+++ b/libnitrokey/stick10_commands.h
@@ -882,6 +882,41 @@ class BuildAESKey : Command<CommandID::NEW_AES_KEY> {
};
+class FirmwareUpdate : Command<CommandID::FIRMWARE_UPDATE> {
+public:
+ struct CommandPayload {
+ uint8_t firmware_password[20];
+ std::string dissect() const {
+ std::stringstream ss;
+ print_to_ss_volatile(firmware_password);
+ return ss.str();
+ }
+ } __packed;
+
+ typedef Transaction<command_id(), struct CommandPayload, struct EmptyPayload>
+ CommandTransaction;
+
+};
+
+class FirmwarePasswordChange : Command<CommandID::FIRMWARE_PASSWORD_CHANGE> {
+public:
+ struct CommandPayload {
+ uint8_t firmware_password_current[20];
+ uint8_t firmware_password_new[20];
+ std::string dissect() const {
+ std::stringstream ss;
+ print_to_ss_volatile(firmware_password_current);
+ print_to_ss_volatile(firmware_password_new);
+ return ss.str();
+ }
+ } __packed;
+
+ typedef Transaction<command_id(), struct CommandPayload, struct EmptyPayload>
+ CommandTransaction;
+
+};
+
+
}
}
}