-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VpcdReader.cpp stuck in loop when connecting several times #46
Comments
Currently I have no idea. I am very regularly using the Linx version of vpcd, which does not show this behavior. But this may be a bug in the Windows driver, I need to look closer at the problem. jCardSim itself has implemented a backed to the virtual driver, see https://jcardsim.org/blogs/work-jcardsim-through-pcsc-virtual-reader. The pipe-interface is also part of my driver, you simply need to change BixVReader.ini (see https://www.codeproject.com/Articles/134010/An-UMDF-Driver-for-a-Virtual-Smart-Card-Reader for details) and you can connect directly from jCardSim via pipe. The pipe-Interface may be better tested... |
The pipe interface is not working for me. The connection seems to be not closed correctly. I get the error "All pipes are busy", although I have closed the pipe from the Java side. I have to restart the driver the release the pipe again, which is worse compared to the socket behavior. Do you know any API method on the windows side which let me tell the UMDF driver "Hey, the card is present again." which can be called from the driver itself when no IWDFIoRequest is pending? |
Sorry, I can't reproduce the problem on my machine. I tried the following:
I also tried to disconnect the card while the tests were running, which threw an error that the card was removed. This all works as expected. Without more evidence I suppose that the problem is in your client-side implementation. Also, you indicated that vicc_present only succeeds every second time, this should not happen. The same way of exchanging data is used for transmitting the APDUs. I think you should fix this issue and you will also solve the APDU problem. |
I'm using this project to write unit tests for Java Card applet running inside jCardSim. So I have implemented a Vpicc connector to the Vpcd driver. The problem is occurring when running multiple tests and closing and reconnecting to the driver for each test. The first test often succeeds, but for the other tests more often no card is present anymore when listing the terminal and trying to connect. This behavior is not deterministic, I assume a timing condition or some inconsistent state in the driver.
I have debugged the driver and see the following behavior:
VpcdReader.cpp
server is running andvicc_present
invpcd.c
detects a card and my Vpicc connector is passing an ATR correctly.cardPresent
totrue
and thewaitInsertIpr
is triggered.VpcdReader.cpp
server is still running and executesvicc_present
invpcd.c
detects a card and my Vpicc connector is passing an ATR correctly` every second.cardPresent
is already set totrue
,waitInsertIpr
isNULL
.My assumption:
Reader::IoSmartCardIsPresent
which was called in the beginning, is never called again, so I assume anySCardListReaders
never sees a card inserted again, so the connections can never be established again.Do you have any idea what is going wrong?
The text was updated successfully, but these errors were encountered: