proxmark3 icon indicating copy to clipboard operation
proxmark3 copied to clipboard

ISO14443B EMV commands

Open merlokk opened this issue 6 years ago • 7 comments
trafficstars

EMV commands needs to work via iso-14443b channel

merlokk avatar Jul 17 '19 20:07 merlokk

I got this as strong need. Any insight on how hard the work is needed ? (Besides the actual status of poor reliability I've found regarding B channel commands...)

cjbrigato avatar Mar 04 '20 20:03 cjbrigato

the 14b lowlevel stuff isn't the best, we would need to start with the "great hf fpga stuff to take from offical" issue (internal) to get better lowlevel. Then much of the current 14b, already supports sending raw commands. which the emv layer could build upon.

iceman1001 avatar Mar 04 '20 21:03 iceman1001

some starting points in the top down approach:

Look in emv/cmdemv.c where Hf14443_4aGetCardData is used and add some logic to probe for a TypeA card then a TypeB card (and remember the choice A<>B in some state var) which means adding a Hf14443_4bGetCardData in cmdhf14b.c

then look in emv/emvcore.c where ExchangeAPDU14a is used and add logic to choose between ExchangeAPDU14a and ExchangeAPDU14b depending on stored A<>B which means adding ExchangeAPDU14b in cmdhf14b.c

doegox avatar Mar 05 '20 04:03 doegox

okay there is much less for isob apdu than what I thought in the code :(

At first duplicate code from client/cmdhf14a.c to client/cmdhf14b.c : SelectCard14443_4 (needs heavy rewrite for B, no ATS there), CmdExchangeAPDU, ExchangeAPDU14b, CmdHF14BAPDU Firmware itself needs to get new CMD_HF_ISO14443B_READER, ISO14B_SEND_CHAINING, ISO14B_NO_DISCONNECT

Once first poc works, factorize code to avoid duplication between typeA and typeB (and pleeeease move iso14a/iso14b/iso15/felica out of include/mifare.h :D)

doegox avatar Mar 05 '20 05:03 doegox

Yeo that's seems enough and straightforward but we still need the fpga improvement. Who's able ?

cjbrigato avatar Mar 05 '20 19:03 cjbrigato

Piwi? :)

iceman1001 avatar Mar 05 '20 19:03 iceman1001

I added the hf 14b apdu command. It doesn't do the FWT and framesize yet, but it shouldn't be hard to add.

We got the FPGA from mergehell, the 14b commands has been re-written to work, the apdu is done, I see no reason for EMV 14b to be implemented now

iceman1001 avatar Sep 30 '20 17:09 iceman1001

A fix for 14B Shallow mode is pushed to fpga / repo and if we want to add more commands, this is the time :)

iceman1001 avatar Aug 29 '23 19:08 iceman1001

I think 14b EMV should work now, since it works with 14b APDU and emrtd via 14b.

Closing

iceman1001 avatar Jan 26 '24 22:01 iceman1001