i have a funny case which i think i am missing the information somewhere in the specification.
My EMV Card provides this PDOL
9F33 02 9F35 01 9F40 01 -> Total length = 4
These are my terminal transaction related data
Terminal capabilities : 9F33 -> 0xA0 0xA0 0xC0
Additional Terminal Capabilities : 9F35 -> 0x16
Terminal Type : 9F40 -> 0x70 0x00 0x80 0xB0 0x01
When i get the processing options passing (A0 A0) bytes 1 and 2 for the 2 bytes of 9F33 16 for 9F35 and 70 for 9F40 i get a 69 85 status word.
Here is my command (in Hex)
80 A8 00 00 06 83 04 A0 A0 16 70 00 -> s1 s2 = 69 85
and
When i pass A0 C0 (Byte 2 and Byte 3) for 9F33, i get the success (90 00)
80 A8 00 00 06 83 04 A0 C0 16 70 00 -> s1 s2 = 90 00
My Question :
How do i know exactly what bytes are needed, especially when the required length is less than the actual length?. Where is it documented in the Specification?. I just found this out by intuition.
Thanks in Advance.
These are the rules from Book 3 Chapter 5.4 as you rightly pointed. "c" is the explanation to my results. In my case i had to truncate the right-most bytes (Byte 2 and 3) because my Data Object (9F33) does not have a numeric format.
a. If the tag of any data object identified in the DOL is unknown to the terminal or represents a constructed data object, the terminal shall provide a data element with the length specified and a value of all hexadecimal zeroes.
b. If a data object is in the list and is meaningful to the terminal but represents optional static data that is absent from the terminal, the portion of the command field representing the data object shall be filled with hexadecimal zeroes.
c. If the length specified in the DOL entry is less than the length of the actual data object, the leftmost bytes of the data element shall be truncated if the data object has numeric (n 1) format, or the rightmost bytes of the data shall be truncated for any other format.
d. If the length specified in the DOL entry is greater than the length of the actual data, the actual data shall be padded:
with leading hexadecimal zeroes if the data has numeric format
with trailing hexadecimal 'FF's if the data has compressed numeric (cn 1) format
with trailing hexadecimal zeroes for any other format (an, ans or b including bit combination data 1)
e. If a data object is in the list and is meaningful to the terminal but represents data that is not applicable to the current transaction, the portion of the command field representing the data object shall be filled with hexadecimal zeroes.