X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/53d5dc643f592124676b4290c8f81e6039e9abc7..76a608af8e342b50718cfd0e53c0fa932304dbd9:/armsrc/emvutil.h diff --git a/armsrc/emvutil.h b/armsrc/emvutil.h index bd5ec4fe..bb6216f0 100644 --- a/armsrc/emvutil.h +++ b/armsrc/emvutil.h @@ -14,6 +14,7 @@ #include #include +#include #include "proxmark3.h" #include "apps.h" #include "tlv.h" @@ -30,15 +31,6 @@ // reader voltage field detector #define EMV_MINFIELDV 4000 -// debug -// 0 - no debug messages 1 - error messages 2 - all messages 4 - extended debug mode -#define EMV_DBG_NONE 0 -#define EMV_DBG_ERROR 1 -#define EMV_DBG_ALL 2 -#define EMV_DBG_EXTENDED 4 - -extern int EMV_DBGLEVEL; - //EMV emulator states need to update #define EMVEMUL_NOFIELD 0 #define EMVEMUL_IDLE 1 @@ -50,21 +42,13 @@ extern int EMV_DBGLEVEL; #define EMVEMUL_WORK 7 #define EMVEMUL_HALTED 8 #define EMVEMUL_ACK 9 -//#define cardSTATE_TO_IDLE() cardSTATE = EMVEMUL_IDLE; LED_B_OFF(); LED_C_OFF(); -//grabbed from iso14443a.c -//static int EmGetCmd(uint8_t *received, int *len); -//int EmSendCmdEx(uint8_t *resp, size_t respLen, bool correctionNeeded);//tag types -//int EmSendCmd(uint8_t *resp, size_t respLen); -//#define cardSTATE_TO_IDLE() cardSTATE = MFEMUL_IDLE; LED_B_OFF(); LED_C_OFF(); -//extern int iso14_apdu(uint8_t *cmd, uint16_t cmd_len, void *data); //functions //int emv_sendapdu( uint8_t cla, uint8_t ins, uint8_t p1, uint8_t p2, uint8_t lc, uint8_t* data, uint8_t le); int emv_select(uint8_t* AID, uint8_t AID_len, void* data); int emv_selectPPSE(); int emv_readrecord(uint8_t recordnumber, uint8_t sfi, void* data); -int emv_getprocessingoptions(uint8_t* pdol, uint8_t pdol_len, void* data -); +int emv_getprocessingoptions(uint8_t* pdol, uint8_t pdol_len, void* data); int emv_computecryptogram(uint8_t* UDOL, uint8_t UDOL_len, void *data); //return 8 8byte ICC random number. int emv_getchallenge(void *data); @@ -73,26 +57,22 @@ int emv_generateAC(uint8_t refcontrolparam, uint8_t* cdolinput, uint8_t cdolinpu int emv_decodeAFL(uint8_t* AFL, uint8_t AFLlen); int emv_decodeAIP(uint8_t* AIP); int emv_decodeCVM(uint8_t* CVM, uint8_t CVMlen); -//memory management -//uint8_t* emv_get_bigbufptr(void); -//uint8_t* emv_get_bigbufptr_sendbuf(void); -//uint8_t* emv_get_bigbufptr_recbuf(void); //emulator -//void EMVsim(); +void EMVsim(); //utils -int emv_printtag(uint8_t* selected_tag,emvtags* inputcard, uint8_t* outputstring, uint8_t* outputlen); -int emv_decode_field(uint8_t* inputfield,uint16_t inputlength, emvtags *result); -int emv_emvtags_decode_tag(tlvtag* inputtag, emvtags* currentcard); +int emv_printtag(uint8_t* selected_tag, emvcard* inputcard, uint8_t* outputstring, uint8_t* outputlen); +int emv_decode_field(uint8_t* inputfield,uint16_t inputlength, emvcard *result); +int emv_emvtags_decode_tag(tlvtag* inputtag, emvcard* currentcard); //look up a tag in the current structure -int emv_lookuptag(uint8_t* tag, emvtags* currentcard, uint8_t* outputval, uint8_t* outputvallen); +int emv_lookuptag(uint8_t* tag, emvcard* currentcard, uint8_t* outputval, uint8_t* outputvallen); //set a tag from external impurt -int emv_settag(uint32_t tag, uint8_t *datain, emvtags *currentcard) ; -void dumpCard(emvtags* currentcard); +int emv_settag(uint32_t tag, uint8_t *datain, emvcard *currentcard) ; +void dumpCard(emvcard* currentcard); //generate a valid PDOL list from the returned card value, used in get processing options -int emv_generateDOL(uint8_t* DOL, uint8_t DOLlen,emvtags* currentcard, uint8_t* DOLoutput, uint8_t* DOLoutputlen); +int emv_generateDOL(uint8_t* DOL, uint8_t DOLlen,emvcard* currentcard, uint8_t* DOLoutput, uint8_t* DOLoutputlen); -int emv_generatetemplate(uint8_t* templateval,emvtags* currentcard, uint8_t* returnedval, uint8_t* returnedlen, uint8_t numtags, ...); +int emv_generatetemplate(uint8_t* templateval,emvcard* currentcard, uint8_t* returnedval, uint8_t* returnedlen, uint8_t numtags, ...); #endif