LedgerHQ / app-openpgp

OpenPGP Card Application
Apache License 2.0
123 stars 21 forks source link

GPG - doesn't recognize smart card even though pcsc_scan does #72

Closed MagicRB closed 2 years ago

MagicRB commented 2 years ago

/tmp/scd.log

2022-01-03 22:30:31 scdaemon[18990] DBG: chan_7 <- GETINFO version
2022-01-03 22:30:31 scdaemon[18990] DBG: chan_7 -> D 2.2.27
2022-01-03 22:30:31 scdaemon[18990] DBG: chan_7 -> OK
2022-01-03 22:30:31 scdaemon[18990] DBG: chan_7 <- SERIALNO
2022-01-03 22:30:31 scdaemon[18990] DBG: apdu_open_reader: BAI=11b01
2022-01-03 22:30:31 scdaemon[18990] DBG: apdu_open_reader: new device=11b01
2022-01-03 22:30:31 scdaemon[18990] ccid open error: skip
2022-01-03 22:30:31 scdaemon[18990] DBG: enter: apdu_open_reader: portstr=Ledger Nano X [Nano X] (0001) 00 00
2022-01-03 22:30:31 scdaemon[18990] detected reader 'Ledger Nano X [Nano X] (0001) 00 00'
2022-01-03 22:30:31 scdaemon[18990] reader slot 0: not connected
2022-01-03 22:30:31 scdaemon[18990] DBG: leave: apdu_open_reader => slot=0 [pc/sc]
2022-01-03 22:30:31 scdaemon[18990] DBG: enter: apdu_connect: slot=0
2022-01-03 22:30:31 scdaemon[18990] DBG: feature: code=06, len=4, v=42330006
2022-01-03 22:30:31 scdaemon[18990] DBG: feature: code=07, len=4, v=42330007
2022-01-03 22:30:31 scdaemon[18990] DBG: feature: code=0A, len=4, v=4233000A
2022-01-03 22:30:31 scdaemon[18990] DBG: feature: code=12, len=4, v=42330012
2022-01-03 22:30:31 scdaemon[18990] DBG: TLV properties: tag=01, len=2, v=00000000
2022-01-03 22:30:31 scdaemon[18990] DBG: TLV properties: tag=03, len=1, v=00000000
2022-01-03 22:30:31 scdaemon[18990] DBG: TLV properties: tag=09, len=1, v=00000000
2022-01-03 22:30:31 scdaemon[18990] DBG: TLV properties: tag=0B, len=2, v=00002C97
2022-01-03 22:30:31 scdaemon[18990] DBG: TLV properties: tag=0C, len=2, v=00000004
2022-01-03 22:30:31 scdaemon[18990] DBG: TLV properties: tag=0A, len=4, v=00000000
2022-01-03 22:30:31 scdaemon[18990] reader slot 0: active protocol: T0
2022-01-03 22:30:31 scdaemon[18990] slot 0: ATR=3B 00
2022-01-03 22:30:31 scdaemon[18990] DBG: pcsc_get_status_change:  changed present excl
2022-01-03 22:30:31 scdaemon[18990] DBG: leave: apdu_connect => sw=0x0
2022-01-03 22:30:31 scdaemon[18990] DBG: send apdu: c=00 i=A4 p1=00 p2=0C lc=2 le=-1 em=0
2022-01-03 22:30:31 scdaemon[18990] DBG:   PCSC_data: 00 A4 00 0C 02 3F 00
2022-01-03 22:30:31 scdaemon[18990] DBG:  response: sw=9000  datalen=0
2022-01-03 22:30:31 scdaemon[18990] DBG:     dump:  
2022-01-03 22:30:31 scdaemon[18990] DBG: send apdu: c=00 i=A4 p1=02 p2=0C lc=2 le=-1 em=0
2022-01-03 22:30:31 scdaemon[18990] DBG:   PCSC_data: 00 A4 02 0C 02 2F 02
2022-01-03 22:30:33 scdaemon[18990] DBG:  response: sw=6F42  datalen=4
2022-01-03 22:30:33 scdaemon[18990] DBG: send apdu: c=00 i=A4 p1=04 p2=00 lc=6 le=-1 em=0
2022-01-03 22:30:33 scdaemon[18990] DBG:   PCSC_data: 00 A4 04 00 06 D2 76 00 01 24 01
2022-01-03 22:30:35 scdaemon[18990] DBG:  response: sw=6F42  datalen=4
2022-01-03 22:30:35 scdaemon[18990] DBG: send apdu: c=00 i=A4 p1=04 p2=0C lc=7 le=-1 em=0
2022-01-03 22:30:35 scdaemon[18990] DBG:   PCSC_data: 00 A4 04 0C 07 D2 76 00 00 03 01 02
2022-01-03 22:30:37 scdaemon[18990] DBG:  response: sw=6F42  datalen=4
2022-01-03 22:30:37 scdaemon[18990] DBG: send apdu: c=00 i=A4 p1=04 p2=0C lc=12 le=-1 em=0
2022-01-03 22:30:37 scdaemon[18990] DBG:   PCSC_data: 00 A4 04 0C 0C A0 00 00 00 63 50 4B 43 53 2D 31 35
2022-01-03 22:30:39 scdaemon[18990] DBG:  response: sw=6F42  datalen=4
2022-01-03 22:30:39 scdaemon[18990] DBG: send apdu: c=00 i=A4 p1=08 p2=0C lc=2 le=-1 em=0
2022-01-03 22:30:39 scdaemon[18990] DBG:   PCSC_data: 00 A4 08 0C 02 2F 00
2022-01-03 22:30:41 scdaemon[18990] DBG:  response: sw=6F42  datalen=4
2022-01-03 22:30:41 scdaemon[18990] DBG: send apdu: c=00 i=A4 p1=01 p2=0C lc=2 le=-1 em=0
2022-01-03 22:30:41 scdaemon[18990] DBG:   PCSC_data: 00 A4 01 0C 02 50 15
2022-01-03 22:30:44 scdaemon[18990] DBG:  response: sw=6F42  datalen=4
2022-01-03 22:30:44 scdaemon[18990] DBG: send apdu: c=00 i=A4 p1=04 p2=0C lc=9 le=-1 em=0
2022-01-03 22:30:44 scdaemon[18990] DBG:   PCSC_data: 00 A4 04 0C 09 D2 76 00 00 25 45 50 02 00
2022-01-03 22:30:46 scdaemon[18990] DBG:  response: sw=6F42  datalen=4
2022-01-03 22:30:46 scdaemon[18990] DBG: send apdu: c=00 i=A4 p1=04 p2=0C lc=6 le=-1 em=0
2022-01-03 22:30:46 scdaemon[18990] DBG:   PCSC_data: 00 A4 04 0C 06 D2 76 00 00 66 01
2022-01-03 22:30:48 scdaemon[18990] DBG:  response: sw=6F42  datalen=4
2022-01-03 22:30:48 scdaemon[18990] DBG: send apdu: c=00 i=A4 p1=04 p2=0C lc=11 le=-1 em=0
2022-01-03 22:30:48 scdaemon[18990] DBG:   PCSC_data: 00 A4 04 0C 0B E8 2B 06 01 04 01 81 C3 1F 02 01
2022-01-03 22:30:50 scdaemon[18990] DBG:  response: sw=6F42  datalen=4
2022-01-03 22:30:50 scdaemon[18990] no supported card application found: Card error
2022-01-03 22:30:50 scdaemon[18990] DBG: enter: apdu_close_reader: slot=0
2022-01-03 22:30:50 scdaemon[18990] DBG: enter: apdu_disconnect: slot=0
2022-01-03 22:30:50 scdaemon[18990] DBG: leave: apdu_disconnect => sw=0x0
2022-01-03 22:30:50 scdaemon[18990] DBG: leave: apdu_close_reader => 0x0 (close_reader)
2022-01-03 22:30:50 scdaemon[18990] DBG: chan_7 -> ERR 100696144 No such device <SCD>
2022-01-03 22:30:50 scdaemon[18990] DBG: chan_7 <- RESTART
2022-01-03 22:30:50 scdaemon[18990] DBG: chan_7 -> OK

scdaemon.conf

      allow-admin
      reader-port "Ledger Nano X [Nano X] (0001) 00 00"
      allow-pinpad-varlen
      log-file /tmp/scd.log
      debug-level guru
      debug-all

and gpg reports the usual

gpg: selecting card failed: No such device
gpg: OpenPGP card not available: No such device

any clue how I could debug this? I bought the Nano X hoping to be able to use it practically with my phone over bluetooth both for crypto but rn primarily for GPG. This is a deal breaker for me. Is a 120 purchase from some random guy enough for someone at Ledger to at least look at this? Please...

MagicRB commented 2 years ago

I'll try updating the ccid components as those seem to be just copied verbatim from a STM32 repository. We'll see if it helps, also maybe recompiling may help, no idea how old the binary on my Nano X is...

MagicRB commented 2 years ago

I no longer give a shit, I'm returning this shitshow and never buying anything else from you. Heed my warning people, Ledger cares as much about their small devs as I care about how fast grass grows in Australia :)