Added mechanisms handling.

This commit is contained in:
Alessio Di Mauro
2015-07-16 17:52:54 +02:00
parent 5a39b5f582
commit b71cb628ea
6 changed files with 97 additions and 14 deletions
+4 -1
View File
@@ -34,7 +34,10 @@ CK_BBOOL parse_readers(const CK_BYTE_PTR readers, const CK_ULONG len,
// Unknown slot, just save what info we have
memset(&slots[*n_slots].info, 0, sizeof(CK_SLOT_INFO));
memset(slots[*n_slots].info.slotDescription, ' ', sizeof(slots[*n_slots].info.slotDescription));
strncpy(slots[*n_slots].info.slotDescription, p, strlen(p));
if (strlen(p) <= sizeof(slots[*n_slots].info.slotDescription))
strncpy(slots[*n_slots].info.slotDescription, p, strlen(p));
else
strncpy(slots[*n_slots].info.slotDescription, p, sizeof(slots[*n_slots].info.slotDescription));
}
else {
vendor = get_vendor(slots[*n_slots].vid);