aboutsummaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-10-31 17:48:18 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2016-11-26 18:56:27 +0100
commit9ad4796130a4ce192420563bb601468ffc292df9 (patch)
treec72fa01b9255a014ccef1551e91eaffadbd7c05d /NitrokeyManager.cc
parent8b49ee9e25efbca9d0d51fcc8be17fd115fc78fd (diff)
downloadlibnitrokey-9ad4796130a4ce192420563bb601468ffc292df9.tar.gz
libnitrokey-9ad4796130a4ce192420563bb601468ffc292df9.tar.bz2
Code refactoring - unify password only commands
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index 8bc0e38..eb34ef2 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -304,10 +304,10 @@ namespace nitrokey{
case DeviceModel::STORAGE:
{
auto p = get_payload<ChangeAdminUserPin20Current>();
- strcpyT(p.old_pin, current_PIN);
+ strcpyT(p.password, current_PIN);
p.set_kind(StoKind);
auto p2 = get_payload<ChangeAdminUserPin20New>();
- strcpyT(p2.new_pin, new_PIN);
+ strcpyT(p2.password, new_PIN);
p2.set_kind(StoKind);
ChangeAdminUserPin20Current::CommandTransaction::run(*device, p);
ChangeAdminUserPin20New::CommandTransaction::run(*device, p2);
@@ -445,12 +445,12 @@ namespace nitrokey{
}
case DeviceModel::STORAGE : {
auto p2 = get_payload<ChangeAdminUserPin20Current>();
- p2.set_kind(PasswordKind::Admin);
- strcpyT(p2.old_pin, admin_password);
+ p2.set_defaults();
+ strcpyT(p2.password, admin_password);
ChangeAdminUserPin20Current::CommandTransaction::run(*device, p2);
auto p3 = get_payload<stick20::UnlockUserPin>();
- p3.set_kind(PasswordKind::Admin);
- strcpyT(p3.user_new_password, new_user_password);
+ p3.set_defaults();
+ strcpyT(p3.password, new_user_password);
stick20::UnlockUserPin::CommandTransaction::run(*device, p3);
break;
}