scm spr332 pinpad entry failure under Windows7
Closed, ResolvedPublic

Description

running gpg --card-edit
CHECKPIN works
But PASSWD fails with "General Error" after the "enter PIN and new PIN" dialog
pops up, and pressing one key. Full log follows for both commands.

scdaemon[6140]: chan_00000118 <- CHECKPIN D2760001240102000005000028770000
2014-09-07 00:57:45 scdaemon[6140] DBG: check_pcsc_pinpad: command=20, r=0
2014-09-07 00:57:45 scdaemon[6140] DBG: prompting for pinpad entry '||Please
enter the PIN'
scdaemon[6140]: chan_00000118 -> INQUIRE POPUPPINPADPROMPT ||Please enter the PIN
scdaemon[6140]: chan_00000118 <- END
2014-09-07 00:57:45 scdaemon[6140] DBG: send secure: c=00 i=20 p1=00 p2=82
len=23 pinmax=15
2014-09-07 00:57:49 scdaemon[6140] DBG: response: sw=9000 datalen=2
2014-09-07 00:57:49 scdaemon[6140] DBG: dismiss pinpad entry prompt
scdaemon[6140]: chan_00000118 -> INQUIRE DISMISSPINPADPROMPT
scdaemon[6140]: chan_00000118 <- END
2014-09-07 00:57:49 scdaemon[6140] operation check_pin result: Success
scdaemon[6140]: chan_00000118 -> OK
scdaemon[6140]: chan_00000118 <- SERIALNO openpgp
scdaemon[6140]: chan_00000118 -> S SERIALNO D2760001240102000005000028770000 0
scdaemon[6140]: chan_00000118 -> OK
scdaemon[6140]: chan_00000118 <- LEARN --force
scdaemon[6140]: chan_00000118 -> S SERIALNO D2760001240102000005000028770000 0
scdaemon[6140]: chan_00000118 -> S APPTYPE OPENPGP
scdaemon[6140]: chan_00000118 -> S EXTCAP gc=1+ki=1+fc=1+pd=1+mcl3=2048+aac=1+sm=0
scdaemon[6140]: chan_00000118 -> S DISP-NAME Alberti<<Lionel
scdaemon[6140]: chan_00000118 -> S DISP-LANG de
scdaemon[6140]: chan_00000118 -> S DISP-SEX 9
2014-09-07 00:57:49 scdaemon[6140] DBG: send apdu: c=00 i=CA p1=00 p2=6E lc=-1
le=256 em=0
2014-09-07 00:57:49 scdaemon[6140] DBG: PCSC_data: 00 CA 00 6E 00
2014-09-07 00:57:49 scdaemon[6140] DBG: response: sw=9000 datalen=217
2014-09-07 00:57:49 scdaemon[6140] DBG: dump: 4F 10 D2 76 00 01 24 01 02
00 00 05 00 00 28 77 00 00 5F 52 0A 00 31 C5 73 C0 01 40 05 90 00 73 81 B7 C0 0A
7C 00 08 00 08 00 08 00 08 00 C1 06 01 08 00 00 20 00 C2 06 01 08 00 00 20 00 C3
06 01 08 00 00 20 00 C4 07 00 20 20 20 03 00 03 C5 3C 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C6 3C 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 CD 0C 00 00 00 00 00 00 00 00 00 00 00 00
2014-09-07 00:57:49 scdaemon[6140] DBG: send apdu: c=00 i=CA p1=00 p2=C4 lc=-1
le=256 em=0
2014-09-07 00:57:49 scdaemon[6140] DBG: PCSC_data: 00 CA 00 C4 00
2014-09-07 00:57:49 scdaemon[6140] DBG: response: sw=9000 datalen=7
2014-09-07 00:57:49 scdaemon[6140] DBG: dump: 00 20 20 20 03 00 03
scdaemon[6140]: chan_00000118 -> S CHV-STATUS +0+32+32+32+3+0+3
2014-09-07 00:57:49 scdaemon[6140] DBG: send apdu: c=00 i=CA p1=00 p2=7A lc=-1
le=256 em=0
2014-09-07 00:57:49 scdaemon[6140] DBG: PCSC_data: 00 CA 00 7A 00
2014-09-07 00:57:49 scdaemon[6140] DBG: response: sw=9000 datalen=5
2014-09-07 00:57:49 scdaemon[6140] DBG: dump: 93 03 00 00 00
scdaemon[6140]: chan_00000118 -> S SIG-COUNTER 0
scdaemon[6140]: chan_00000118 -> OK
scdaemon[6140]: chan_00000118 <- GETATTR KEY-ATTR
scdaemon[6140]: chan_00000118 -> S KEY-ATTR 1 1 2048 32 1
scdaemon[6140]: chan_00000118 -> S KEY-ATTR 2 1 2048 32 1
scdaemon[6140]: chan_00000118 -> S KEY-ATTR 3 1 2048 32 1
scdaemon[6140]: chan_00000118 -> OK
scdaemon[6140]: chan_00000118 <- SERIALNO openpgp
scdaemon[6140]: chan_00000118 -> S SERIALNO D2760001240102000005000028770000 0
scdaemon[6140]: chan_00000118 -> OK
scdaemon[6140]: chan_00000118 <- LEARN --force
scdaemon[6140]: chan_00000118 -> S SERIALNO D2760001240102000005000028770000 0
scdaemon[6140]: chan_00000118 -> S APPTYPE OPENPGP
scdaemon[6140]: chan_00000118 -> S EXTCAP gc=1+ki=1+fc=1+pd=1+mcl3=2048+aac=1+sm=0
scdaemon[6140]: chan_00000118 -> S DISP-NAME Alberti<<Lionel
scdaemon[6140]: chan_00000118 -> S DISP-LANG de
scdaemon[6140]: chan_00000118 -> S DISP-SEX 9
2014-09-07 00:57:53 scdaemon[6140] DBG: send apdu: c=00 i=CA p1=00 p2=C4 lc=-1
le=256 em=0
2014-09-07 00:57:53 scdaemon[6140] DBG: PCSC_data: 00 CA 00 C4 00
2014-09-07 00:57:53 scdaemon[6140] DBG: response: sw=9000 datalen=7
2014-09-07 00:57:53 scdaemon[6140] DBG: dump: 00 20 20 20 03 00 03
scdaemon[6140]: chan_00000118 -> S CHV-STATUS +0+32+32+32+3+0+3
2014-09-07 00:57:53 scdaemon[6140] DBG: send apdu: c=00 i=CA p1=00 p2=7A lc=-1
le=256 em=0
2014-09-07 00:57:53 scdaemon[6140] DBG: PCSC_data: 00 CA 00 7A 00
2014-09-07 00:57:53 scdaemon[6140] DBG: response: sw=9000 datalen=5
2014-09-07 00:57:53 scdaemon[6140] DBG: dump: 93 03 00 00 00
scdaemon[6140]: chan_00000118 -> S SIG-COUNTER 0
scdaemon[6140]: chan_00000118 -> OK
scdaemon[6140]: chan_00000118 <- GETATTR KEY-ATTR
scdaemon[6140]: chan_00000118 -> S KEY-ATTR 1 1 2048 32 1
scdaemon[6140]: chan_00000118 -> S KEY-ATTR 2 1 2048 32 1
scdaemon[6140]: chan_00000118 -> S KEY-ATTR 3 1 2048 32 1
scdaemon[6140]: chan_00000118 -> OK
scdaemon[6140]: chan_00000118 <- PASSWD 1
2014-09-07 00:57:53 scdaemon[6140] DBG: check_pcsc_pinpad: command=24, r=0
2014-09-07 00:57:53 scdaemon[6140] DBG: prompting for pinpad entry '||Please
enter the PIN and New PIN'
scdaemon[6140]: chan_00000118 -> INQUIRE POPUPPINPADPROMPT ||Please enter the
PIN and New PIN
scdaemon[6140]: chan_00000118 <- END
2014-09-07 00:57:53 scdaemon[6140] DBG: send secure: c=00 i=24 p1=00 p2=81
len=28 pinmax=15
2014-09-07 00:57:58 scdaemon[6140] pcsc_control failed: invalid PC/SC error code
(0x79)
2014-09-07 00:57:58 scdaemon[6140] control_pcsc failed: 65547
2014-09-07 00:57:58 scdaemon[6140] DBG: dismiss pinpad entry prompt
scdaemon[6140]: chan_00000118 -> INQUIRE DISMISSPINPADPROMPT
scdaemon[6140]: chan_00000118 <- END
2014-09-07 00:57:58 scdaemon[6140] operation change_pin result: General error
2014-09-07 00:57:58 scdaemon[6140] command passwd failed: General error
scdaemon[6140]: chan_00000118 -> ERR 100663297 General error <SCD>

