diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-05 16:55:15 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-05 17:17:58 +0200 |
commit | f3229a742cb5707ea06490126b8f60ac2d4cc120 (patch) | |
tree | 358d8604c7e51086824d086556c27f440d9a2087 | |
parent | 263c5d2d34922cf9950aff6f6245e2d8122f4c65 (diff) | |
download | libnitrokey-f3229a742cb5707ea06490126b8f60ac2d4cc120.tar.gz libnitrokey-f3229a742cb5707ea06490126b8f60ac2d4cc120.tar.bz2 |
Slots token ID documentation and payload fields update
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r-- | NK_C_API.h | 8 | ||||
-rw-r--r-- | include/stick10_commands.h | 20 |
2 files changed, 22 insertions, 6 deletions
@@ -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<CommandID::WRITE_TO_SLOT> { 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<CommandID::WRITE_TO_SLOT> { 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 |