From: Douglas E E. <dee...@gm...> - 2015-10-29 16:16:39
|
Basic answer is OpenSC used to assume one one application per card, and the ATR determined the driver. Modern approach is to use an application AID to select the application on the card. On 10/29/2015 9:15 AM, Kaspars Dambis wrote: > Hello! > > I'm trying to understand why this legacy version of OpenSC [1] is able to recognize my Latvia eID card (IAS/ECC) while my efforts of porting the support for the card to the latest version of OpenSC > [2] is currently failing. > > Here is the relevant debug log from both versions: > https://gist.github.com/kasparsd/66cf8b145b7e3ae8d120 > > It appears that iasecc_select_mf is using the wrong file path after having received the same APDU response. The working version selects the following: > > > card-iasecc.c:603:iasecc_select_file: iasecc_select_file(card:0x1018005e0) path.len 16; path.type 1; aid_len 0 > > card-iasecc.c:604:iasecc_select_file: iasecc_select_file() path:a000000077010800070000fe00000100:: > > while the non-working version does this: > > > card-iasecc.c:943:iasecc_select_file: iasecc_select_file(card:0x7ffd94801000) path.len 10; path.type 1; aid_len 0 > > card-iasecc.c:944:iasecc_select_file: iasecc_select_file() path:4c41545649412d654944:: This looks like 100 //proprietary ATR to match 101 static struct sc_aid LatviaEid_ATR_MATCH = { 102 {0x4C,0x41,0x54,0x56,0x49,0x41,0x2D,0x65,0x49,0x44}, 10 103 }; A ATR is a not path to a file. The above looks like "LATVIA-Eid" what code called select_file with 4c41545649412d654944? An ATR may have historic bytes that may contain an AID. But a vendor can put anything in the historic bytes. > > I would appreciate any tips or suggestion on where to put debug pointers to be able to resolve this. Here are the complete logs [3] if that would help. > > Thanks! > Kaspars > > p.s. please note that I've spent only a few month looking into smart cards and have a very basic understanding of C. > > [1] https://github.com/kasparsd/latvian-eid-opensc/commit/d615c91843f04d2df09a275cd6e513920a8fc497 > [2] https://github.com/kasparsd/OpenSC-Latvia-eID > [3] https://gist.github.com/kasparsd/acea5c71f543bda88b5e > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Opensc-devel mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensc-devel > -- Douglas E. Engert <DEE...@gm...> |