From f5ea1a2a4419241505e23ecd0d78d497cdce399c Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 13 Oct 2016 16:59:40 +0200 Subject: Convert char to int during dissection Signed-off-by: Szczepan Zalega --- include/stick20_commands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/stick20_commands.h') diff --git a/include/stick20_commands.h b/include/stick20_commands.h index c684e95..7539a19 100644 --- a/include/stick20_commands.h +++ b/include/stick20_commands.h @@ -182,7 +182,7 @@ class SendPasswordMatrixSetup : semantics::non_constructible { struct EmptyPayload> CommandTransaction; }; -#define d(x) ss << #x":\t" << x << std::endl; +#define d(x) ss << " "#x":\t" << (int)x << std::endl; class GetDeviceStatus : Command { public: -- cgit v1.2.1 From bf904facaa64baceadc439cf04f1fb224e95c0da Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 13 Oct 2016 17:01:42 +0200 Subject: Add TODO note Signed-off-by: Szczepan Zalega --- include/stick20_commands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/stick20_commands.h') diff --git a/include/stick20_commands.h b/include/stick20_commands.h index 7539a19..ee35b9e 100644 --- a/include/stick20_commands.h +++ b/include/stick20_commands.h @@ -190,7 +190,7 @@ class SendPasswordMatrixSetup : semantics::non_constructible { static const int payload_absolute_begin = 8; static const int padding_size = OUTPUT_CMD_RESULT_STICK20_STATUS_START - payload_absolute_begin; struct ResponsePayload { - uint8_t _padding[padding_size]; + uint8_t _padding[padding_size]; //TODO confirm padding in Storage firmware //data starts from 21st byte of packet -> 13th byte of payload uint8_t command_counter; uint8_t last_command; -- cgit v1.2.1 From 41b1f55ae303d7308a86ea4c0621122c4efe4ff9 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 14 Oct 2016 13:02:59 +0200 Subject: Command unlock user pin Signed-off-by: Szczepan Zalega --- include/stick20_commands.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/stick20_commands.h') diff --git a/include/stick20_commands.h b/include/stick20_commands.h index ee35b9e..03761a5 100644 --- a/include/stick20_commands.h +++ b/include/stick20_commands.h @@ -62,6 +62,26 @@ namespace stick20 { CommandTransaction; }; + + class UnlockUserPassword : Command { + public: + struct CommandPayload { + uint8_t kind; + uint8_t user_new_password[20]; + std::string dissect() const { + std::stringstream ss; + ss << " user_new_password:\t" << user_new_password<< std::endl; + return ss.str(); + } + void set_kind(PasswordKind k){ + kind = (uint8_t)k; + } + } __packed; + + typedef Transaction + CommandTransaction; + }; + class EnableEncryptedPartition : semantics::non_constructible { public: struct CommandPayload { -- cgit v1.2.1 From 801fcc59dbf04dfce4323d2a3cad99f9d643e525 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 14 Oct 2016 15:00:04 +0200 Subject: Support regenerating AES keys on NK Storage Signed-off-by: Szczepan Zalega --- include/stick20_commands.h | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'include/stick20_commands.h') diff --git a/include/stick20_commands.h b/include/stick20_commands.h index 03761a5..f4e7500 100644 --- a/include/stick20_commands.h +++ b/include/stick20_commands.h @@ -146,15 +146,25 @@ class ExportFirmware : semantics::non_constructible { struct EmptyPayload> CommandTransaction; }; -class CreateNewKeys : semantics::non_constructible { - public: - struct CommandPayload { - uint8_t password[30]; - }; + class CreateNewKeys : Command { + public: + struct CommandPayload { + uint8_t kind; + uint8_t admin_password[30]; //CS20_MAX_PASSWORD_LEN + std::string dissect() const { + std::stringstream ss; + ss << " admin_password:\t" << admin_password<< std::endl; + return ss.str(); + } + void setKindPrefixed(){ + kind = 'P'; + } + } __packed; + + typedef Transaction + CommandTransaction; + }; - typedef Transaction CommandTransaction; -}; class FillSDCardWithRandomChars : semantics::non_constructible { public: -- cgit v1.2.1