Hi
This is a problem with GP tools that try to be generic but in the end don't even know what they're doing. They try to be "simple", but GP is not simple, nor generic. NO single tool can work with ALL cards. First of all, make sure you have the correct keys. The card may have different SDs, configured with different keys. If the card has no default selected application (which is the case for most cards), you don't need the SD AID. What is your card? An NFC phone secure element? a SIM card? A generic card? Is it accessed via contacts, or via a contactless interface? A (n U)SIM has a default selected application to support old phones that don't send a select application command, this is one of the only situations where you really need the SD AID. I think that in your card, A0 00 00 01 51 00 00 is not a security domain, since the class 0x80 is unknown after you select this application. A locked card should not reply 6E00 but 6985. The gemalto SD replies 6A82 (not found) which is normal since your card is not from gemalto. Automatic SD selection is a very bad idea, the selection order is arbitrary but this can lead to different behaviours on different cards. Manual SD selection is the way to go if you want to avoid strange problems. It seems that the correct SD for your card is the visa one (ending with 03), which is normal for g&d cards (at least from my 4 years experience with javacards) It also seems that a very important information from the GP/JC specs is unknown/overlooked by hobbyists: a select application without any AID will select the MAIN SD, whatever its AID, and will reply the selected aid in the FCI. That is: 00 A4 04 00 00 This is much simpler and reliable that choosing from a list of SDs, because SD AIDs are as arbitrary as ATRs. They are defined for every customer when the card is "prepersonnalized" (just before shipping to customers). Distributors that may have cards available for hobbyists have no idea of what it means and often choose "default" parameters", e.g. the VISA AID, A0 000000 03. If one insists with using a list of candidate SD AIDs, this should be tried first, followed by A0 000000 04, then by the gemalto AID. I my professional life with javacards, I have never seen any cards with the GP AID for the SD. I made a synthetic reply, if I forgot to answer some specific details, please tell me. Regards Sebastien Le 19/04/2013 17:17, Florent Deybach a écrit : > [EDIT] > > What is strange, is that at the beginning (when the list command didn't failed) I failed to select the Security Domain GP211 (Response APDU: 6A 82) but GPJ continued to select the Security Domain GemaltoXpressPro, etc. > Now for an unknown reason I can select the Security Domain GP211 (Response APDU:90 00) but as you see it crash... > > I don't understand what changed... > > Just an addition, if I select manually the default AID, it doesn't fail (obviously you might say...): > >> root@ubuntu12-10:/gpshell-1.4.4# java -jar ../gpj-20120310/gpj.jar -sdaid a000000003000000 -list >> Found terminals: [PC/SC terminal Gemalto USB Shell Token V2 00 00] >> Found card in terminal: Gemalto USB Shell Token V2 00 00 >> ATR: 3B F8 18 00 00 80 31 FE 45 00 73 C8 40 13 00 90 00 92 >> DEBUG: Command APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00 >> DEBUG: Response APDU: 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65 01 FF 90 00 >> DEBUG: Command APDU: 80 50 00 00 08 60 A1 49 8D F0 89 60 BE >> DEBUG: Response APDU: 00 00 70 79 4F 09 05 12 20 7A 01 02 00 76 36 81 C5 22 0A 5C 0A CA 91 49 EB E3 1A F3 90 00 >> DEBUG: Command APDU: 84 82 00 00 10 9C E5 FD F0 F3 C9 4D 62 27 56 21 AE D0 8D 5A A6 >> DEBUG: Response APDU: 90 00 >> DEBUG: Command APDU: 84 82 00 00 08 9C E5 FD F0 F3 C9 4D 62 >> DEBUG: Response APDU: 90 00 >> DEBUG: Command APDU: 80 F2 80 00 02 4F 00 >> DEBUG: Response APDU: 08 A0 00 00 00 03 00 00 00 07 9A 90 00 >> DEBUG: Command APDU: 80 F2 80 00 02 4F 00 >> DEBUG: Response APDU: 08 A0 00 00 00 03 00 00 00 07 9A 90 00 >> DEBUG: Command APDU: 80 F2 40 00 02 4F 00 >> DEBUG: Response APDU: 06 A0 00 00 00 01 01 07 04 90 00 >> DEBUG: Command APDU: 80 F2 40 00 02 4F 00 >> DEBUG: Response APDU: 06 A0 00 00 00 01 01 07 04 90 00 >> DEBUG: Command APDU: 80 F2 10 00 02 4F 00 >> DEBUG: Response APDU: 6A 81 >> DEBUG: Command APDU: 80 F2 10 00 02 4F 00 >> DEBUG: Response APDU: 6A 81 >> DEBUG: Command APDU: 80 F2 20 00 02 4F 00 >> DEBUG: Response APDU: 07 A0 00 00 00 03 53 44 01 00 07 A0 00 00 00 03 53 50 01 00 08 A0 00 00 02 27 01 10 00 01 00 0C D2 76 00 00 05 AA 04 03 60 01 04 10 01 00 05 A0 00 00 00 01 01 00 90 00 >> DEBUG: Command APDU: 80 F2 20 00 02 4F 00 >> DEBUG: Response APDU: 07 A0 00 00 00 03 53 44 01 00 07 A0 00 00 00 03 53 50 01 00 08 A0 00 00 02 27 01 10 00 01 00 0C D2 76 00 00 05 AA 04 03 60 01 04 10 01 00 05 A0 00 00 00 01 01 00 90 00 >> AID: A0 00 00 00 03 00 00 00 |........| ISD LC: 7 PR: 0x9A >> >> AID: A0 00 00 00 01 01 |......| App LC: 7 PR: 0x04 >> >> AID: A0 00 00 00 03 53 44 |.....SD| Exe LC: 1 PR: 0x00 >> >> AID: A0 00 00 00 03 53 50 |.....SP| Exe LC: 1 PR: 0x00 >> >> AID: A0 00 00 02 27 01 10 00 |....'...| Exe LC: 1 PR: 0x00 >> >> AID: D2 76 00 00 05 AA 04 03 60 01 04 10 |.v......`...| Exe LC: 1 PR: 0x00 >> >> AID: A0 00 00 00 01 |.....| Exe LC: 1 PR: 0x00 > > 2013/4/19 Florent Deybach <[email protected]> > >> Hello, >> >> I am using a Sm@rtCafé Expert 4.0 from Giesecke & Devrient. >> >> I successfully inserted a compiled Muscle Applet (0.9.11) using GPJ. >> After some testing with muscleTools I get this error message and since I am completely blocked : >> >>>> root@ubuntu12-10:/gpj-20120310# java -jar gpj.jar -list >>>> Found terminals: [PC/SC terminal Gemalto USB Shell Token V2 00 00] >>>> Found card in terminal: Gemalto USB Shell Token V2 00 00 >>>> ATR: 3B F8 18 00 00 80 31 FE 45 00 73 C8 40 13 00 90 00 92 >>>> DEBUG: Command APDU: 00 A4 04 00 07 A0 00 00 01 51 00 00 >>>> DEBUG: Response APDU: 90 00 >>>> Successfully selected Security Domain GP211 A0 00 00 01 51 00 00 >>>> DEBUG: Command APDU: 80 50 00 00 08 79 5A 91 06 AD AE 96 30 >>>> DEBUG: Response APDU: 6E 00 >>>> javax.smartcardio.CardException: Wrong initialize update, SW: 6E 00 >>>> at net.sourceforge.gpj.cardservices.GlobalPlatformService.openSecureChannel(Unknown Source) >>>> at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(Unknown Source) >> >> Did I block my card? >> >> At the beginning it worked well: >> >>> root@ubuntu12-10:/gpj-20120310# java -jar gpj.jar -list >>> Found terminals: [PC/SC terminal Gemalto USB Shell Token V2 00 00] >>> Found card in terminal: Gemalto USB Shell Token V2 00 00 >>> ATR: 3B F8 18 00 00 80 31 FE 45 00 73 C8 40 13 00 90 00 92 >>> DEBUG: Command APDU: 00 A4 04 00 07 A0 00 00 01 51 00 00 >>> DEBUG: Response APDU: 6A 82 >>> Failed to select Security Domain GP211 A0 00 00 01 51 00 00 , SW: 6A 82 >>> DEBUG: Command APDU: 00 A4 04 00 08 A0 00 00 00 18 43 4D 00 >>> DEBUG: Response APDU: 6A 82 >>> Failed to select Security Domain GemaltoXpressPro A0 00 00 00 18 43 4D 00 , SW: 6A 82 >>> DEBUG: Command APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00 >>> DEBUG: Response APDU: 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65 01 FF 90 00 >>> Successfully selected Security Domain OP201a A0 00 00 00 03 00 00 00 >>> DEBUG: Command APDU: 80 50 00 00 08 5C 99 4C D0 34 37 4A E9 >>> DEBUG: Response APDU: 00 00 70 79 4F 09 05 12 20 7A 01 02 00 37 E0 6C 5D AA 46 30 B6 D2 78 E2 20 78 4D 9B 90 00 >>> DEBUG: Command APDU: 84 82 00 00 10 29 33 1E 89 66 EF F3 0E C5 FF 4C A7 15 3A 2B 6F >>> DEBUG: Response APDU: 90 00 >>> DEBUG: Command APDU: 84 82 00 00 08 29 33 1E 89 66 EF F3 0E >>> DEBUG: Response APDU: 90 00 >>> DEBUG: Command APDU: 80 F2 80 00 02 4F 00 >>> DEBUG: Response APDU: 08 A0 00 00 00 03 00 00 00 07 9E 90 00 >>> DEBUG: Command APDU: 80 F2 80 00 02 4F 00 >>> DEBUG: Response APDU: 08 A0 00 00 00 03 00 00 00 07 9E 90 00 >>> DEBUG: Command APDU: 80 F2 40 00 02 4F 00 >>> DEBUG: Response APDU: 6A 88 >>> DEBUG: Command APDU: 80 F2 40 00 02 4F 00 >>> DEBUG: Response APDU: 6A 88 >>> DEBUG: Command APDU: 80 F2 10 00 02 4F 00 >>> DEBUG: Response APDU: 6A 81 >>> DEBUG: Command APDU: 80 F2 10 00 02 4F 00 >>> DEBUG: Response APDU: 6A 81 >>> DEBUG: Command APDU: 80 F2 20 00 02 4F 00 >>> DEBUG: Response APDU: 07 A0 00 00 00 03 53 44 01 00 07 A0 00 00 00 03 53 50 01 00 08 A0 00 00 02 27 01 10 00 01 00 0C D2 76 00 00 05 AA 04 03 60 01 04 10 01 00 90 00 >>> DEBUG: Command APDU: 80 F2 20 00 02 4F 00 >>> DEBUG: Response APDU: 07 A0 00 00 00 03 53 44 01 00 07 A0 00 00 00 03 53 50 01 00 08 A0 00 00 02 27 01 10 00 01 00 0C D2 76 00 00 05 AA 04 03 60 01 04 10 01 00 90 00 >>> AID: A0 00 00 00 03 00 00 00 |........| ISD LC: 7 PR: 0x9E >>> >>> AID: A0 00 00 00 03 53 44 |.....SD| Exe LC: 1 PR: 0x00 >>> >>> AID: A0 00 00 00 03 53 50 |.....SP| Exe LC: 1 PR: 0x00 >>> >>> AID: A0 00 00 02 27 01 10 00 |....'...| Exe LC: 1 PR: 0x00 >>> >>> AID: D2 76 00 00 05 AA 04 03 60 01 04 10 [1] |.v......`...| Exe LC: 1 PR: 0x00 >> >> Cheers, >> Florent > > _______________________________________________ > Muscle mailing list > [email protected] > http://lists.musclecard.com/mailman/listinfo/muscle_lists.musclecard.com [2] Links: ------ [1] tel:03%2060%2001%2004%2010 [2] http://lists.musclecard.com/mailman/listinfo/muscle_lists.musclecard.com
_______________________________________________ Muscle mailing list [email protected] http://lists.musclecard.com/mailman/listinfo/muscle_lists.musclecard.com
