aboutsummaryrefslogtreecommitdiff
path: root/NK_C_API.cc
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 /NK_C_API.cc
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 'NK_C_API.cc')
-rw-r--r--NK_C_API.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc
index c0910a2..542c6ad 100644
--- a/NK_C_API.cc
+++ b/NK_C_API.cc
@@ -270,7 +270,7 @@ extern uint8_t NK_get_admin_retry_count(){
extern int NK_lock_device(){
auto m = NitrokeyManager::instance();
return get_without_result([&](){
- return m->lock_device();
+ m->lock_device();
});
}
@@ -293,9 +293,12 @@ extern const char *NK_get_password_safe_slot_password(uint8_t slot_number, const
return m->get_password_safe_slot_password(slot_number, temporary_password);
});
}
-extern int NK_write_password_safe_slot(){
+extern int NK_write_password_safe_slot(uint8_t slot_number, const char *slot_name, const char *slot_login,
+ const char *slot_password) {
auto m = NitrokeyManager::instance();
- //TODO
+ return get_without_result([&](){
+ m->write_password_safe_slot(slot_number, slot_name, slot_login, slot_password);
+ });
}