aboutsummaryrefslogtreecommitdiff
path: root/NK_C_API.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 09:37:31 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 15:42:39 +0100
commit4e6d39e9aae54658eb68a739d9eff55ab797c204 (patch)
tree4d36bd0a860a375349cdd28d78dd79b8081aa2ef /NK_C_API.cc
parent9b37634dd5c0783cc73e0317979968d0c454155e (diff)
downloadlibnitrokey-4e6d39e9aae54658eb68a739d9eff55ab797c204.tar.gz
libnitrokey-4e6d39e9aae54658eb68a739d9eff55ab797c204.tar.bz2
Divide unencrypted volume ro/rw commands for backward compatibility
Unencrypted volume ro/rw: rename user_admin_pin -> admin_pin to be consistent with latest API. Update description. Document PIN requirements in C++ API Extract pin type function Add C API for separate unencrypted volume read write handling Use correct commands to set ro/rw mode of unencrypted volume Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NK_C_API.cc')
-rw-r--r--NK_C_API.cc22
1 files changed, 18 insertions, 4 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc
index 8ce318f..f881caf 100644
--- a/NK_C_API.cc
+++ b/NK_C_API.cc
@@ -495,17 +495,31 @@ extern "C" {
});
}
- NK_C_API int NK_set_unencrypted_read_only(const char* user_admin_pin) {
+ NK_C_API int NK_set_unencrypted_read_only(const char *user_pin) {
auto m = NitrokeyManager::instance();
return get_without_result([&]() {
- m->set_unencrypted_read_only(user_admin_pin);
+ m->set_unencrypted_read_only(user_pin);
});
}
- NK_C_API int NK_set_unencrypted_read_write(const char* user_admin_pin) {
+ NK_C_API int NK_set_unencrypted_read_write(const char *user_pin) {
auto m = NitrokeyManager::instance();
return get_without_result([&]() {
- m->set_unencrypted_read_write(user_admin_pin);
+ m->set_unencrypted_read_write(user_pin);
+ });
+ }
+
+ NK_C_API int NK_set_unencrypted_read_only_admin(const char *admin_pin) {
+ auto m = NitrokeyManager::instance();
+ return get_without_result([&]() {
+ m->set_unencrypted_read_only_admin(admin_pin);
+ });
+ }
+
+ NK_C_API int NK_set_unencrypted_read_write_admin(const char *admin_pin) {
+ auto m = NitrokeyManager::instance();
+ return get_without_result([&]() {
+ m->set_unencrypted_read_write_admin(admin_pin);
});
}