emv PDOL 需要 2 个字节的终端功能

emv PDOL demands 2 bytes of Terminal capabilities

我有一个有趣的案例,我想我遗漏了规范中某处的信息。

我的 EMV 卡提供此 PDOL

9F33 02 9F35 01 9F40 01 -> Total length = 4

这些是我的终端交易相关数据

Terminal capabilities : 9F33 -> 0xA0 0xA0 0xC0 
Additional Terminal Capabilities  : 9F35 -> 0x16  
Terminal Type                     : 9F40 -> 0x70 0x00 0x80 0xB0 0x01  

当我得到处理选项传递 (A0 A0) 字节 1 和 2 用于 9F33 [=35= 的 2 个字节]16 用于 9F3570 用于 9F40 我得到一个 69 85 状态字.

这是我的命令(十六进制)

80 A8 00 00 06 83 04 A0 A0 16 70 00 -> s1 s2 = 69 85

当我为 9F33 传递 A0 C0(字节 2 和字节 3) 时,我得到成功 (90 00)

80 A8 00 00 06 83 04 A0 C0 16 70 00 -> s1 s2 = 90 00

我的问题:

我如何确切知道需要哪些字节,尤其是当所需长度小于实际长度时?。它在哪里记录在规范中?我只是凭直觉发现了这一点。

提前致谢。

任何 DOL,当没有可用的实际数据时,都需要填零。当数据的实际长度大于DOL中请求的长度时,则应将数据截断为DOL中期望的长度

DOL使用规则参考

EMV 4.3 Book 3

5.4 Rules for Using a Data Object List (DOL)

顺便说一句,当 9F33 值更改时,您是否找到了为什么 GPO 响应会更改的答案?

正如您正确指出的那样,这些是第 3 册第 5.4 章中的规则。 "c" 是对我的结果的解释。在我的例子中,我不得不截断最右边的字节(字节 2 和 3),因为我的数据对象 (9F33) 没有数字格式。

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.