From 9f0e18f1a91a768717481dbf6b88eedd066a46c9 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 24 Oct 2016 14:42:03 +0200 Subject: Another set of Storage password-only commands Signed-off-by: Szczepan Zalega --- include/stick20_commands.h | 118 +++------------------------------------------ 1 file changed, 8 insertions(+), 110 deletions(-) diff --git a/include/stick20_commands.h b/include/stick20_commands.h index 34dda60..75bce1c 100644 --- a/include/stick20_commands.h +++ b/include/stick20_commands.h @@ -96,27 +96,8 @@ namespace nitrokey { class EnableEncryptedPartition : public PasswordCommand {}; class DisableEncryptedPartition : public PasswordCommand {}; class EnableHiddenEncryptedPartition : public PasswordCommand {}; - - class DisableHiddenEncryptedPartition : Command { - public: - typedef Transaction - CommandTransaction; - }; - - class EnableFirmwareUpdate : Command { - public: - struct CommandPayload { - uint8_t password[30]; // TODO check w/ firmware - std::string dissect() const { - std::stringstream ss; - print_to_ss( password ); - return ss.str(); - } - }; - - typedef Transaction - CommandTransaction; - }; + class DisableHiddenEncryptedPartition : public PasswordCommand {}; + class EnableFirmwareUpdate : public PasswordCommand {}; class UpdatePassword : Command { public: @@ -135,20 +116,7 @@ namespace nitrokey { CommandTransaction; }; - class ExportFirmware : Command { - public: - struct CommandPayload { - uint8_t password[30]; - std::string dissect() const { - std::stringstream ss; - print_to_ss( password ); - return ss.str(); - } - }; - - typedef Transaction - CommandTransaction; - }; + class ExportFirmware : public PasswordCommand {}; class CreateNewKeys : Command { public: @@ -171,23 +139,7 @@ namespace nitrokey { CommandTransaction; }; - - class FillSDCardWithRandomChars : Command { - public: - struct CommandPayload { - uint8_t volume_flag; - uint8_t password[30]; - std::string dissect() const { - std::stringstream ss; - print_to_ss( (int)volume_flag ); - print_to_ss( password ); - return ss.str(); - } - }; - - typedef Transaction - CommandTransaction; - }; + class FillSDCardWithRandomChars : public PasswordCommand {}; class SetupHiddenVolume : Command { public: @@ -234,50 +186,9 @@ namespace nitrokey { // TODO fix original nomenclature - class SendSetReadonlyToUncryptedVolume : Command { - public: - struct CommandPayload { - uint8_t password[30]; - std::string dissect() const { - std::stringstream ss; - print_to_ss( password ); - return ss.str(); - } - }; - - typedef Transaction - CommandTransaction; - }; - - class SendSetReadwriteToUncryptedVolume : Command { - public: - struct CommandPayload { - uint8_t password[30]; - std::string dissect() const { - std::stringstream ss; - print_to_ss( password ); - return ss.str(); - } - }; - - typedef Transaction - CommandTransaction; - }; - - class SendClearNewSdCardFound : Command { - public: - struct CommandPayload { - uint8_t password[30]; - std::string dissect() const { - std::stringstream ss; - print_to_ss( password ); - return ss.str(); - } - }; - - typedef Transaction - CommandTransaction; - }; + class SendSetReadonlyToUncryptedVolume : public PasswordCommand {}; + class SendSetReadwriteToUncryptedVolume : public PasswordCommand {}; + class SendClearNewSdCardFound : public PasswordCommand {}; class SendStartup : Command { public: @@ -309,20 +220,7 @@ namespace nitrokey { CommandTransaction; }; - class LockFirmware : Command { - public: - struct CommandPayload { - uint8_t password[30]; - std::string dissect() const { - std::stringstream ss; -// ss << " admin_password:\t" << admin_password << std::endl; - return ss.str(); - } - }; - - typedef Transaction - CommandTransaction; - }; + class LockFirmware : public PasswordCommand {}; class ProductionTest : Command { public: -- cgit v1.2.3