aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/NitrokeyManager.h10
-rw-r--r--include/stick10_commands.h6
2 files changed, 12 insertions, 4 deletions
diff --git a/include/NitrokeyManager.h b/include/NitrokeyManager.h
index 00011e2..e6e79c7 100644
--- a/include/NitrokeyManager.h
+++ b/include/NitrokeyManager.h
@@ -17,7 +17,7 @@ namespace nitrokey {
public:
static NitrokeyManager *instance();
- bool authorize(const char *pin, const char *temporary_password);
+ bool first_authenticate(const char *pin, const char *temporary_password);
bool write_HOTP_slot(uint8_t slot_number, const char *slot_name, const char *secret, uint64_t hotp_counter,
const char *temporary_password);
bool write_TOTP_slot(uint8_t slot_number, const char *slot_name, const char *secret,
@@ -27,8 +27,8 @@ namespace nitrokey {
uint8_t last_interval);
bool set_time(uint64_t time);
bool get_time();
- bool erase_totp_slot(uint8_t slot_number);
- bool erase_hotp_slot(uint8_t slot_number);
+ bool erase_totp_slot(uint8_t slot_number, const char *temporary_password);
+ bool erase_hotp_slot(uint8_t slot_number, const char *temporary_password);
bool connect();
bool disconnect();
void set_debug(bool state);
@@ -59,6 +59,8 @@ namespace nitrokey {
void erase_password_safe_slot(uint8_t slot_number);
+ void user_authenticate(const char *user_password, const char *temporary_password);
+
private:
NitrokeyManager();
~NitrokeyManager();
@@ -72,7 +74,7 @@ namespace nitrokey {
bool is_valid_password_safe_slot_number(uint8_t slot_number) const;
uint8_t get_internal_slot_number_for_hotp(uint8_t slot_number) const;
uint8_t get_internal_slot_number_for_totp(uint8_t slot_number) const;
- bool erase_slot(uint8_t slot_number);
+ bool erase_slot(uint8_t slot_number, const char *temporary_password);
uint8_t *get_slot_name(uint8_t slot_number) const;
};
diff --git a/include/stick10_commands.h b/include/stick10_commands.h
index d88c36b..fbd0698 100644
--- a/include/stick10_commands.h
+++ b/include/stick10_commands.h
@@ -587,6 +587,12 @@ class UserAuthenticate : Command<CommandID::USER_AUTHENTICATE> {
uint8_t temporary_password[25];
bool isValid() const { return true; }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << "card_password:\t" << card_password << std::endl;
+ ss << "temporary_password:\t" << temporary_password << std::endl;
+ return ss.str();
+ }
} __packed;
typedef Transaction<command_id(), struct CommandPayload, struct EmptyPayload>