Skip to contentSkip to conversation

Cannot login into emulated smartcard with OpenSC because it expects external PIN pad.

PATCH Andrei Borzenkov 2 participants 2 messages Sep 21, 2019

lore
Share & tools
lore
#0 lore raw

USB card reader emulated by QEMU announces presence of PIN pad. OpenSC will not request PIN from user in this case and assumes PIN is being entered off-band on external device. Unfortunately QEMU does not seem to offer PIN entry and access to card always fails.

Changing device to not announce non-existing capability fixes it and allows to use OpenSC framework with emulated card.

hw/usb/dev-smartcard-reader.c +0 -0
@@ -398,7 +398,7 @@ static const uint8_t qemu_ccid_descriptor[] = {
                      * u16 wLcdLayout; XXYY Number of lines (XX) and

chars per
* line for LCD display used for PIN entry. 0000 -
no LCD

                      */
-        0x01,       /*
+        0x00,       /*

* u8 bPINSupport; 01h PIN Verification,
* 02h PIN Modification
*/

#1 lore raw
Quoted 16 lines · Andrei Borzenkov

USB card reader emulated by QEMU announces presence of PIN pad. OpenSC will not request PIN from user in this case and assumes PIN is being entered off-band on external device. Unfortunately QEMU does not seem to offer PIN entry and access to card always fails.

Changing device to not announce non-existing capability fixes it and allows to use OpenSC framework with emulated card.

hw/usb/dev-smartcard-reader.c +0 -0
@@ -398,7 +398,7 @@ static const uint8_t qemu_ccid_descriptor[] = {
                      * u16 wLcdLayout; XXYY Number of lines (XX) and

chars per
* line for LCD display used for PIN entry. 0000 -
no LCD

                      */

hw/usb/dev-smartcard-reader.c

Quoted 5 lines
hw/usb/dev-smartcard-reader.c +1 -1
-        0x01,       /*
+        0x00,       /*
                      * u8  bPINSupport; 01h PIN Verification,
                      *                  02h PIN Modification
                      */

Hi,

when sending patches, please make sure to include a "Signed-off-by:" line at the end of the patch description. For details see:

https://wiki.qemu.org/Contribute/SubmitAPatch

Thanks,
Thomas