|
|
@ -200,7 +200,7 @@ namespace cryptoki { |
|
|
|
} |
|
|
|
} |
|
|
|
@endcode */ |
|
|
|
@endcode */ |
|
|
|
|
|
|
|
|
|
|
|
SlotList Init::slotList(bool tokenPresent) { |
|
|
|
SlotList Init::slotList(bool tokenPresent, std::string name) { |
|
|
|
CRYPTOKI_LOG("log"); |
|
|
|
CRYPTOKI_LOG("log"); |
|
|
|
SlotList res; |
|
|
|
SlotList res; |
|
|
|
CK_ULONG count(0); |
|
|
|
CK_ULONG count(0); |
|
|
@ -217,7 +217,11 @@ namespace cryptoki { |
|
|
|
} while (_res==CKR_BUFFER_TOO_SMALL); |
|
|
|
} while (_res==CKR_BUFFER_TOO_SMALL); |
|
|
|
check(_res, CRYPTOKI_FN_LOG("C_GetSlotList")); |
|
|
|
check(_res, CRYPTOKI_FN_LOG("C_GetSlotList")); |
|
|
|
if (!*this) return res; |
|
|
|
if (!*this) return res; |
|
|
|
for (CK_ULONG i(0); i<count; ++i) res.push_back(Slot(*this, slots[i])); |
|
|
|
for (CK_ULONG i(0); i<count; ++i) { |
|
|
|
|
|
|
|
Slot s(*this, slots[i]); |
|
|
|
|
|
|
|
if (!name.size() || name==s.slotInfo().slotDescription) |
|
|
|
|
|
|
|
res.push_back(s); |
|
|
|
|
|
|
|
} |
|
|
|
} catch (...) { |
|
|
|
} catch (...) { |
|
|
|
delete[] slots; |
|
|
|
delete[] slots; |
|
|
|
throw; |
|
|
|
throw; |
|
|
|