From c34196ea22e61c31fa83c22a3b73c19ba04a30bf Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 26 Jul 2016 17:20:21 +0200 Subject: Prepare setting password safe slots Signed-off-by: Szczepan Zalega --- include/stick10_commands.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'include/stick10_commands.h') diff --git a/include/stick10_commands.h b/include/stick10_commands.h index 92bddd5..c3b0a37 100644 --- a/include/stick10_commands.h +++ b/include/stick10_commands.h @@ -462,6 +462,13 @@ class SetPasswordSafeSlotData : Command { uint8_t slot_password[PWS_PASSWORD_LENGTH]; bool isValid() const { return !(slot_number & 0xF0); } + std::string dissect() const { + std::stringstream ss; + ss << " slot_number\t" << (int)slot_number << std::endl; + ss << " slot_name\t" << (char*)slot_name << std::endl; + ss << " slot_password\t" << (char*)slot_password << std::endl; + return ss.str(); + } } __packed; typedef Transaction @@ -475,6 +482,12 @@ class SetPasswordSafeSlotData2 : Command { uint8_t slot_name[PWS_SLOTNAME_LENGTH]; bool isValid() const { return !(slot_number & 0xF0); } + std::string dissect() const { + std::stringstream ss; + ss << " slot_number\t" << (int)slot_number << std::endl; + ss << " slot_name\t" << (char*)slot_name << std::endl; + return ss.str(); + } } __packed; typedef Transaction @@ -487,6 +500,12 @@ class ErasePasswordSafeSlot : Command { uint8_t slot_number; bool isValid() const { return !(slot_number & 0xF0); } + std::string dissect() const { + std::stringstream ss; + ss << " slot_number\t" << (int)slot_number << std::endl; + return ss.str(); + } + } __packed; typedef Transaction @@ -496,12 +515,12 @@ class ErasePasswordSafeSlot : Command { class EnablePasswordSafe : Command { public: struct CommandPayload { - uint8_t password[30]; + uint8_t user_password[30]; bool isValid() const { return true; } std::string dissect() const { std::stringstream ss; - ss << " password\t" << password << std::endl; + ss << " user_password\t" << (char*) user_password << std::endl; return ss.str(); } } __packed; -- cgit v1.2.1