aboutsummaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-08-09 13:25:19 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-09 18:34:00 +0200
commitbcfc7f44632717855ed75a3e643278a3ddee7309 (patch)
treebadc4598f7fe5e42c37d214cc212563b12505992 /NitrokeyManager.cc
parent95a4b415b76ff94cd270dcc3c6a53efd8b152914 (diff)
downloadlibnitrokey-bcfc7f44632717855ed75a3e643278a3ddee7309.tar.gz
libnitrokey-bcfc7f44632717855ed75a3e643278a3ddee7309.tar.bz2
Return a vector to C API to duplicate there
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 14e31b2..4b7f591 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -282,12 +282,12 @@ namespace nitrokey{
EnablePasswordSafe::CommandTransaction::run(*device, p);
}
- uint8_t * NitrokeyManager::get_password_safe_slot_status() {
- auto responsePayload = GetPasswordSafeSlotStatus::CommandTransaction::run(*device); //TODO FIXME
- auto res = new uint8_t[16];
- memcpy(res, responsePayload.data().password_safe_status, 16*sizeof (uint8_t));
- //FIXME return vector<uint8_t> and do copy on C_API side
- return res;
+ vector <uint8_t> NitrokeyManager::get_password_safe_slot_status() {
+ auto responsePayload = GetPasswordSafeSlotStatus::CommandTransaction::run(*device);
+ vector<uint8_t> v = vector<uint8_t>(responsePayload.data().password_safe_status,
+ responsePayload.data().password_safe_status
+ + sizeof(responsePayload.data().password_safe_status));
+ return v;
}
uint8_t NitrokeyManager::get_user_retry_count() {