diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-07-20 07:55:44 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-01 13:54:56 +0200 |
commit | 6d42e3d56a6851fa2463ef45226fd027867d74a7 (patch) | |
tree | 8599ec52fdd3cd2e4b3cc69658addfc4b3a9dfa2 /NitrokeyManager.cc | |
parent | f89bf6677c41cd56e65e39440fbb48617197ccb1 (diff) | |
download | libnitrokey-6d42e3d56a6851fa2463ef45226fd027867d74a7.tar.gz libnitrokey-6d42e3d56a6851fa2463ef45226fd027867d74a7.tar.bz2 |
Comments. Fix crc to authorize in write hotp
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r-- | NitrokeyManager.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index a2b324e..6058cbb 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -9,6 +9,7 @@ namespace nitrokey{ template <typename T> auto get_payload(){ + //Create, initialize and return by value command payload typename T::CommandPayload st; bzero(&st, sizeof(st)); return st; @@ -107,11 +108,11 @@ namespace nitrokey{ strcpy((char *) payload.slot_secret, secret); strcpy((char *) payload.slot_name, slot_name); payload.slot_counter = hotp_counter; - payload.slot_config; + payload.slot_config; //TODO auto auth = get_payload<Authorize>(); strcpy((char *) (auth.temporary_password), temporary_password); - auth.crc_to_authorize = auth.crc_to_authorize = WriteToHOTPSlot::CommandTransaction::getCRC(payload); + auth.crc_to_authorize = WriteToHOTPSlot::CommandTransaction::getCRC(payload); Authorize::CommandTransaction::run(*device, auth); auto resp = WriteToHOTPSlot::CommandTransaction::run(*device, payload); |