I'm using GPShell on an Ubuntu VM with a smart card reader (the model is ACR122) and I'm using several different NXP SmartMX chips.
Using their Android TagInfo app, I'm able to see the "Card Production Lifecycle Data" when I scan one specific SmartMX chip.
However, I would like to use GPShell to get the CPLC data as well. I assume it's accessible because I can see it when I scan the tag on the Android device.
I have a program called connect.txt, and it has this as the contents:
mode_211
enable_trace
establish_context
card_connect
get_data -identifier 9F7F
card_disconnect
release_context
This is the output:
josh@josh-VirtualBox:~/projects/gpshell-test$ gpshell connect.txt
mode_211
enable_trace
establish_context
card_connect
* reader name ACS ACR122U PICC Interface 00 00
get_data -identifier 9F7F
Command --> 80CA9F7F00
Wrapped command --> 80CA9F7F00
Response <--
get_data() returns 0x80200000 (Unknown ISO7816 error: 0x0000)
I'm trying to follow the GPShell docs for the above command (get_data -identifier 9F7F) which is supposed to be the command for getting the CPLC data.
How can I get the CPLC data?
As for debugging, I've tried some of the sample scripts that come with GPShell (for example, selecting a certain AID, or listing AIDs, attempting to authenticate using the default keys, etc.). All of the commands give me the same exact output as above. I also search gpshell on StackOverflow and read most questions/answers, but none of them quite seem to cover what I'm asking here (I can provide links if requested). Thanks.
Short answer: I had to select an application first, and then authenticate using the default key before sending the
GET DATAcommand.I ended up installing GlobalPlatformPro, which is another command line tool for getting data from a smart card.
I used
gp -list -dto list all of the AIDs on the card (-dis debug to show the APDUs being sent). It turns out the card is using the default key404142434445464748494a4b4c4d4e4f(found in the gpshell docs under the heading Secure Channel Keys.It output several apps. The AID I ended up needing to use (after trying several of them) was:
I changed my
connect.txtprogram to this:This ended up outputting (using GPShell):
The response I care about is the last line of output, which is the CPLC data (redacted). You can check out globalplatform.h starting at Line 128 to see how the CPLC is parsed: