EMV - GPO with PDOL

亡梦爱人 提交于 2019-12-23 20:10:01

问题


I'm working on a C platform and I want to read the AFL of a card. If the previous command, select of the AID, don't give me a PDOL tag, it's ok: I can read the AFL without issues. But I need to write a method that can generate a GET PROCESSING OPTION regardless the PDOL.

So the questions are:

  1. How can I write an universal method that work despite the PDOL?
    Have I to map every single possible TAG?
  2. How can I format the GPO command with the correct data? Look the following example:

SELECT AID Response PDOL: 9F 1A 02 So I have to put the Terminal Country Code, in my case Italy: 380 So the GPO call is:

80 A0 00 00 04 83 02 03 80 00

But the response that I have is 6D 00: Instruction code not supported or invalid

Where am I wrong?

I'm programming on Ingenico Pos (Point of sale).


回答1:


Good to know that you are aware with the concept of PDOL very well. As far I can understand with your question, you are comfortable to construct GPO command if PDOL is not present. I think You are in doubt to write a generic function to construct GPO APDU command.

First of all I want to tell you that if PDOL information is present in SELECT response then you should send PDOL data in GPO command APDU, otherwise card application may throw some error.

So you can set an indicator when you receive PDOL in SELECT command. If PDOL is not there you can simply send 80 A8 00 00 02 83 00 00 and if your indicator stated that PDOL is required then simply parse the PDOL and from SELECT response and prepare a value for PDOL data if you know (as you described in your question) to be send in GPO command APDU.

If you don't know what value then you can simply fill hexadecimal zeros in value field.

Taking your example : 80 A8 00 00 04 83 02 03 80 00. This is the correct command (I have corrected INS byte). Or you can also send 80 A8 00 00 04 83 02 00 00 00 (PDOL value is replace by zeros)

I think this explanation can help you to get the answers of both the questions. Try it and let us know if there is any further clarification needed.




回答2:


You have two options:

  1. Issue a command with data field of "8300" - 80 A8 00 00 02 83 00 00
  2. Issue a command with data field of all hexadecimal zeroes - 80 A8 00 00 04 83 02 00 00 00

You receive the error, because in option 1 you omit the Le byte of the C-APDU - this byte is mandatory for all CASE 4 commands and in option 2 you give wrong INS byte, A0 instead of A8.




回答3:


Card Issuers don't put just any tag and expect the terminal to provide the data. You can get the best practices(recommended tags) from each payment scheme you are certifying with. Besides, if it is some tag which you don't support, you can always zero fill and proceed.



来源:https://stackoverflow.com/questions/50249292/emv-gpo-with-pdol

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!