aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-07-26 20:53:19 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-01 13:54:57 +0200
commitf6bd34b262b66fde862aa3d95c339f5c587156eb (patch)
tree23b9ff9b03a06679d767d4a7706ac71f0a9be201 /include
parentc34196ea22e61c31fa83c22a3b73c19ba04a30bf (diff)
downloadlibnitrokey-f6bd34b262b66fde862aa3d95c339f5c587156eb.tar.gz
libnitrokey-f6bd34b262b66fde862aa3d95c339f5c587156eb.tar.bz2
Handle writing PW safe slot
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include')
-rw-r--r--include/NitrokeyManager.h4
-rw-r--r--include/stick10_commands.h4
2 files changed, 6 insertions, 2 deletions
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<CommandID::SET_PW_SAFE_SLOT_DATA_2> {
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;