From: Nikos M. <n.m...@gm...> - 2013-02-18 20:12:02
|
On 02/18/2013 08:16 PM, Douglas E. Engert wrote: > I understand that card_detect may not be needed by C_Initialize, > and postponing the calling of card_detect till actually needed > would help in your situation. > But your patch does not appear to do that, it just removes > two calls to card_detect, and removes the call to sc_detect_card_presence. The call to sc_detect_card_presence seem superfluous since it is repeated in card_detect(). > We need to make sure there are no code paths that avoid calling > the card_detect or rely on the results of one of the removed > card_detect calls. Either could result in not recogniing > a card is present, or some segfault if card_detect set some > values that other code is depending on. So in that case that should be called on every function except C_Initialize, C_GetSlotList, C_GetFunctionList, C_GetInfo, C_Finalize. However, several functions depend on a session being setup (so they would be fine if only C_OpenSession was detecting cards) that leaves us with: C_OpenSession, C_GetMechanismList, C_WaitForSlotEvent, C_GetTokenInfo, C_GetSlotInfo (I hope I'm not missing any here). Now: C_OpenSession, C_GetMechanismList, C_GetTokenInfo: call slot_get_token() which in turn calls card_detect(). C_WaitForSlotEvent calls card_detect_all explicitly. C_GetSlotInfo: calls slot_get_slot() which doesn't seem to detect anything. So would calling card_detect_all() in C_GetSlotInfo (see patch) fulfill your concerns? regards, Nikos |