【问题标题】:emv PDOL demands 2 bytes of Terminal capabilitiesemv PDOL 需要 2 个字节的终端功能
【发布时间】:2018-01-27 16:34:07
【问题描述】:

我有一个有趣的案例,我认为我错过了规范中某处的信息。

我的 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 的 2 个字节的 9F33 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

我的问题:

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

提前致谢。

【问题讨论】:

    标签: emv


    【解决方案1】:

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

    DOL使用规则请参考

    EMV 4.3 书 3

    5.4 使用数据对象列表 (DOL) 的规则

    顺便说一句,当 9F33 值改变时,你找到了为什么 GPO 响应改变的答案吗?

    【讨论】:

    • 对不起,我已经编辑了上面的问题。这是一个类型错误。这些值不对应于任何 RFU。但是根据您的建议,您如何知道要提供的字节数和其他要设置为 0 的字节数?您是否还建议我使用 9 而不是 4 的总长度?我的意思是 0x83 之后的字节。
    【解决方案2】:

    正如您正确指出的,这些是第 3 册第 5.4 章中的规则。 “c”是对我的结果的解释。在我的情况下,我不得不截断最右边的字节(Byte 2 and 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.
    

    【讨论】:

    • 9F 中的 F 使其成为非数字格式。' - 是不正确的。根据规范(参见附件 B1 BER-TLV 数据对象的标签字段编码),“F”仅表示后续字节也是标签数据。要查看标签保存的数据格式,需要从附件 A 数据元素字典中进行检查。都在第 3 册中
    • 哦,你是对的。我想我不明白第 3 卷第 4.3 章中“数字”的定义。那么这是否意味着我们必须将字典保存在代码中的某个位置?没有办法从标签中解码它吗?我在上面编辑了我的答案,以免传播错误的信息。谢谢。
    • 是的,据我了解,您必须在代码中注意它所保存的数据类型。很好,您还根据数据类型指出了差异。顺便说一句,您的问题中是否有 A0 A0 和 A0 C0 之间存在差异的实际原因?
    • 是的。实际原因是我的终端能力的安全能力(Book 4 Annex A Table 27)。 C0 编码 SDA 和 DDA 支持,而 A0 编码 SDA 和 Card capture。我实际上无法解释为什么我的卡不喜欢 A0 的安全功能。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-26
    相关资源
    最近更新 更多