From 9782076fd0c80385f48e2a3c4c61c9dda06841b3 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 31 Mar 2017 18:15:37 +0200 Subject: 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 --- include/NitrokeyManager.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include') 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); -- cgit v1.2.3