aboutsummaryrefslogtreecommitdiff
path: root/include/command_id.h
diff options
context:
space:
mode:
authorszszszsz <szszszsz@users.noreply.github.com>2016-10-19 17:33:30 +0200
committerGitHub <noreply@github.com>2016-10-19 17:33:30 +0200
commit82a0fc21f039971acac18df0ee57e2bb010865e1 (patch)
treef4f487257c99826a6d208fa6ea6f48b4ab7392ed /include/command_id.h
parent10631378c61b7ce54ad6f31dc1d16c3ba4c49d32 (diff)
parente81a132c210e03b6b0a7404a8c96ebda889a5676 (diff)
downloadlibnitrokey-82a0fc21f039971acac18df0ee57e2bb010865e1.tar.gz
libnitrokey-82a0fc21f039971acac18df0ee57e2bb010865e1.tar.bz2
Merge pull request #42 from Nitrokey/13-storage_pro_cmds
Support Pro stick commands on Storage device
Diffstat (limited to 'include/command_id.h')
-rw-r--r--include/command_id.h42
1 files changed, 38 insertions, 4 deletions
diff --git a/include/command_id.h b/include/command_id.h
index 87d270e..8148cc1 100644
--- a/include/command_id.h
+++ b/include/command_id.h
@@ -4,8 +4,42 @@
namespace nitrokey {
namespace proto {
-
-#define STICK20_CMD_START_VALUE 0x20
+ namespace stick20 {
+ enum class device_status : uint8_t {
+ idle = 0,
+ ok,
+ busy,
+ wrong_password,
+ busy_progressbar,
+ password_matrix_ready,
+ no_user_password_unlock,
+ smartcard_error,
+ security_bit_active
+ };
+ const int CMD_START_VALUE = 0x20;
+ const int CMD_END_VALUE = 0x60;
+ }
+ namespace stick10 {
+ enum class command_status : uint8_t {
+ ok = 0,
+ wrong_CRC,
+ wrong_slot,
+ slot_not_programmed,
+ wrong_password = 4,
+ not_authorized,
+ timestamp_warning,
+ no_name_error,
+ not_supported,
+ unknown_command,
+ AES_dec_failed
+ };
+ enum class device_status : uint8_t {
+ ok = 0,
+ busy = 1,
+ error,
+ received_report,
+ };
+ }
enum class CommandID : uint8_t {
@@ -32,8 +66,8 @@ enum class CommandID : uint8_t {
CHANGE_USER_PIN = 0x14,
CHANGE_ADMIN_PIN = 0x15,
- STICK20_CMD_SEND_PASSWORD = STICK20_CMD_START_VALUE + 18,
- STICK20_CMD_SEND_NEW_PASSWORD = STICK20_CMD_START_VALUE + 19,
+ STICK20_CMD_SEND_PASSWORD = stick20::CMD_START_VALUE + 18,
+ STICK20_CMD_SEND_NEW_PASSWORD = stick20::CMD_START_VALUE + 19,
ENABLE_CRYPTED_PARI = 0x20,
DISABLE_CRYPTED_PARI,