|
|
@ -228,7 +228,8 @@ namespace cryptoki { |
|
|
|
|
|
|
|
|
|
|
|
SlotList Library::slotList(bool tokenPresent, std::string name) { |
|
|
|
SlotList Library::slotList(bool tokenPresent, std::string name) { |
|
|
|
CRYPTOLOG("log"); |
|
|
|
CRYPTOLOG("log"); |
|
|
|
CRYPTOLOG("looking for card name: ")<<name<<(tokenPresent?" with token":""); |
|
|
|
CRYPTOLOG("looking for card name: \"") |
|
|
|
|
|
|
|
<<name<<(tokenPresent?"\" with token":""); |
|
|
|
SlotList res; |
|
|
|
SlotList res; |
|
|
|
CK_ULONG count(0); |
|
|
|
CK_ULONG count(0); |
|
|
|
//! calls @c C_GetSlotList
|
|
|
|
//! calls @c C_GetSlotList
|
|
|
@ -248,7 +249,7 @@ namespace cryptoki { |
|
|
|
if (!*this) return res; |
|
|
|
if (!*this) return res; |
|
|
|
for (CK_ULONG i(0); i<count; ++i) { |
|
|
|
for (CK_ULONG i(0); i<count; ++i) { |
|
|
|
Slot s(*this, slots[i]); |
|
|
|
Slot s(*this, slots[i]); |
|
|
|
CRYPTOLOG("found slot ")<<s.slotinfo().slotDescription; |
|
|
|
CRYPTOLOG("found slot \"")<<s.slotinfo().slotDescription<<"\""; |
|
|
|
if (!name.size() || name==s.slotinfo().slotDescription) { |
|
|
|
if (!name.size() || name==s.slotinfo().slotDescription) { |
|
|
|
CRYPTOLOG("-> slot matches"); |
|
|
|
CRYPTOLOG("-> slot matches"); |
|
|
|
res.push_back(s); |
|
|
|
res.push_back(s); |
|
|
|