From b1fbfa8eede1f2f9d003e49c027d5e4cb8a56bfe Mon Sep 17 00:00:00 2001
From: Szczepan Zalega <szczepan@nitrokey.com>
Date: Tue, 2 Aug 2016 13:38:22 +0200
Subject: Support for command: is_aes_supported

Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
---
 include/NitrokeyManager.h  | 2 ++
 include/device.h           | 2 +-
 include/stick10_commands.h | 8 ++++++--
 3 files changed, 9 insertions(+), 3 deletions(-)

(limited to 'include')

diff --git a/include/NitrokeyManager.h b/include/NitrokeyManager.h
index 4f1dcfa..e9b3be2 100644
--- a/include/NitrokeyManager.h
+++ b/include/NitrokeyManager.h
@@ -75,6 +75,8 @@ namespace nitrokey {
 
         vector<uint8_t> read_config();
 
+        bool is_AES_supported(const char *user_password);
+
     private:
         NitrokeyManager();
         ~NitrokeyManager();
diff --git a/include/device.h b/include/device.h
index ffc38e5..a27c019 100644
--- a/include/device.h
+++ b/include/device.h
@@ -50,7 +50,7 @@ public:
   std::chrono::milliseconds get_retry_timeout() const { return m_retry_timeout; };
     std::chrono::milliseconds get_send_receive_delay() const {return m_send_receive_delay;}
 
-    int get_last_command_status() const;
+    int get_last_command_status() const {return last_command_status;};
     void set_last_command_status(uint8_t _err) { last_command_status = _err;} ;
     bool last_command_sucessfull() const {return last_command_status == 0;};
     DeviceModel get_device_model() const {return m_model;}
diff --git a/include/stick10_commands.h b/include/stick10_commands.h
index 6df8727..e49e2a4 100644
--- a/include/stick10_commands.h
+++ b/include/stick10_commands.h
@@ -714,11 +714,15 @@ class ChangeUserPin : Command<CommandID::CHANGE_USER_PIN> {
       CommandTransaction;
 };
 
-// TODO why is it needed?
 class IsAESSupported : Command<CommandID::DETECT_SC_AES> {
  public:
   struct CommandPayload {
-    uint8_t password[20];
+    uint8_t user_password[20];
+      std::string dissect() const {
+          std::stringstream ss;
+          ss << " user_password:\t" <<  user_password<< std::endl;
+          return ss.str();
+      }
   } __packed;
 
   typedef Transaction<command_id(), struct CommandPayload, struct EmptyPayload>
-- 
cgit v1.2.3