Overview
Comment: | Added support for CKF_DONT_BLOCK |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | wait-for-slot-event |
Files: | files | file ages | folders |
SHA1: |
0058a3b41b4de5a7e3b7a2e3336b6791 |
User & Date: | rkeene on 2013-08-18 07:02:27 |
Other Links: | branch diff | manifest | tags |
Context
2013-08-19
| ||
03:14 | Improved waiting for slot event to allow C_Finalize to terminate any waiting Leaf check-in: d52881feec user: rkeene tags: wait-for-slot-event | |
2013-08-18
| ||
07:02 | Added support for CKF_DONT_BLOCK check-in: 0058a3b41b user: rkeene tags: wait-for-slot-event | |
06:53 | First work towards implementing C_WaitForSlotEvent check-in: 4d4946cc1f user: rkeene tags: wait-for-slot-event | |
Changes
Modified cackey.c from [0817c7d1f8] to [5d076538a2].
︙ | |||
4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 | 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 | + | SCARD_READERSTATE reader_states[(sizeof(cackey_slots) / sizeof(cackey_slots[0])) + 1]; SCARDCONTEXT pcsc_handle; LONG scard_getstatchng_ret; LONG scard_est_context_ret; struct cackey_slot *cackey_slot; unsigned int currslot, reader_state_slot; int pcsc_connect_ret; int slot_changed; CACKEY_DEBUG_PRINTF("Called."); if (pReserved != NULL) { CACKEY_DEBUG_PRINTF("Error. pReserved is not NULL."); return(CKR_ARGUMENTS_BAD); |
︙ | |||
4761 4762 4763 4764 4765 4766 4767 | 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 | - - - - - - - - - - + + + + - - - + + + - - + + + + + + - - + + - - - - + + + + - - - + + + - - + + - + - + - - + + - - + + - - - - - - + + + + + + - - + - - - - + + + + + + + + + + + + + + + + + + + + - + - - + + - + - - - - - + + + + + + + + - - + | pcsc_connect_ret = cackey_pcsc_connect(); if (pcsc_connect_ret != CACKEY_PCSC_S_OK) { CACKEY_DEBUG_PRINTF("Connection to PC/SC failed, returning in failure"); return(CKR_GENERAL_ERROR); } |
︙ |
Modified test.c from [1ccfa3a69d] to [ef0e023dd5].
︙ | |||
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | + + + + + + + + + | slots = malloc(sizeof(*slots) * numSlots); chk_rv = C_GetSlotList(FALSE, slots, &numSlots); if (chk_rv != CKR_OK) { return(1); } /* Test waiting for slot events */ currSlot = 0; printf("Please insert a card now.\n"); /* Initially, every slot has changed state (but probably should not) */ chk_rv = C_WaitForSlotEvent(0, &currSlot, NULL); /* This actually waits */ chk_rv = C_WaitForSlotEvent(0, &currSlot, NULL); if (chk_rv != CKR_OK) { printf("Failed to wait for slot event.\n"); } /* This just ensures DONT_BLOCK works */ chk_rv = C_WaitForSlotEvent(CKF_DONT_BLOCK, &currSlot, NULL); for (currSlot = 0; currSlot < numSlots; currSlot++) { printf(" Slot %lu:\n", currSlot); chk_rv = C_GetSlotInfo(slots[currSlot], &slotInfo); if (chk_rv != CKR_OK) { return(1); } |
︙ |