diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2018-04-10 08:19:42 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-04-10 08:19:42 +0200 |
commit | 306186faab1bf1b8321fecdb2c50176b35a3f953 (patch) | |
tree | 3769e709ceb001ad931ebbab99d336372df127f2 /libnitrokey/stick10_commands_0.8.h | |
parent | 92d4621442795b83dff55009c99e47d4a3d93bef (diff) | |
parent | 7f3d4ce81a0a38d9591dc4c746bcb75edfe80caa (diff) | |
download | libnitrokey-306186faab1bf1b8321fecdb2c50176b35a3f953.tar.gz libnitrokey-306186faab1bf1b8321fecdb2c50176b35a3f953.tar.bz2 |
Merge branch '102-get_status_invalid'
Fixes #102
Diffstat (limited to 'libnitrokey/stick10_commands_0.8.h')
-rw-r--r-- | libnitrokey/stick10_commands_0.8.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libnitrokey/stick10_commands_0.8.h b/libnitrokey/stick10_commands_0.8.h index a04946f..9477890 100644 --- a/libnitrokey/stick10_commands_0.8.h +++ b/libnitrokey/stick10_commands_0.8.h @@ -322,7 +322,11 @@ namespace nitrokey { }; uint8_t temporary_admin_password[25]; - std::string dissect() const { + static constexpr uint8_t special_HOTP_slots = 3; + bool isValid() const { return numlock < special_HOTP_slots && capslock < special_HOTP_slots + && scrolllock < special_HOTP_slots && enable_user_password < 2; } + + std::string dissect() const { std::stringstream ss; ss << "numlock:\t" << (int)numlock << std::endl; ss << "capslock:\t" << (int)capslock << std::endl; |