diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-07-20 08:12:20 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-01 13:54:56 +0200 |
commit | fb37116ea77f7961b12b1e289c3d48e6e517ea88 (patch) | |
tree | ba67e240be3d94bfb9d45d7d3b0e17bd0b834d7b /NK_C_API.cc | |
parent | 6d42e3d56a6851fa2463ef45226fd027867d74a7 (diff) | |
download | libnitrokey-fb37116ea77f7961b12b1e289c3d48e6e517ea88.tar.gz libnitrokey-fb37116ea77f7961b12b1e289c3d48e6e517ea88.tar.bz2 |
Write to TOTP slot
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NK_C_API.cc')
-rw-r--r-- | NK_C_API.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc index cc35794..4d9b17e 100644 --- a/NK_C_API.cc +++ b/NK_C_API.cc @@ -28,7 +28,7 @@ extern uint32_t NK_get_hotp_code(uint8_t slot_number){ extern uint32_t NK_get_totp_code(uint8_t slot_number, uint64_t challenge, uint64_t last_totp_time, uint8_t last_interval){ auto m = NitrokeyManager::instance(); - return m->get_TOTP_code(slot_number, 0, 0, 0); + return m->get_TOTP_code(slot_number, challenge, last_totp_time, last_interval); } extern int NK_erase_hotp_slot(uint8_t slot_number) { @@ -46,9 +46,10 @@ extern int NK_write_hotp_slot(uint8_t slot_number, const char *slot_name, const return m->write_HOTP_slot(slot_number, slot_name, secret, hotp_counter, temporary_password); } -extern int NK_write_totp_slot(uint8_t slot_number, const char *secret, uint16_t time_window) { +extern int NK_write_totp_slot(uint8_t slot_number, const char *slot_name, const char *secret, uint16_t time_window, + const char *temporary_password) { auto m = NitrokeyManager::instance(); - return m->write_TOTP_slot(slot_number, secret, time_window); + return m->write_TOTP_slot(slot_number, slot_name, secret, time_window, temporary_password); } extern const char* NK_get_totp_slot_name(uint8_t slot_number){ |