summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/NitrokeyManager.h4
-rw-r--r--include/stick10_commands.h16
2 files changed, 20 insertions, 0 deletions
diff --git a/include/NitrokeyManager.h b/include/NitrokeyManager.h
index a3399fa..6f4ab75 100644
--- a/include/NitrokeyManager.h
+++ b/include/NitrokeyManager.h
@@ -40,6 +40,10 @@ namespace nitrokey {
void change_user_PIN(char *current_PIN, char *new_PIN);
void change_admin_PIN(char *current_PIN, char *new_PIN);
+ void enable_password_safe(const char *user_pin);
+
+ void get_password_safe_slot_status();
+
private:
NitrokeyManager();
~NitrokeyManager();
diff --git a/include/stick10_commands.h b/include/stick10_commands.h
index d923d93..c8eda03 100644
--- a/include/stick10_commands.h
+++ b/include/stick10_commands.h
@@ -340,12 +340,28 @@ class GetUserPasswordRetryCount
CommandTransaction;
};
+ template <typename T, typename Q, int N>
+ void write_array(T &ss, Q (&arr)[N]){
+ ss << std::hex << std::setfill('0') << std::setw(2);
+ for (int i=0; i<N; i++){
+ ss << arr[i] << " ";
+ }
+ ss << std::endl;
+ };
+
+
class GetPasswordSafeSlotStatus : Command<CommandID::GET_PW_SAFE_SLOT_STATUS> {
public:
struct ResponsePayload {
uint8_t password_safe_status[PWS_SLOT_COUNT];
bool isValid() const { return true; }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << "password_safe_status\t";
+ write_array(ss, password_safe_status);
+ return ss.str();
+ }
} __packed;
typedef Transaction<command_id(), struct EmptyPayload, struct ResponsePayload>