From f6bd34b262b66fde862aa3d95c339f5c587156eb Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 26 Jul 2016 20:53:19 +0200 Subject: Handle writing PW safe slot Signed-off-by: Szczepan Zalega --- include/NitrokeyManager.h | 4 ++++ include/stick10_commands.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/NitrokeyManager.h b/include/NitrokeyManager.h index 6f65324..541945b 100644 --- a/include/NitrokeyManager.h +++ b/include/NitrokeyManager.h @@ -53,6 +53,10 @@ namespace nitrokey { const char *get_password_safe_slot_password(uint8_t slot_number, const char *temporary_password); const char *get_password_safe_slot_login(uint8_t slot_number, const char *temporary_password); + void + write_password_safe_slot(uint8_t slot_number, const char *slot_name, const char *slot_login, + const char *slot_password); + private: NitrokeyManager(); ~NitrokeyManager(); diff --git a/include/stick10_commands.h b/include/stick10_commands.h index c3b0a37..16448b0 100644 --- a/include/stick10_commands.h +++ b/include/stick10_commands.h @@ -479,13 +479,13 @@ class SetPasswordSafeSlotData2 : Command { public: struct CommandPayload { uint8_t slot_number; - uint8_t slot_name[PWS_SLOTNAME_LENGTH]; + uint8_t slot_login_name[PWS_LOGINNAME_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_login_name\t" << (char*)slot_login_name << std::endl; return ss.str(); } } __packed; -- cgit v1.2.3