Create File APDU for GRCard SIM

Matt S sixonefourb at gmail.com
Tue Apr 23 15:08:23 UTC 2013


> Excerpts from Matt S's message of 2013-04-22 12:27:54 -0700:
>> Hello,
>>
>> I'm struggling to get the 'CREATE FILE' APDU to work on a GRCard SIM. I'm
>> using the cyberflex-shell in interactive mode to send apdu's. Even though I
>> verify ADM pin 5, and follow the format on the wiki (
>> http://openbsc.osmocom.org/trac/wiki/GrcardSIM), I still get the reponse
>> 0x9804 from the cards. I must be missing a step?
>
> 0x98 0x04 means "in contradiction with CHV status" (3GPP TS 51.011)

It looks like 0x98 0x04 is 'access condition not fulfilled' or
'authentication failed'. Regardless it appears I am not verifying
proper access conditions.

>
>>
>> Below is my failed session with a SIM, trying to create FID 0xabcd under
>> 3f00/7f20. Any guidance is greatly appreciated.
>
> 7f20 is the reserved id for DFgsm.
> Is this file (directory) not already present on the card?
>

Yes it is present. Although the card does not contain a file in this
directory that I need. I'm trying to create a file underneath the
DFgsm directory. I assume I need to select the directory in which I
want prior to invoking the Create File APDU.

> the card tells you 17 bytes of response are waiting for you.
> this is the select file response, and will tell about the status of the file you selected, and the corresponding access conditions.
> did you verify them?

This is the SELECT response on DFgsm (0x7f20). Upon decoding, it
appears there are a total of 12 CHV's and codes. I've tried resetting
PIN1, PIN2, ADM1, and ADM2 all successfully, then verifying all 4
after selecting the DFgsm file, but I still get response 0x9804 when I
try to create a new file. Create File on these GRCards use a
proprietary APDU which I followed from the wiki, Not sure what I'm
doing wrong?

SELECT 0x7f20
--------------------------------------------------------------------------------
>> 0000:  a0 c0 00 00 17                                    .....
<< 0000:  00 00 00 0f 7f 20 02 00 00 00 00 00 0a 13 00 12   ..... ..........
     0010:  0c 00 83 8a 83 8a 00 90 00                        .........
--------------------------------------------------------------------------------




More information about the simtrace mailing list