From f3229a742cb5707ea06490126b8f60ac2d4cc120 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 5 Aug 2016 16:55:15 +0200 Subject: Slots token ID documentation and payload fields update Signed-off-by: Szczepan Zalega --- NK_C_API.h | 8 ++++---- include/stick10_commands.h | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/NK_C_API.h b/NK_C_API.h index 259a245..43a2e34 100644 --- a/NK_C_API.h +++ b/NK_C_API.h @@ -150,8 +150,8 @@ extern int NK_erase_totp_slot(uint8_t slot_number, const char *temporary_passwor * @param hotp_counter uint32_t starting value of HOTP counter * @param use_8_digits should returned codes be 6 (false) or 8 digits (true) * @param use_enter press ENTER key after sending OTP code using double-pressed scroll/num/capslock - * @param use_tokenID FIXME add documentation - * @param token_ID FIXME add documentation + * @param use_tokenID @see token_ID + * @param token_ID @see https://openauthentication.org/token-specs/, 'Class A' section * @param temporary_password char[25](Pro) admin temporary password * @return command processing error code */ @@ -167,8 +167,8 @@ extern int NK_write_hotp_slot(uint8_t slot_number, const char *slot_name, const * @param time_window uint16_t time window for this TOTP * @param use_8_digits should returned codes be 6 (false) or 8 digits (true) * @param use_enter press ENTER key after sending OTP code using double-pressed scroll/num/capslock - * @param use_tokenID FIXME add documentation - * @param token_ID FIXME add documentation + * @param use_tokenID @see token_ID + * @param token_ID @see https://openauthentication.org/token-specs/, 'Class A' section * @param temporary_password char[20](Pro) admin temporary password * @return command processing error code */ diff --git a/include/stick10_commands.h b/include/stick10_commands.h index b9a249d..ef83747 100644 --- a/include/stick10_commands.h +++ b/include/stick10_commands.h @@ -95,7 +95,15 @@ class WriteToHOTPSlot : Command { bool use_tokenID : 1; }; }; - uint8_t slot_token_id[13]; + union{ + uint8_t slot_token_id[13]; /** OATH Token Identifier */ + struct{ /** @see https://openauthentication.org/token-specs/ */ + uint8_t omp[2]; + uint8_t tt[2]; + uint8_t mui[8]; + uint8_t keyboard_layout; //disabled feature in nitroapp as of 20160805 + } slot_token_fields; + }; uint64_t slot_counter; bool isValid() const { return !(slot_number & 0xF0); } @@ -136,7 +144,15 @@ class WriteToTOTPSlot : Command { bool use_tokenID : 1; }; }; - uint8_t slot_token_id[13]; + union{ + uint8_t slot_token_id[13]; /** OATH Token Identifier */ + struct{ /** @see https://openauthentication.org/token-specs/ */ + uint8_t omp[2]; + uint8_t tt[2]; + uint8_t mui[8]; + uint8_t keyboard_layout; //disabled feature in nitroapp as of 20160805 + } slot_token_fields; + }; uint16_t slot_interval; bool isValid() const { return !(slot_number & 0xF0); } //TODO check -- cgit v1.2.1