Skip to content

Commit

Permalink
more cleanup noticed just now
Browse files Browse the repository at this point in the history
  • Loading branch information
orange-tangerine committed Jan 21, 2025
1 parent 3eb0238 commit acb7de9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions armsrc/emvsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 0 additions & 2 deletions armsrc/mifaresim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions client/src/emv/cmdemv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions include/protocols.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit acb7de9

Please sign in to comment.