Page MenuHome GnuPG

scdaemon patch to support some situation with PCSC_SHARED (not all)
Needs RevisionPublic

Authored by gniibe on Jun 21 2021, 6:10 AM.

Details

Reviewers
Sanmilie
Test Plan

Test with pcsc_shared

Diff Detail

Repository
rG GnuPG
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

gniibe created this revision.
Sanmilie added a subscriber: Sanmilie.

OK I have finally success to test... the master version has a problem with opening pcsc readers on windows I revert back on older version to able to correct this problem. For the current patch without yubikey reference. I suggest validating the interference in the first task for the maybe_switch app function.

The patch on the patch for this is
removing the 1533-1534 1547-1548
add in 1501 this

/* This is for validation the external interference before to able to switch between app

if it is not possible to reselect the current app return bad card */
        if (check_external_interference (app, ctrl) != 0)
        {
            err = run_reselect( ctrl, card. card->app, card->app);
            if ( err )
                 return err;
         }

The result in the log
I have test the case 1 interference with gids and openpgp
Gids sign and Openpgp try to decrypt after.
Gids repport file not fount because the CA is not a get GIDS have CB for Get
2021-06-24 12:21:57 scdaemon[12304] DBG: send apdu: c=00 i=CA p1=00 p2=4F lc=-1 le=256 em=0
2021-06-24 12:21:57 scdaemon[12304] DBG: PCSC_data: 00 CA 00 4F 00
2021-06-24 12:21:57 scdaemon[12304] DBG: response: sw=6A82 datalen=0
Openpgp try to reselect openpgp app the last app in cache
2021-06-24 12:21:57 scdaemon[12304] DBG: send apdu: c=00 i=A4 p1=04 p2=00 lc=6 le=-1 em=0
2021-06-24 12:21:57 scdaemon[12304] DBG: PCSC_data: 00 A4 04 00 06 D2 76 00 01 24 01
2021-06-24 12:21:57 scdaemon[12304] DBG: response: sw=9000 datalen=16
2021-06-24 12:21:57 scdaemon[12304] DBG: dump: D2 76 00 01 24 01 03 04 53 43 00 00 00 01 00 00
2021-06-24 12:21:57 scdaemon[12304] DBG: slot 3, app openpgp: re-selected
Teh select is sucessfull and validate the realneed to switch - in my case not because i need openpgp app
2021-06-24 12:21:57 scdaemon[12304] DBG: slot 3 app openpgp: calling decipher(BBD342CA5B0F978DA17F2AD9F5A1E95FF50C129E)
2021-06-24 12:21:57 scdaemon[12304] DBG: send apdu: c=00 i=CA p1=00 p2=C4 lc=-1 le=256 em=0
2021-06-24 12:21:57 scdaemon[12304] DBG: PCSC_data: 00 CA 00 C4 00
2021-06-24 12:21:57 scdaemon[12304] DBG: response: sw=9000 datalen=7
2021-06-24 12:21:57 scdaemon[12304] DBG: dump: 00 7F 7F 7F 03 00 03
2021-06-24 12:21:57 scdaemon[12304] DBG: check_pcsc_pinpad: command=20, r=27265
2021-06-24 12:21:57 scdaemon[12304] DBG: asking for PIN '||Please unlock the card%0A%0A Number¬: 5343 00000001%0AHolder¬: Yannick LaRue'
He ask for pin as expected
2021-06-24 12:22:00 scdaemon[12304] DBG: chan_0x00000350 <- END
2021-06-24 12:22:00 scdaemon[12304] DBG: send apdu: c=00 i=20 p1=00 p2=82 lc=6 le=-1 em=0
2021-06-24 12:22:00 scdaemon[12304] DBG: PCSC_data: 00 20 00 82 06 30 30 30 30 30 30
2021-06-24 12:22:00 scdaemon[12304] DBG: response: sw=9000 datalen=0
2021-06-24 12:22:00 scdaemon[12304] DBG: dump:
2021-06-24 12:22:00 scdaemon[12304] DBG: send apdu: c=00 i=2A p1=80 p2=86 lc=257 le=256 em=-254
2021-06-24 12:22:00 scdaemon[12304] DBG: PCSC_data: 10 2A 80 86 FE 00 6B CC D1 59 A2 BF D7 C7 A5 0B 8F 5A EF EA 75 1E DC 67 C5 2A 9C FF 23 F6 3F 5D 7A A5 62 27 4B C7 70 7B 6C 0E 4D 89 37 B5 57 5C 60 35 7B 5F E6 80 29 60 81 F3 E6 74 81 DA BC 46 D6 7C 27 9C 84 C3 DD C2 2C 2E E3 53 58 77 CC 94 F6 01 4B 3C D6 97 D1 CF 91 62 02 83 74 1D 78 10 C2 45 4A 89 81 47 61 BC 2A 49 66 98 5E 47 AD 65 89 12 B1 A0 93 03 9F 7E 7F A3 73 2F 0D 94 8F F2 04 A2 39 C7 D2 96 A4 7C EE F2 1F 2B 6E 2A B8 12 50 78 51 E9 AF 37 E1 6E 9E 74 7C 0F 53 AC 2E 5A E5 6A 67 E8 0A 4F E4 E8 78 C4 B4 59 D7 7B BC 41 1D 8A D6 CE BE B3 42 76 83 28 72 D2 E4 61 26 FF 5A C4 26 5D 88 F3 14 D6 E3 96 9D A8 F1 49 8E 68 86 8B 56 2A B6 7E D1 31 A8 BB 2F 36 5E FA C6 CE E6 8A E7 4B 28 22 BC 64 1F 02 93 E2 65 F4 F3 D9 EF 9C 38 D3 0D FC 58 5F 0F 1E 50 5F 44 D6 B7 54 0A B8 CE
2021-06-24 12:22:01 scdaemon[12304] DBG: PCSC_data: 00 2A 80 86 03 98 96 F5 00
2021-06-24 12:22:01 scdaemon[12304] DBG: response: sw=9000 datalen=35
2021-06-24 12:22:01 scdaemon[12304] DBG: dump: 09 52 FF 1E 72 12 1A 93 C8 D3 57 A8 26 3C 3B 95 0D EB 5B 8E BD 9B 13 6A 8D 84 B4 98 37 7F 64 DF D7 0F 4F
2021-06-24 12:22:01 scdaemon[12304] operation decipher result: Réussite
Success to decipher and all return in normal state. For opengpg operation.

This revision now requires changes to proceed.Jun 24 2021, 6:40 PM