X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/9206d3b0342c5d0a594715eab06f6db232329c8d..60ca58872589f49c81fc49cb500c4930c032afe0:/armsrc/emvutil.c?ds=inline diff --git a/armsrc/emvutil.c b/armsrc/emvutil.c index e35cb1ef..be19d32a 100644 --- a/armsrc/emvutil.c +++ b/armsrc/emvutil.c @@ -8,19 +8,7 @@ //----------------------------------------------------------------------------- // various EMV related functions. //----------------------------------------------------------------------------- -#include -#include "proxmark3.h" -#include "apps.h" -#include "util.h" -#include "string.h" - -#include "BigBuf.h" - -#include "iso14443crc.h" -#include "iso14443a.h" #include "emvutil.h" -#include "emvdataels.h" //EMV data elements -#include "emvtags.h" //EMV card structure #define DUMP(varname) Dbprintf("%s=", #varname); @@ -382,14 +370,18 @@ exitfunction: //goto label to exit search quickly once found //function to int emv_settag(uint32_t tag, uint8_t *datain, emvtags *currentcard){ char binarydata[255] = {0}; - //if((strlen((const char *)datain)%2) != 0){ //must be an even string + + /* + // if((strlen((const char *)datain)%2) != 0){ //must be an even string // return -1; - //} - //if(strlen((const char *)datain) > 255) { + // } + // if(strlen((const char *)datain) > 255) { // return -1; - //} - uint8_t datalen = strlen((const char *)datain) / 2; //length of datain - for(int i=0;i 0){ memcpy(&(processingCmd[7]), pdol, pdol_len);} processingCmd[processingCmd_len] = 0x00; - //Dbhexdump(processingCmd_len, processingCmd, false); - return iso14_apdu(processingCmd,processingCmd_len,false, 0, data); + return iso14_apdu(processingCmd, processingCmd_len, data); } int emv_computecryptogram(uint8_t* UDOL, uint8_t UDOL_len, void *data) @@ -1414,7 +1405,7 @@ int emv_computecryptogram(uint8_t* UDOL, uint8_t UDOL_len, void *data) memcpy(&(cryptogramCmd[5]), UDOL, UDOL_len); cryptogramCmd[cryptogramCmd_len-1] = 0x00; - return iso14_apdu(cryptogramCmd,cryptogramCmd_len,false, 0,data); + return iso14_apdu(cryptogramCmd, cryptogramCmd_len, data); } int emv_getchallenge(void *data) @@ -1428,7 +1419,7 @@ int emv_getchallenge(void *data) challengeCmd[3] = 0x00; challengeCmd[4] = 0x00; - return iso14_apdu(challengeCmd,challengeCmd_len,false, 0,data); + return iso14_apdu(challengeCmd, challengeCmd_len, data); } int emv_loopback(uint8_t* transData , uint8_t transData_len, void *data) @@ -1442,7 +1433,7 @@ int emv_loopback(uint8_t* transData , uint8_t transData_len, void *data) loopbackCmd[3] = 0x00; loopbackCmd[4] = loopbackCmd_len; memcpy(&(loopbackCmd[5]), transData, transData_len); - return iso14_apdu(loopbackCmd,loopbackCmd_len,false, 0,data); + return iso14_apdu(loopbackCmd, loopbackCmd_len, data); } //generateAC @@ -1459,15 +1450,14 @@ int emv_generateAC(uint8_t refcontrolparam, uint8_t* cdolinput, uint8_t cdolinpu memcpy(&(acCmd[5]), cdolinput, cdolinputlen); acCmd[acCmd_len-1] = 0x00; Dbhexdump(acCmd_len, acCmd,false); - return iso14_apdu(acCmd,acCmd_len,false,0,data); + return iso14_apdu(acCmd, acCmd_len, data); } -int emv_decodeAFL(uint8_t* AFL, uint8_t AFLlen ) -{ - +int emv_decodeAFL(uint8_t* AFL, uint8_t AFLlen ){ return 0; } +//ICEMAN: move to client //Print out AIP Bit meanings int emv_decodeAIP(uint8_t* AIP) { @@ -1490,6 +1480,7 @@ int emv_decodeAIP(uint8_t* AIP) return 0; } +//ICEMAN: move to client int emv_decodeCVM(uint8_t* CVM, uint8_t CVMlen) { uint8_t counter = 0; @@ -1555,6 +1546,7 @@ int emv_decodeCVM(uint8_t* CVM, uint8_t CVMlen) return 0; } +//ICEMAN: move to client //dump the current card to the console void dumpCard(emvtags* currentcard){ DUMP(currentcard->ATQA);