summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-12-12 17:45:35 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 15:42:38 +0100
commit08e0a45a8f10ae4fbe294a903b3a6264aa3c4333 (patch)
treedcc5b69a4a012f06aae73c4ad96acf5794e98117
parent66a67b7b69b9cb43a810449761c78883e9e11bd6 (diff)
downloadlibnitrokey-08e0a45a8f10ae4fbe294a903b3a6264aa3c4333.tar.gz
libnitrokey-08e0a45a8f10ae4fbe294a903b3a6264aa3c4333.tar.bz2
Correct variable name for unencrypted ro/rw switch
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--NK_C_API.cc8
-rw-r--r--NK_C_API.h10
-rw-r--r--NitrokeyManager.cc12
-rw-r--r--include/NitrokeyManager.h4
4 files changed, 18 insertions, 16 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc
index 9b53b49..8ce318f 100644
--- a/NK_C_API.cc
+++ b/NK_C_API.cc
@@ -495,17 +495,17 @@ 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_admin_pin) {
auto m = NitrokeyManager::instance();
return get_without_result([&]() {
- m->set_unencrypted_read_only(user_pin);
+ m->set_unencrypted_read_only(user_admin_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_admin_pin) {
auto m = NitrokeyManager::instance();
return get_without_result([&]() {
- m->set_unencrypted_read_write(user_pin);
+ m->set_unencrypted_read_write(user_admin_pin);
});
}
diff --git a/NK_C_API.h b/NK_C_API.h
index bd7130f..9ab29b5 100644
--- a/NK_C_API.h
+++ b/NK_C_API.h
@@ -428,21 +428,23 @@ extern "C" {
* Make unencrypted volume read-only.
* Device hides unencrypted volume for a second therefore make sure
* buffers are flushed before running.
+ * Accepts: User PIN for Storage v0.48 and below, Admin PIN for Storage v0.49+
* Storage only
- * @param user_pin 20 characters
+ * @param user_admin_pin 20 characters
* @return command processing error code
*/
- 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_admin_pin);
/**
* Make unencrypted volume read-write.
* Device hides unencrypted volume for a second therefore make sure
* buffers are flushed before running.
+ * Accepts: User PIN for Storage v0.48 and below, Admin PIN for Storage v0.49+
* Storage only
- * @param user_pin 20 characters
+ * @param user_admin_pin 20 characters
* @return command processing error code
*/
- 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_admin_pin);
/**
* Make encrypted volume read-only.
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index de52e25..d4a13d1 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -824,20 +824,20 @@ using nitrokey::misc::strcpyT;
stick20::SetupHiddenVolume::CommandTransaction::run(device, p);
}
- void NitrokeyManager::set_unencrypted_read_only(const char* user_pin) {
+ void NitrokeyManager::set_unencrypted_read_only(const char* user_admin_pin) {
//until 0.48 User PIN was sufficient, from 0.49 it needs Admin PIN
if (get_minor_firmware_version()<=48)
- misc::execute_password_command<stick20::SendSetReadonlyToUncryptedVolume>(device, user_pin);
+ misc::execute_password_command<stick20::SendSetReadonlyToUncryptedVolume>(device, user_admin_pin);
else
- misc::execute_password_command<stick20::SetUnencryptedVolumeReadOnlyAdmin>(device, user_pin);
+ misc::execute_password_command<stick20::SetUnencryptedVolumeReadOnlyAdmin>(device, user_admin_pin);
}
- void NitrokeyManager::set_unencrypted_read_write(const char* user_pin) {
+ void NitrokeyManager::set_unencrypted_read_write(const char* user_admin_pin) {
//until 0.48 User PIN was sufficient, from 0.49 it needs Admin PIN
if (get_minor_firmware_version()<=48)
- misc::execute_password_command<stick20::SendSetReadwriteToUncryptedVolume>(device, user_pin);
+ misc::execute_password_command<stick20::SendSetReadwriteToUncryptedVolume>(device, user_admin_pin);
else
- misc::execute_password_command<stick20::SetUnencryptedVolumeReadWriteAdmin>(device, user_pin);
+ misc::execute_password_command<stick20::SetUnencryptedVolumeReadWriteAdmin>(device, user_admin_pin);
}
void NitrokeyManager::export_firmware(const char* admin_pin) {
diff --git a/include/NitrokeyManager.h b/include/NitrokeyManager.h
index e0aa59f..67dd128 100644
--- a/include/NitrokeyManager.h
+++ b/include/NitrokeyManager.h
@@ -126,9 +126,9 @@ char * strndup(const char* str, size_t maxlen);
void unlock_hidden_volume(const char *hidden_volume_password);
void lock_hidden_volume();
- void set_unencrypted_read_only(const char *user_pin);
+ void set_unencrypted_read_only(const char *user_admin_pin);
- void set_unencrypted_read_write(const char *user_pin);
+ void set_unencrypted_read_write(const char *user_admin_pin);
void export_firmware(const char *admin_pin);
void enable_firmware_update(const char *firmware_pin);