summaryrefslogtreecommitdiff
path: root/include/stick10_commands.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan.zalega@gmail.com>2016-03-05 17:10:14 +0100
committerSzczepan Zalega <szczepan.zalega@gmail.com>2016-03-05 17:10:14 +0100
commitd92707ca48137b47800006a09539470acb4e4d69 (patch)
tree36c87a71b3e2e7d208cb856b3ae219b44e14a904 /include/stick10_commands.h
parent27434dc0e877845cbfb229c5154c342107866fd5 (diff)
downloadlibnitrokey-d92707ca48137b47800006a09539470acb4e4d69.tar.gz
libnitrokey-d92707ca48137b47800006a09539470acb4e4d69.tar.bz2
adding basic tests
Diffstat (limited to 'include/stick10_commands.h')
-rw-r--r--include/stick10_commands.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/stick10_commands.h b/include/stick10_commands.h
index b140e99..ab1a5bb 100644
--- a/include/stick10_commands.h
+++ b/include/stick10_commands.h
@@ -196,6 +196,10 @@ class GetPasswordRetryCount : Command<CommandID::GET_PASSWORD_RETRY_COUNT> {
uint8_t password_retry_count;
bool isValid() const { return true; }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << " password_retry_count\t" << password_retry_count<< std::endl;
+ return ss.str(); }
} __packed;
typedef Transaction<command_id(), struct EmptyPayload, struct ResponsePayload>
@@ -209,6 +213,10 @@ class GetUserPasswordRetryCount
uint8_t password_retry_count;
bool isValid() const { return true; }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << " password_retry_count\t" << password_retry_count<< std::endl;
+ return ss.str(); }
} __packed;
typedef Transaction<command_id(), struct EmptyPayload, struct ResponsePayload>
@@ -233,12 +241,20 @@ class GetPasswordSafeSlotName : Command<CommandID::GET_PW_SAFE_SLOT_NAME> {
uint8_t slot_number;
bool isValid() const { return !(slot_number & 0xF0); }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << "slot_number\t" << slot_number << std::endl;
+ return ss.str(); }
} __packed;
struct ResponsePayload {
uint8_t slot_name[PWS_SLOTNAME_LENGTH];
bool isValid() const { return true; }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << " slot_name\t" << slot_name << std::endl;
+ return ss.str(); }
} __packed;
typedef Transaction<command_id(), struct CommandPayload,
@@ -252,12 +268,20 @@ class GetPasswordSafeSlotPassword
uint8_t slot_number;
bool isValid() const { return !(slot_number & 0xF0); }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << " slot_number\t" << slot_number<< std::endl;
+ return ss.str(); }
} __packed;
struct ResponsePayload {
uint8_t slot_password[PWS_PASSWORD_LENGTH];
bool isValid() const { return true; }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << " slot_password\t" << slot_password << std::endl;
+ return ss.str(); }
} __packed;
typedef Transaction<command_id(), struct CommandPayload,
@@ -271,12 +295,20 @@ class GetPasswordSafeSlotLogin
uint8_t slot_number;
bool isValid() const { return !(slot_number & 0xF0); }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << " slot_number\t" << slot_number<< std::endl;
+ return ss.str(); }
} __packed;
struct ResponsePayload {
uint8_t slot_login[PWS_LOGINNAME_LENGTH];
bool isValid() const { return true; }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << " slot_login\t" << slot_login<< std::endl;
+ return ss.str(); }
} __packed;
typedef Transaction<command_id(), struct CommandPayload,