aboutsummaryrefslogtreecommitdiff
path: root/NK_C_API.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 16:03:16 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 16:03:16 +0100
commitd5486ba77235a874245fbee07a75cea89fa59ea2 (patch)
tree7f2df53da4c018fbfa6ec57809bcd2fcefaf0624 /NK_C_API.cc
parent102ee60cd8ee9e5ce263de1d4a775acf29f37fbc (diff)
parenta262472826830ea0a98a4da2fa8f665d359b8789 (diff)
downloadlibnitrokey-d5486ba77235a874245fbee07a75cea89fa59ea2.tar.gz
libnitrokey-d5486ba77235a874245fbee07a75cea89fa59ea2.tar.bz2
Merge branch 'wip-support_storage_v0.51'
Support for functionality added in v0.49/v0.51
Diffstat (limited to 'NK_C_API.cc')
-rw-r--r--NK_C_API.cc39
1 files changed, 37 insertions, 2 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc
index 33a5fbb..f881caf 100644
--- a/NK_C_API.cc
+++ b/NK_C_API.cc
@@ -495,20 +495,48 @@ extern "C" {
});
}
- NK_C_API int NK_set_unencrypted_read_only(const char* user_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_pin);
});
}
- NK_C_API int NK_set_unencrypted_read_write(const char* user_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_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);
+ });
+ }
+
+ NK_C_API int NK_set_encrypted_read_only(const char* admin_pin) {
+ auto m = NitrokeyManager::instance();
+ return get_without_result([&]() {
+ m->set_encrypted_volume_read_only(admin_pin);
+ });
+ }
+
+ NK_C_API int NK_set_encrypted_read_write(const char* admin_pin) {
+ auto m = NitrokeyManager::instance();
+ return get_without_result([&]() {
+ m->set_encrypted_volume_read_write(admin_pin);
+ });
+ }
+
NK_C_API int NK_export_firmware(const char* admin_pin) {
auto m = NitrokeyManager::instance();
return get_without_result([&]() {
@@ -569,6 +597,13 @@ extern "C" {
NK_C_API int NK_get_major_firmware_version() {
auto m = NitrokeyManager::instance();
return get_with_result([&]() {
+ return m->get_major_firmware_version();
+ });
+ }
+
+ NK_C_API int NK_get_minor_firmware_version() {
+ auto m = NitrokeyManager::instance();
+ return get_with_result([&]() {
return m->get_minor_firmware_version();
});
}