From a3571946002bf7e748613df5006c2f5a6564c1e4 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 7 Jul 2020 16:36:37 +0200 Subject: Deprecate old setters for UV ro/rw attribute Signed-off-by: Szczepan Zalega --- NK_C_API.cc | 4 +++- NK_C_API.h | 6 ++++-- libnitrokey/NitrokeyManager.h | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NK_C_API.cc b/NK_C_API.cc index 538a6a1..43eb980 100644 --- a/NK_C_API.cc +++ b/NK_C_API.cc @@ -604,6 +604,7 @@ extern "C" { }); } + // deprecated, noop on v0.51 and older (excl. v0.49) NK_C_API int NK_set_unencrypted_read_only(const char *user_pin) { auto m = NitrokeyManager::instance(); return get_without_result([&]() { @@ -611,7 +612,8 @@ extern "C" { }); } - NK_C_API int NK_set_unencrypted_read_write(const char *user_pin) { + // deprecated, noop on v0.51 and older (excl. v0.49) + 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); diff --git a/NK_C_API.h b/NK_C_API.h index 5341c08..53aa658 100644 --- a/NK_C_API.h +++ b/NK_C_API.h @@ -837,7 +837,8 @@ extern "C" { * @param user_pin 20 characters User PIN * @return command processing error code */ - NK_C_API int NK_set_unencrypted_read_only(const char *user_pin); + [[deprecated("NK_set_unencrypted_read_only is deprecated. Use NK_set_unencrypted_read_only_admin instead")]] + NK_C_API int NK_set_unencrypted_read_only(const char *user_pin); /** * Make unencrypted volume read-write. @@ -849,7 +850,8 @@ extern "C" { * @param user_pin 20 characters User PIN * @return command processing error code */ - NK_C_API int NK_set_unencrypted_read_write(const char *user_pin); + [[deprecated("NK_set_unencrypted_read_write is deprecated. Use NK_set_unencrypted_read_write_admin instead")]] + NK_C_API int NK_set_unencrypted_read_write(const char *user_pin); /** * Make unencrypted volume read-only. diff --git a/libnitrokey/NitrokeyManager.h b/libnitrokey/NitrokeyManager.h index 163a799..619b1ad 100644 --- a/libnitrokey/NitrokeyManager.h +++ b/libnitrokey/NitrokeyManager.h @@ -158,6 +158,7 @@ char * strndup(const char* str, size_t maxlen); * Does nothing otherwise. * @param user_pin User PIN */ + [[deprecated("set_unencrypted_read_only is deprecated. Use set_unencrypted_read_only_admin instead.")]] void set_unencrypted_read_only(const char *user_pin); /** @@ -174,6 +175,7 @@ char * strndup(const char* str, size_t maxlen); * Does nothing otherwise. * @param user_pin User PIN */ + [[deprecated("set_unencrypted_read_write is deprecated. Use set_unencrypted_read_write_admin instead")]] void set_unencrypted_read_write(const char *user_pin); /** -- cgit v1.2.3