summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-02-26 15:37:13 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-28 20:07:38 +0100
commita1e081303dc7f7329e5452dad7e6cedf7efe3699 (patch)
tree7b5d5acac65ea2774a7f83ba39b1a67341d27085
parent38c3b4c58e6c6b86d6241183be1814bac2e037d2 (diff)
downloadlibnitrokey-a1e081303dc7f7329e5452dad7e6cedf7efe3699.tar.gz
libnitrokey-a1e081303dc7f7329e5452dad7e6cedf7efe3699.tar.bz2
Add to device's ID USB path. Convert ID to hex.
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--NitrokeyManager.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index f2518b1..fa69ac6 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -113,6 +113,7 @@ using nitrokey::misc::strcpyT;
}
std::vector<std::string> NitrokeyManager::list_devices_by_cpuID(){
+ using misc::toHex;
//disconnect default device
disconnect();
@@ -139,9 +140,9 @@ using nitrokey::misc::strcpyT;
std::string id;
try {
const auto status = get_status_storage();
- const auto sc_id = status.ActiveSmartCardID_u32;
- const auto sd_id = status.ActiveSD_CardID_u32;
- id = std::to_string(sc_id) + ":" + std::to_string(sd_id);
+ const auto sc_id = toHex(status.ActiveSmartCardID_u32);
+ const auto sd_id = toHex(status.ActiveSD_CardID_u32);
+ id = sc_id + ":" + sd_id + "_p_" + p;
}
catch (const LongOperationInProgressException &e) {
LOGD1(std::string("Long operation in progress, setting ID to: ") + p);