diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-03-31 18:15:37 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-04-03 13:20:36 +0200 |
commit | 9782076fd0c80385f48e2a3c4c61c9dda06841b3 (patch) | |
tree | ad94f5c728d20f265dd8d5b24476f23a0b97cb0b /include | |
parent | 71fd63402dcbbc37d6c8b3818de35f7142b850b0 (diff) | |
download | libnitrokey-9782076fd0c80385f48e2a3c4c61c9dda06841b3.tar.gz libnitrokey-9782076fd0c80385f48e2a3c4c61c9dda06841b3.tar.bz2 |
Return OTP codes as strings to make sure they are zero-filled properly
Adjust Python tests for new OTP codes return value
Also remove manual 0-filling
Fixes #57
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/NitrokeyManager.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/NitrokeyManager.h b/include/NitrokeyManager.h index 7550998..a815571 100644 --- a/include/NitrokeyManager.h +++ b/include/NitrokeyManager.h @@ -29,10 +29,11 @@ namespace nitrokey { bool write_TOTP_slot(uint8_t slot_number, const char *slot_name, const char *secret, uint16_t time_window, bool use_8_digits, bool use_enter, bool use_tokenID, const char *token_ID, const char *temporary_password); - uint32_t get_HOTP_code(uint8_t slot_number, const char *user_temporary_password); - uint32_t get_TOTP_code(uint8_t slot_number, uint64_t challenge, uint64_t last_totp_time, uint8_t last_interval, - const char *user_temporary_password); - uint32_t get_TOTP_code(uint8_t slot_number, const char *user_temporary_password); + string get_HOTP_code(uint8_t slot_number, const char *user_temporary_password); + string get_TOTP_code(uint8_t slot_number, uint64_t challenge, uint64_t last_totp_time, + uint8_t last_interval, + const char *user_temporary_password); + string get_TOTP_code(uint8_t slot_number, const char *user_temporary_password); stick10::ReadSlot::ResponsePayload get_TOTP_slot_data(const uint8_t slot_number); stick10::ReadSlot::ResponsePayload get_HOTP_slot_data(const uint8_t slot_number); |