Overview
Comment: | Started working on improving slot reset mechanism |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | improve-session-and-slot-reset |
Files: | files | file ages | folders |
SHA1: |
32d54df268595cb500796eff56f2fa04 |
User & Date: | rkeene on 2016-02-26 18:28:32 |
Other Links: | branch diff | manifest | tags |
Context
2016-02-26
| ||
18:28 | Started working on improving slot reset mechanism Leaf check-in: 32d54df268 user: rkeene tags: improve-session-and-slot-reset | |
18:25 | Create new branch named "improve-session-and-slot-reset" check-in: 356ac541c7 user: rkeene tags: improve-session-and-slot-reset | |
Changes
Modified cackey.c from [6db8eb96eb] to [96360137ab].
︙ | ︙ | |||
4822 4823 4824 4825 4826 4827 4828 | int pcsc_connect_ret; CK_ULONG count, slot_count = 0, currslot, slot_idx; char *pcsc_readers, *pcsc_readers_s, *pcsc_readers_e; char *reader_check_pattern; DWORD pcsc_readers_len; LONG scard_listreaders_ret; size_t curr_reader_len; | < | 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 | int pcsc_connect_ret; CK_ULONG count, slot_count = 0, currslot, slot_idx; char *pcsc_readers, *pcsc_readers_s, *pcsc_readers_e; char *reader_check_pattern; DWORD pcsc_readers_len; LONG scard_listreaders_ret; size_t curr_reader_len; int include_reader; CACKEY_DEBUG_PRINTF("Called."); if (pulCount == NULL) { CACKEY_DEBUG_PRINTF("Error. pulCount is NULL."); |
︙ | ︙ | |||
4847 4848 4849 4850 4851 4852 4853 | if (mutex_retval != 0) { CACKEY_DEBUG_PRINTF("Error. Locking failed."); return(CKR_GENERAL_ERROR); } /* Clear list of slots */ | < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | | | < | 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 | if (mutex_retval != 0) { CACKEY_DEBUG_PRINTF("Error. Locking failed."); return(CKR_GENERAL_ERROR); } /* Clear list of slots */ if (pSlotList) { CACKEY_DEBUG_PRINTF("Purging all slot information."); /* Only update the list of slots if we are actually being supply the slot information */ cackey_slots_disconnect_all(1); for (currslot = 0; currslot < (sizeof(cackey_slots) / sizeof(cackey_slots[0])); currslot++) { if (cackey_slots[currslot].internal) { continue; } cackey_slots[currslot].active = 0; } } /* Determine list of readers */ pcsc_connect_ret = cackey_pcsc_connect(); if (pcsc_connect_ret != CACKEY_PCSC_S_OK) { CACKEY_DEBUG_PRINTF("Connection to PC/SC failed, assuming no hardware slots"); |
︙ | ︙ | |||
4984 4985 4986 4987 4988 4989 4990 | pcsc_readers += curr_reader_len + 1; continue; } /* Only update the list of slots if we are actually being asked supply the slot information */ if (pSlotList) { | < | | | | | | | | | | | | | < | 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 | pcsc_readers += curr_reader_len + 1; continue; } /* Only update the list of slots if we are actually being asked supply the slot information */ if (pSlotList) { cackey_slots[currslot].active = 1; cackey_slots[currslot].internal = 0; cackey_slots[currslot].pcsc_reader = strdup(pcsc_readers); cackey_slots[currslot].pcsc_card_connected = 0; cackey_slots[currslot].transaction_depth = 0; cackey_slots[currslot].transaction_need_hw_lock = 0; if (cackey_pin_command == NULL) { cackey_slots[currslot].token_flags = CKF_LOGIN_REQUIRED; } else { cackey_slots[currslot].token_flags = 0; } cackey_slots[currslot].label = NULL; cackey_mark_slot_reset(&cackey_slots[currslot]); } else { if (!cackey_slots[currslot].active) { /* Artificially increase the number of active slots by what will become active */ CACKEY_DEBUG_PRINTF("Found in-active slot %lu, but it will be active after a reset -- marking as active for accounting purposes", (unsigned long) currslot); slot_count++; } |
︙ | ︙ |