frankmorgner / vsmartcard

umbrella project for emulation of smart card readers or smart cards
http://frankmorgner.github.io/vsmartcard/
693 stars 198 forks source link

pcsc_scan not finding reader #231

Closed yannick-couzinie closed 1 year ago

yannick-couzinie commented 1 year ago

I am pretty sure that this is less of a bug, and more of me just not understanding how to use this software. I am on arch linux, I self compiled the latest version from github and am using this release https://github.com/frankmorgner/vsmartcard/releases/download/remote-reader-2.3/remote-reader-debug-2.3.apk from the app, as with the f-droid version I was getting the cold reset problem described here https://github.com/frankmorgner/vsmartcard/issues/201.

Expected behaviour

pcsc_scan should find a reader, after connecting the computer (vicc -vvvv --reversed) to the android phone (smart card reader/vpcd) as per bottom part of website that says that these programs should give some output.

Actual behaviour

pcsc_scan and opensc-explorer do not show any connected readers.

Steps to reproduce

  1. On computer use vicc -vvvv -reversed
  2. On phone tap the yellow button
  3. Connection is shown as successfull but pcsc_scan does not show anything.

Logs

vicc -vvvv --reversed

07.09.2022 16:44:30  [WARNING] Using default SAM parameters. PIN=b'1234', Card Nr=b'1234567890'
VICC hostname:  xxx
VICC port:      35963
On your NFC phone with the Android Smart Card Emulator app scan this code:
https://api.qrserver.com/v1/create-qr-code/?data=vicc://xxx:35963
07.09.2022 16:44:30  [INFO] Waiting for vpcd on port 35963
07.09.2022 16:44:33  [INFO] Connected to virtual PCD at  xxx:35963

app

Connecting to xxx:35963
Connected to VPCD
Discovered ISO/IEC xxx
Timeout set to 500

pcsc_scan

Using reader plug'n play mechanism
Scanning present readers...
Waiting for the first reader...
frankmorgner commented 1 year ago

The ports between vicc and remote-reader are correctly connected. However, they both try to speak the same protocol and don't understand each other. vicc waits for commands and calculates responses based on the python implementation of, e.g. an MRTD. remote-reader waits for commands and sends them to the phone's NFC hardware and receives the responses from the nearby contactless smartcard. (It's also possible to operate remote-reader as relay to vicc, but since it's not the default setup, I don't think you have it running this way.)

So first, please clearify how you want to roll... What do you want to access through which interface? If you want to access vicc through PC/SC (e.g. via pcsc_scan), you only need to install virtualsmartcard and restart pcscd, that's it.

frankmorgner commented 1 year ago

Closing this issue due to inactivity. Please re-open the ticket if more input is available.