Details

Version
2.0.26

Related Objects

lalberti set Version to 2.0.26.Sep 7 2014, 7:28 AM
lalberti added a project: Bug Report.
lalberti added a subscriber: lalberti.

Retrying the passwd command several times inside "gpg --card-edit" consistently
fails no matter what I do before.
However, using "gpg --change-pin" only fails at most once in a row: the first
time it fails with general after the first key press, then retrying to change
the password succeeds, and subsequent changes succeed immediately and consistently.
But, if I cancel a pin entry, then I have a single failure, then it works (with
--change-pin).
Maybe some kind of buffer isn't flushed somewhere, and the first tries clears
it, but passwd in --card-edit doesn't...

lalberti renamed this task from scm spr332 pinpad entry failure to scm spr332 pinpad entry failure under Windows7.Sep 8 2014, 4:57 AM
gniibe claimed this task.Apr 3 2015, 6:07 AM
gniibe added a project: gpg4win.
gniibe added a subscriber: gniibe.

The error value is 0x79, which means ERROR_SEM_TIMEOUT on Windows.
It seems for me that there was another application which tried to access the
smartcard and the reader, which interfered.
Did you use solely GnuPG?

Or, SCardControl default timeout is too short. GnuPG doesn't specify the
timeout, but uses 0x00 for bTimeOut, which means using default.
I don't know how we can change default timeout on Windows.

gniibe closed this task as Resolved.Jun 4 2019, 2:27 AM