FIX: commented code screws up notepad++ groupings.

This commit is contained in:
iceman1001 2017-02-06 00:50:37 +01:00
parent a32e8034e0
commit d627a2fd8c
2 changed files with 73 additions and 79 deletions

View file

@ -11,15 +11,10 @@
#include "emvcmd.h" #include "emvcmd.h"
static emvtags currentcard; //use to hold emv tags for the reader/card during communications static emvtags currentcard; //use to hold emv tags for the reader/card during communications
//static tUart Uart;
// The FPGA will report its internal sending delay in // The FPGA will report its internal sending delay in
uint16_t FpgaSendQueueDelay; //uint16_t FpgaSendQueueDelay;
//variables used for timing purposes:
//these are in ssp_clk cycles:
//static uint32_t NextTransferTime;
//static uint32_t LastTimeProxToAirStart;
//static uint32_t LastProxToAirDuration;
//load individual tag into current card //load individual tag into current card
void EMVloadvalue(uint32_t tag, uint8_t *datain){ void EMVloadvalue(uint32_t tag, uint8_t *datain){
@ -34,8 +29,6 @@ void EMVReadRecord(uint8_t arg0, uint8_t arg1,emvtags *currentcard)
uint8_t sfi = arg1 & 0x0F; // convert arg1 to number uint8_t sfi = arg1 & 0x0F; // convert arg1 to number
uint8_t receivedAnswer[MAX_FRAME_SIZE]; uint8_t receivedAnswer[MAX_FRAME_SIZE];
//uint8_t receivedAnswerPar[MAX_PARITY_SIZE];
// variables // variables
tlvtag inputtag; // create the tag structure tlvtag inputtag; // create the tag structure
// perform read // perform read
@ -58,7 +51,6 @@ void EMVReadRecord(uint8_t arg0, uint8_t arg1,emvtags *currentcard)
void EMVSelectAID(uint8_t *AID, uint8_t AIDlen, emvtags* inputcard) void EMVSelectAID(uint8_t *AID, uint8_t AIDlen, emvtags* inputcard)
{ {
uint8_t receivedAnswer[MAX_FRAME_SIZE]; uint8_t receivedAnswer[MAX_FRAME_SIZE];
//uint8_t receivedAnswerPar[MAX_PARITY_SIZE];
// variables // variables
tlvtag inputtag; // create the tag structure tlvtag inputtag; // create the tag structure
@ -95,7 +87,6 @@ void EMVSelectAID(uint8_t *AID, uint8_t AIDlen, emvtags* inputcard)
int EMVGetProcessingOptions(uint8_t *PDOL, uint8_t PDOLlen, emvtags* inputcard) int EMVGetProcessingOptions(uint8_t *PDOL, uint8_t PDOLlen, emvtags* inputcard)
{ {
uint8_t receivedAnswer[MAX_FRAME_SIZE]; uint8_t receivedAnswer[MAX_FRAME_SIZE];
//uint8_t receivedAnswerPar[MAX_PARITY_SIZE];
// variables // variables
tlvtag inputtag; //create the tag structure tlvtag inputtag; //create the tag structure
@ -208,7 +199,7 @@ int EMV_PaywaveTransaction()
Dbhexdump(2, currentcard.tag_82, false); Dbhexdump(2, currentcard.tag_82, false);
emv_decodeAIP(currentcard.tag_82); emv_decodeAIP(currentcard.tag_82);
// //
// //decode the AFL list and read records // decode the AFL list and read records
uint8_t i = 0; uint8_t i = 0;
uint8_t sfi = 0; uint8_t sfi = 0;
uint8_t recordstart = 0; uint8_t recordstart = 0;
@ -247,7 +238,6 @@ int EMV_PaywaveTransaction()
return 0; return 0;
} }
int EMV_PaypassTransaction() int EMV_PaypassTransaction()
{ {
// uint8_t *responsebuffer = emv_get_bigbufptr(); // uint8_t *responsebuffer = emv_get_bigbufptr();
@ -344,6 +334,7 @@ void EMVTransaction()
LED_C_OFF(); LED_C_OFF();
iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN); iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN);
while(true) { while(true) {
if(!iso14443a_select_card(uid, NULL, &cuid, true, 0)) { if(!iso14443a_select_card(uid, NULL, &cuid, true, 0)) {
if(EMV_DBGLEVEL >= 1) Dbprintf("Can't select card"); if(EMV_DBGLEVEL >= 1) Dbprintf("Can't select card");
@ -351,6 +342,7 @@ void EMVTransaction()
} }
//selectPPSE //selectPPSE
EMVSelectAID((uint8_t *)DF_PSE, 14, &currentcard); //hard coded len EMVSelectAID((uint8_t *)DF_PSE, 14, &currentcard); //hard coded len
//get response //get response
if (!memcmp(currentcard.tag_4F, AID_MASTERCARD, sizeof(AID_MASTERCARD))){ if (!memcmp(currentcard.tag_4F, AID_MASTERCARD, sizeof(AID_MASTERCARD))){
Dbprintf("Mastercard Paypass Card Detected"); Dbprintf("Mastercard Paypass Card Detected");

View file

@ -1389,7 +1389,6 @@ int emv_getprocessingoptions(uint8_t* pdol, uint8_t pdol_len, void* data)
if(pdol_len > 0){ if(pdol_len > 0){
memcpy(&(processingCmd[7]), pdol, pdol_len);} memcpy(&(processingCmd[7]), pdol, pdol_len);}
processingCmd[processingCmd_len] = 0x00; processingCmd[processingCmd_len] = 0x00;
//Dbhexdump(processingCmd_len, processingCmd, false);
return iso14_apdu(processingCmd, processingCmd_len, data); return iso14_apdu(processingCmd, processingCmd_len, data);
} }
@ -1458,6 +1457,7 @@ int emv_decodeAFL(uint8_t* AFL, uint8_t AFLlen ){
return 0; return 0;
} }
//ICEMAN: move to client
//Print out AIP Bit meanings //Print out AIP Bit meanings
int emv_decodeAIP(uint8_t* AIP) int emv_decodeAIP(uint8_t* AIP)
{ {
@ -1480,6 +1480,7 @@ int emv_decodeAIP(uint8_t* AIP)
return 0; return 0;
} }
//ICEMAN: move to client
int emv_decodeCVM(uint8_t* CVM, uint8_t CVMlen) int emv_decodeCVM(uint8_t* CVM, uint8_t CVMlen)
{ {
uint8_t counter = 0; uint8_t counter = 0;
@ -1545,6 +1546,7 @@ int emv_decodeCVM(uint8_t* CVM, uint8_t CVMlen)
return 0; return 0;
} }
//ICEMAN: move to client
//dump the current card to the console //dump the current card to the console
void dumpCard(emvtags* currentcard){ void dumpCard(emvtags* currentcard){
DUMP(currentcard->ATQA); DUMP(currentcard->ATQA);