diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2019-06-13 13:56:02 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2019-06-13 15:00:38 +0200 |
commit | 749434cab529ef689dacfc368b9dea101a40dba8 (patch) | |
tree | 367dcd752e205b90b2a46fcafa64838ecaee8c80 | |
parent | 5d0789af44ffdcdd7d3de30582fe51d1d2ceb22d (diff) | |
download | libnitrokey-749434cab529ef689dacfc368b9dea101a40dba8.tar.gz libnitrokey-749434cab529ef689dacfc368b9dea101a40dba8.tar.bz2 |
Handle new commands in C++ API
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r-- | NitrokeyManager.cc | 14 | ||||
-rw-r--r-- | libnitrokey/NitrokeyManager.h | 4 |
2 files changed, 18 insertions, 0 deletions
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<FirmwareUpdate>(); + 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<FirmwarePasswordChange>(); + 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); }; } |