0
votes

I'm trying to figure out the file hierarchy within a contact smart card using pyScard and ISO 7816 commands.

The first thing I do is selecting the master file (INS = 0xA4) using

    connection.execute([0x0, 0xA4, 0x0, 0x0, 0x0])

This returns ([ ], 0x61, 0x19) which means I have to run a GET_RESPONSE (INS = 0xC0) command in order to get the answer.

To do so I run

    connection.execute([0x0, 0xC0, 0x0, 0x0, 0x19])

which returns a set of bytes (besides the 0x90 00).

If I understand it correctly, by running the SELECT FILE I've selected the master file but I don't seem to find an interpretation for those bytes that I receive with GET RESPONSE, what does that mean? How do you interpretate them?

Thanks!! :)

1
You don't have a chance without ISO 7816 part 4 as a basis (describing lots of possibilities and options) and the operating system manual of the card you have (to state, which options were chosen, what additional data objects exist in the response and what these proprietary additions mean).guidot
I am following ISO 7816 parts 3, 4 and 5 in this matter. I don't have the OS manual for the card and I don't have any information about it... So GET RESPONSE's response data field doesn't follow a standard? I am sure there are some proprietary but that I won't understand, I was just hoping there might be some consensus or usual menaning of this field...Berbus
GET RESPONSE has no definition of its own for a card speaking T=0, which you seem to have. You have to look at SELECT command. Its quite clear, that a typical card will return a number of FCIs (file control parameter data objects) wrapped in an 62/64/6F tag in TLV-format, but you have to compare this by looking at the response you receive. A card can return something completely proprietary however and still claim to conform to 7816-4. Without an OS manual you are out of luck then.guidot
Ok, thank you for your answer. At least now I have more to dig in and learn from!Berbus

1 Answers

0
votes

Thanks guidot!!

GET RESPONSE has no definition of its own for a card speaking T=0, which you seem to have. You have to look at SELECT command. Its quite clear, that a typical card will return a number of FCIs (file control parameter data objects) wrapped in an 62/64/6F tag in TLV-format, but you have to compare this by looking at the response you receive. A card can return something completely proprietary however and still claim to conform to 7816-4. Without an OS manual you are out of luck then.