From 749434cab529ef689dacfc368b9dea101a40dba8 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 13 Jun 2019 13:56:02 +0200 Subject: Handle new commands in C++ API Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 14 ++++++++++++++ libnitrokey/NitrokeyManager.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 7b8deaa..ea409ef 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -1167,4 +1167,18 @@ using nitrokey::misc::strcpyT; return data.data(); }; + void NitrokeyManager::enable_firmware_update_pro(const char *firmware_pin) { + auto p = get_payload(); + strcpyT(p.firmware_password, firmware_pin); + FirmwareUpdate::CommandTransaction::run(device, p); + } + + void + NitrokeyManager::change_firmware_update_password_pro(const char *firmware_pin_current, const char *firmware_pin_new) { + auto p = get_payload(); + strcpyT(p.firmware_password_current, firmware_pin_current); + strcpyT(p.firmware_password_new, firmware_pin_new); + FirmwarePasswordChange::CommandTransaction::run(device, p); + } + } diff --git a/libnitrokey/NitrokeyManager.h b/libnitrokey/NitrokeyManager.h index 2d8d1b6..0691035 100644 --- a/libnitrokey/NitrokeyManager.h +++ b/libnitrokey/NitrokeyManager.h @@ -295,6 +295,10 @@ char * strndup(const char* str, size_t maxlen); void wink(); stick20::ProductionTest::ResponsePayload production_info(); + + void enable_firmware_update_pro(const char *firmware_pin); + + void change_firmware_update_password_pro(const char *firmware_pin_current, const char *firmware_pin_new); }; } -- cgit v1.2.3