Overview
Comment: | Started working on fixing an issue where if no hardware slots are present the internal slots would not show up |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: | c18406ef3e899115de41a5f774437d011f2da216 |
User & Date: | rkeene on 2016-02-11 18:31:22 |
Other Links: | manifest | tags |
Context
2016-02-11
| ||
18:32 | ChromeOS: Remove USB requirement -- we talk to the Smartcard Manager App for this check-in: 35a258e3b8 user: rkeene tags: trunk | |
18:31 | Started working on fixing an issue where if no hardware slots are present the internal slots would not show up check-in: c18406ef3e user: rkeene tags: trunk | |
16:07 | ChromeOS: Check to ensure we are running under ChromeOS before initializing, print an error to our console if not check-in: 5af7507345 user: rkeene tags: trunk | |
Changes
Modified cackey.c from [7fc12e8cff] to [0be1a03436].
4341 4341 cackey_free_certs(pcsc_identities, num_certs, 1); 4342 4342 4343 4343 *ids_found = num_ids; 4344 4344 4345 4345 return(identities); 4346 4346 } 4347 4347 4348 - 4349 4348 *ids_found = 0; 4350 4349 return(NULL); 4351 4350 } 4352 4351 4353 4352 static cackey_ret cackey_get_pin(char *pinbuf) { 4354 4353 FILE *pinfd; 4355 4354 char *fgets_ret; ................................................................................ 4743 4742 } 4744 4743 } 4745 4744 4746 4745 /* Determine list of readers */ 4747 4746 pcsc_connect_ret = cackey_pcsc_connect(); 4748 4747 /* XXX: CAN HANG HERE ! */ 4749 4748 if (pcsc_connect_ret != CACKEY_PCSC_S_OK) { 4750 - CACKEY_DEBUG_PRINTF("Connection to PC/SC failed, assuming no slots"); 4751 - 4752 - slot_count = 0; 4749 + CACKEY_DEBUG_PRINTF("Connection to PC/SC failed, assuming no hardware slots"); 4753 4750 } else { 4754 4751 pcsc_readers_len = 0; 4755 4752 4756 4753 scard_listreaders_ret = SCardListReaders(*cackey_pcsc_handle, NULL, NULL, &pcsc_readers_len); 4757 4754 4758 4755 if (scard_listreaders_ret == SCARD_F_COMM_ERROR) { 4759 4756 CACKEY_DEBUG_PRINTF("Error. SCardListReaders() returned SCARD_F_COMM_ERROR, assuming Connection to PC/SC went away. Reconnecting."); ................................................................................ 4772 4769 scard_listreaders_ret = SCardListReaders(*cackey_pcsc_handle, NULL, pcsc_readers, &pcsc_readers_len); 4773 4770 if (scard_listreaders_ret == SCARD_S_SUCCESS) { 4774 4771 pcsc_readers_e = pcsc_readers + pcsc_readers_len; 4775 4772 4776 4773 /* Start with Slot ID 1, to avoid a bug in GDM on RHEL */ 4777 4774 /* Bug 594911: https://bugzilla.redhat.com/show_bug.cgi?id=594911 */ 4778 4775 currslot = 1; 4779 - slot_count = 0; 4780 4776 while (pcsc_readers < pcsc_readers_e) { 4781 4777 /* Find next available slot */ 4782 4778 for (; currslot < (sizeof(cackey_slots) / sizeof(cackey_slots[0])); currslot++) { 4783 4779 if (!cackey_slots[currslot].active) { 4784 4780 break; 4785 4781 } 4786 4782 } ................................................................................ 4860 4856 slot_count++; 4861 4857 } 4862 4858 } 4863 4859 currslot++; 4864 4860 4865 4861 pcsc_readers += curr_reader_len + 1; 4866 4862 } 4867 - 4868 - for (currslot = 0; currslot < (sizeof(cackey_slots) / sizeof(cackey_slots[0])); currslot++) { 4869 - if (cackey_slots[currslot].active) { 4870 - CACKEY_DEBUG_PRINTF("Found active slot %lu, reader = %s", (unsigned long) currslot, cackey_slots[currslot].pcsc_reader); 4871 - 4872 - slot_count++; 4873 - } 4874 - } 4875 4863 } else { 4876 4864 CACKEY_DEBUG_PRINTF("Second call to SCardListReaders failed, return %s/%li", CACKEY_DEBUG_FUNC_SCARDERR_TO_STR(scard_listreaders_ret), (long) scard_listreaders_ret); 4877 4865 } 4878 4866 4879 4867 free(pcsc_readers_s); 4880 4868 } else { 4881 4869 CACKEY_DEBUG_PRINTF("First call to SCardListReaders failed, return %s/%li", CACKEY_DEBUG_FUNC_SCARDERR_TO_STR(scard_listreaders_ret), (long) scard_listreaders_ret); 4882 4870 } 4883 4871 } 4872 + 4873 + for (currslot = 0; currslot < (sizeof(cackey_slots) / sizeof(cackey_slots[0])); currslot++) { 4874 + if (cackey_slots[currslot].active) { 4875 + CACKEY_DEBUG_PRINTF("Found active slot %lu, reader = %s", (unsigned long) currslot, cackey_slots[currslot].pcsc_reader); 4876 + 4877 + slot_count++; 4878 + } 4879 + } 4884 4880 4885 4881 mutex_retval = cackey_mutex_unlock(cackey_biglock); 4886 4882 if (mutex_retval != 0) { 4887 4883 CACKEY_DEBUG_PRINTF("Error. Unlocking failed."); 4888 4884 4889 4885 return(CKR_GENERAL_ERROR); 4890 4886 }