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: |
c18406ef3e899115de41a5f774437d01 |
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 4342 4343 4344 4345 4346 4347 | cackey_free_certs(pcsc_identities, num_certs, 1); *ids_found = num_ids; return(identities); } | < | 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 | cackey_free_certs(pcsc_identities, num_certs, 1); *ids_found = num_ids; return(identities); } *ids_found = 0; return(NULL); } static cackey_ret cackey_get_pin(char *pinbuf) { FILE *pinfd; char *fgets_ret; |
︙ | ︙ | |||
4743 4744 4745 4746 4747 4748 4749 | } } /* Determine list of readers */ pcsc_connect_ret = cackey_pcsc_connect(); /* XXX: CAN HANG HERE ! */ if (pcsc_connect_ret != CACKEY_PCSC_S_OK) { | | < < | 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 | } } /* Determine list of readers */ pcsc_connect_ret = cackey_pcsc_connect(); /* XXX: CAN HANG HERE ! */ if (pcsc_connect_ret != CACKEY_PCSC_S_OK) { CACKEY_DEBUG_PRINTF("Connection to PC/SC failed, assuming no hardware slots"); } else { pcsc_readers_len = 0; scard_listreaders_ret = SCardListReaders(*cackey_pcsc_handle, NULL, NULL, &pcsc_readers_len); if (scard_listreaders_ret == SCARD_F_COMM_ERROR) { CACKEY_DEBUG_PRINTF("Error. SCardListReaders() returned SCARD_F_COMM_ERROR, assuming Connection to PC/SC went away. Reconnecting."); |
︙ | ︙ | |||
4772 4773 4774 4775 4776 4777 4778 | scard_listreaders_ret = SCardListReaders(*cackey_pcsc_handle, NULL, pcsc_readers, &pcsc_readers_len); if (scard_listreaders_ret == SCARD_S_SUCCESS) { pcsc_readers_e = pcsc_readers + pcsc_readers_len; /* Start with Slot ID 1, to avoid a bug in GDM on RHEL */ /* Bug 594911: https://bugzilla.redhat.com/show_bug.cgi?id=594911 */ currslot = 1; | < | 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 | scard_listreaders_ret = SCardListReaders(*cackey_pcsc_handle, NULL, pcsc_readers, &pcsc_readers_len); if (scard_listreaders_ret == SCARD_S_SUCCESS) { pcsc_readers_e = pcsc_readers + pcsc_readers_len; /* Start with Slot ID 1, to avoid a bug in GDM on RHEL */ /* Bug 594911: https://bugzilla.redhat.com/show_bug.cgi?id=594911 */ currslot = 1; while (pcsc_readers < pcsc_readers_e) { /* Find next available slot */ for (; currslot < (sizeof(cackey_slots) / sizeof(cackey_slots[0])); currslot++) { if (!cackey_slots[currslot].active) { break; } } |
︙ | ︙ | |||
4860 4861 4862 4863 4864 4865 4866 | slot_count++; } } currslot++; pcsc_readers += curr_reader_len + 1; } | < < < < < < < < > > > > > > > > | 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 | slot_count++; } } currslot++; pcsc_readers += curr_reader_len + 1; } } else { CACKEY_DEBUG_PRINTF("Second call to SCardListReaders failed, return %s/%li", CACKEY_DEBUG_FUNC_SCARDERR_TO_STR(scard_listreaders_ret), (long) scard_listreaders_ret); } free(pcsc_readers_s); } else { CACKEY_DEBUG_PRINTF("First call to SCardListReaders failed, return %s/%li", CACKEY_DEBUG_FUNC_SCARDERR_TO_STR(scard_listreaders_ret), (long) scard_listreaders_ret); } } for (currslot = 0; currslot < (sizeof(cackey_slots) / sizeof(cackey_slots[0])); currslot++) { if (cackey_slots[currslot].active) { CACKEY_DEBUG_PRINTF("Found active slot %lu, reader = %s", (unsigned long) currslot, cackey_slots[currslot].pcsc_reader); slot_count++; } } mutex_retval = cackey_mutex_unlock(cackey_biglock); if (mutex_retval != 0) { CACKEY_DEBUG_PRINTF("Error. Unlocking failed."); return(CKR_GENERAL_ERROR); } |
︙ | ︙ |