From acb7de9d8d946ad15102dc703a6511a66be5a4f8 Mon Sep 17 00:00:00 2001 From: n-hutton Date: Tue, 21 Jan 2025 23:51:26 +0000 Subject: [PATCH] more cleanup noticed just now --- armsrc/emvsim.c | 3 --- armsrc/mifaresim.c | 2 -- client/src/emv/cmdemv.c | 3 --- include/protocols.h | 2 -- 4 files changed, 10 deletions(-) diff --git a/armsrc/emvsim.c b/armsrc/emvsim.c index 57a2b821c..fd50b040d 100644 --- a/armsrc/emvsim.c +++ b/armsrc/emvsim.c @@ -126,7 +126,6 @@ void ExecuteEMVSim(uint8_t *receivedCmd, uint16_t receivedCmd_len, uint8_t *rece // use annotate to give some hints about the command annotate(&receivedCmd[1], receivedCmd_len-1); - //Dbprintf("Annotated: %s", explanation); // This is a common request from the reader which we can just immediately respond to since we know we can't // handle it. @@ -138,7 +137,6 @@ void ExecuteEMVSim(uint8_t *receivedCmd, uint16_t receivedCmd_len, uint8_t *rece // We want to modify corrupted request if ((receivedCmd_len > 5 && receivedCmd[0] != 0x03 && receivedCmd[0] != 0x02 && receivedCmd[1] == 0 && receivedCmd[4] == 0) || (receivedCmd[2] == 0xa8)) { - //if (receivedCmd[2] == 0xa8) { Dbprintf("We saw signing request... modifying it into a generate ac transaction !!!!"); currentState = GENERATE_AC; @@ -276,7 +274,6 @@ void ExecuteEMVSim(uint8_t *receivedCmd, uint16_t receivedCmd_len, uint8_t *rece } // If we would return a PAY1 fci response, we instead return a PAY2 fci response - //if (responseToReader[1] == fci_template_pay1[1] && true) { if (currentState == SELECT_PAY1_AID) { Dbprintf("We saw a PAY1 response... modifying it to a PAY2 response for outgoing !!!!"); memcpy(responseToReader, fci_template_pay2, sizeof(fci_template_pay2)); diff --git a/armsrc/mifaresim.c b/armsrc/mifaresim.c index 4b246886b..d2ab0ecbe 100644 --- a/armsrc/mifaresim.c +++ b/armsrc/mifaresim.c @@ -199,7 +199,6 @@ static uint8_t MifareMaxSector(uint16_t flags) { } bool MifareSimInit (uint16_t flags, uint8_t *uid, uint16_t atqa, uint8_t sak, tag_response_info_t **responses, uint32_t *cuid, uint8_t *uid_len, uint8_t **rats, uint8_t *rats_len) { -//static bool MifareSimInitX(uint16_t flags, uint8_t *datain, uint16_t atqa, uint8_t sak, tag_response_info_t **responses, uint32_t *cuid, uint8_t *uid_len, uint8_t **rats, uint8_t *rats_len) { uint8_t uid_tmp[10] = {0}; // SPEC: https://www.nxp.com/docs/en/application-note/AN10833.pdf @@ -294,7 +293,6 @@ bool MifareSimInit (uint16_t flags, uint8_t *uid, uint16_t atqa, uint8_t sak, ta rSAK[0] = rSAK_1k; if (g_dbglevel > DBG_NONE) Dbprintf("Enforcing Mifare 1K ATQA/SAK"); } else if (IS_FLAG_MF_SIZE(flags, MIFARE_2K_MAX_BYTES)) { - Dbprintf("We got this to happen!!!\n"); memcpy(rATQA, rATQA_2k, sizeof(rATQA)); rSAK[0] = rSAK_2k; *rats = rRATS; diff --git a/client/src/emv/cmdemv.c b/client/src/emv/cmdemv.c index 478ebf1d1..4d7daec9e 100644 --- a/client/src/emv/cmdemv.c +++ b/client/src/emv/cmdemv.c @@ -694,14 +694,11 @@ static int CmdEMVSmartToNFC(const char *Cmd) { } FLAG_SET_MF_SIZE(flags, MIFARE_2K_MAX_BYTES); - //snprintf(csize, sizeof(csize), "2K with RATS"); - //k_sectors_cnt = MIFARE_2K_MAXSECTOR; // todo: delete flags |= FLAG_ATQA_IN_DATA; flags |= FLAG_SAK_IN_DATA; payload.flags = flags; - //payload.flags = 0x1204; payload.exitAfter = 0x1; payload.atqa = 0x0; payload.sak = 0x20; diff --git a/include/protocols.h b/include/protocols.h index 24eb87cd4..1940b91ee 100644 --- a/include/protocols.h +++ b/include/protocols.h @@ -496,8 +496,6 @@ ISO 7816-4 Basic interindustry commands. For command APDU's. #define ISO7816_GENERATE_APPLICATION_CRYPTOGRAM 0xAE #define ISO7816_GET_PROCESSING_OPTIONS 0xA8 #define ISO7816_PIN_CHANGE 0x24 -#define ISO7816_PIN_CHANGE 0x24 - #define ISO7816_GET_RESPONSE 0xC0