frankmorgner/vsmartcard

Windows: How to disable initial commands when card connect?

Closed this issue · 3 comments

Expected behaviour

Only reset command was sent to card.

Actual behaviour

A series of commands was sent to the virtual card. I searched project vpcd but can't found where did these commands came from.

Steps to reproduce

  1. start vpcd
  2. create a virtual card with VirtualICC(None, "iso7816", "localhost", 35963)
  3. run the virtual card

Logs

14.11.2022 10:48:20  [INFO] Command APDU (16 bytes):
  0000:  00 A4 04 00 0B A0 00 00 03 97 43 49 44 5F 01 00   ................
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (5 bytes):
  0000:  00 CA 7F 68 00                                    .....
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 81                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (14 bytes):
  0000:  00 A4 04 00 09 A0 00 00 03 08 00 00 10 00         ..............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (14 bytes):
  0000:  00 A4 04 00 09 A0 00 00 03 97 42 54 46 59         ..............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (14 bytes):
  0000:  00 A4 04 00 09 A0 00 00 03 08 00 00 10 00         ..............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (7 bytes):
  0000:  00 A4 00 0C 02 3F FF                              .......
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (15 bytes):
  0000:  00 A4 04 04 09 A0 00 00 03 97 42 54 46 59 00      ...............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (15 bytes):
  0000:  00 A4 04 00 09 A0 00 00 03 97 42 54 46 59 00      ...............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (14 bytes):
  0000:  00 A4 04 00 09 A0 00 00 03 08 00 00 10 00         ..............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (7 bytes):
  0000:  00 A4 00 0C 02 3F FF                              .......
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (15 bytes):
  0000:  00 A4 04 04 09 A0 00 00 03 97 42 54 46 59 00      ...............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (15 bytes):
  0000:  00 A4 04 00 09 A0 00 00 03 97 42 54 46 59 00      ...............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (14 bytes):
  0000:  00 A4 04 00 09 A0 00 00 03 08 00 00 10 00         ..............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (7 bytes):
  0000:  00 A4 00 0C 02 3F FF                              .......
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (15 bytes):
  0000:  00 A4 04 04 09 A0 00 00 03 97 42 54 46 59 00      ...............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82                                             ..
14.11.2022 10:48:20  [INFO] Command APDU (15 bytes):
  0000:  00 A4 04 00 09 A0 00 00 03 97 42 54 46 59 00      ...............
14.11.2022 10:48:20  [INFO] Response APDU (2 bytes):
  0000:  6A 82

And reset was sent there times:

14.11.2022 10:48:20  [INFO] Reset
14.11.2022 10:48:20  [INFO] Reset
14.11.2022 10:48:20  [INFO] Reset

@frankmorgner Thank you for your response, I set HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScPnP\EnableScPnP to 0 and rebooted, the commands received was less than before. If this is a system thing I guess will just leave that be.