diff options
-rw-r--r-- | NitrokeyManager.cc | 3 | ||||
-rw-r--r-- | include/stick10_commands.h | 12 |
2 files changed, 1 insertions, 14 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 70b0132..eec595f 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -104,7 +104,7 @@ namespace nitrokey{ memset(payload.slot_token_id, 0, sizeof(payload.slot_token_id)); //????? Authorize::CommandPayload auth; - auth.initialize(); + initialize(auth); strcpy((char *) (auth.temporary_password), temporary_password); auth.crc_to_authorize = auth.crc_to_authorize = WriteToHOTPSlot::CommandTransaction::getCRC(payload); Authorize::CommandTransaction::run(*device, auth); @@ -140,7 +140,6 @@ namespace nitrokey{ bool NitrokeyManager::authorize(const char *pin, const char *temporary_password) { FirstAuthenticate::CommandPayload authreq; initialize(authreq); //TODO - authreq.initialize(); strcpy((char *) (authreq.card_password), pin); strcpy((char *) (authreq.temporary_password), temporary_password); FirstAuthenticate::CommandTransaction::run(*device, authreq); diff --git a/include/stick10_commands.h b/include/stick10_commands.h index b7f6de0..d15ee73 100644 --- a/include/stick10_commands.h +++ b/include/stick10_commands.h @@ -507,15 +507,6 @@ class WriteGeneralConfig : Command<CommandID::WRITE_CONFIG> { CommandTransaction; }; -// struct clear_on_const { -// clear_on_const(){ -// initialize(); -// } -// void initialize(){ -// bzero(this, sizeof(*this)); -// } -// }; - class FirstAuthenticate : Command<CommandID::FIRST_AUTHENTICATE> { public: struct CommandPayload { @@ -523,7 +514,6 @@ class FirstAuthenticate : Command<CommandID::FIRST_AUTHENTICATE> { uint8_t temporary_password[25]; bool isValid() const { return true; } - void initialize(){ bzero(this, sizeof(*this)); } std::string dissect() const { std::stringstream ss; @@ -556,8 +546,6 @@ class Authorize : Command<CommandID::AUTHORIZE> { uint32_t crc_to_authorize; uint8_t temporary_password[25]; - void initialize(){ bzero(this, sizeof(*this)); } - std::string dissect() const { std::stringstream ss; ss << " crc_to_authorize:\t" << std::hex << std::setw(2) << std::setfill('0') << crc_to_authorize<< std::endl; |