mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
adapt return codes for some mifare commands and their debug logging. this will reduce debug message on the client side
This commit is contained in:
parent
673f15c247
commit
419d0c1f5b
3 changed files with 52 additions and 48 deletions
|
@ -484,8 +484,8 @@ void MifareWriteBlock(uint8_t arg0, uint8_t arg1, uint8_t *datain) {
|
||||||
if (res == PM3_ETEAROFF) {
|
if (res == PM3_ETEAROFF) {
|
||||||
retval = PM3_ETEAROFF;
|
retval = PM3_ETEAROFF;
|
||||||
goto OUT;
|
goto OUT;
|
||||||
} else if (res) {
|
} else if (res != PM3_SUCCESS) {
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Write block error");
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Write block error");
|
||||||
retval = PM3_ESOFT;
|
retval = PM3_ESOFT;
|
||||||
goto OUT;
|
goto OUT;
|
||||||
}
|
}
|
||||||
|
@ -554,7 +554,7 @@ void MifareWriteBlockGDM(uint8_t blockno, uint8_t keytype, uint8_t *key, uint8_t
|
||||||
if (res == PM3_ETEAROFF) {
|
if (res == PM3_ETEAROFF) {
|
||||||
retval = PM3_ETEAROFF;
|
retval = PM3_ETEAROFF;
|
||||||
goto OUT;
|
goto OUT;
|
||||||
} else if (res) {
|
} else if (res != PM3_SUCCESS) {
|
||||||
retval = PM3_ESOFT;
|
retval = PM3_ESOFT;
|
||||||
goto OUT;
|
goto OUT;
|
||||||
}
|
}
|
||||||
|
@ -688,8 +688,8 @@ void MifareValue(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain) {
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (mifare_classic_value(pcs, cuid, blockNo, blockdata, action)) {
|
if (mifare_classic_value(pcs, cuid, blockNo, blockdata, action) != PM3_SUCCESS) {
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Write block error");
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Write block error");
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -777,8 +777,8 @@ static void MifareUWriteBlockEx(uint8_t arg0, uint8_t arg1, uint8_t *datain, boo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mifare_ultra_writeblock(blockNo, blockdata)) {
|
if (mifare_ultra_writeblock(blockNo, blockdata) != PM3_SUCCESS) {
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Write block error");
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Write block error");
|
||||||
OnError(0);
|
OnError(0);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -851,8 +851,8 @@ void MifareUWriteBlockCompat(uint8_t arg0, uint8_t arg1, uint8_t *datain) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mifare_ultra_writeblock_compat(blockNo, blockdata)) {
|
if (mifare_ultra_writeblock_compat(blockNo, blockdata) != PM3_SUCCESS) {
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Write block error");
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Write block error");
|
||||||
OnError(0);
|
OnError(0);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -896,8 +896,8 @@ void MifareUSetPwd(uint8_t arg0, uint8_t *datain) {
|
||||||
blockdata[1] = pwd[6];
|
blockdata[1] = pwd[6];
|
||||||
blockdata[2] = pwd[5];
|
blockdata[2] = pwd[5];
|
||||||
blockdata[3] = pwd[4];
|
blockdata[3] = pwd[4];
|
||||||
if (mifare_ultra_writeblock(44, blockdata)) {
|
if (mifare_ultra_writeblock(44, blockdata) != PM3_SUCCESS) {
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Write block error");
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Write block error");
|
||||||
OnError(44);
|
OnError(44);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -906,8 +906,8 @@ void MifareUSetPwd(uint8_t arg0, uint8_t *datain) {
|
||||||
blockdata[1] = pwd[2];
|
blockdata[1] = pwd[2];
|
||||||
blockdata[2] = pwd[1];
|
blockdata[2] = pwd[1];
|
||||||
blockdata[3] = pwd[0];
|
blockdata[3] = pwd[0];
|
||||||
if (mifare_ultra_writeblock(45, blockdata)) {
|
if (mifare_ultra_writeblock(45, blockdata) != PM3_SUCCESS) {
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Write block error");
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Write block error");
|
||||||
OnError(45);
|
OnError(45);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -916,8 +916,8 @@ void MifareUSetPwd(uint8_t arg0, uint8_t *datain) {
|
||||||
blockdata[1] = pwd[14];
|
blockdata[1] = pwd[14];
|
||||||
blockdata[2] = pwd[13];
|
blockdata[2] = pwd[13];
|
||||||
blockdata[3] = pwd[12];
|
blockdata[3] = pwd[12];
|
||||||
if (mifare_ultra_writeblock(46, blockdata)) {
|
if (mifare_ultra_writeblock(46, blockdata) != PM3_SUCCESS) {
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Write block error");
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Write block error");
|
||||||
OnError(46);
|
OnError(46);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -926,8 +926,8 @@ void MifareUSetPwd(uint8_t arg0, uint8_t *datain) {
|
||||||
blockdata[1] = pwd[10];
|
blockdata[1] = pwd[10];
|
||||||
blockdata[2] = pwd[9];
|
blockdata[2] = pwd[9];
|
||||||
blockdata[3] = pwd[8];
|
blockdata[3] = pwd[8];
|
||||||
if (mifare_ultra_writeblock(47, blockdata)) {
|
if (mifare_ultra_writeblock(47, blockdata) != PM3_SUCCESS) {
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Write block error");
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Write block error");
|
||||||
OnError(47);
|
OnError(47);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -1522,7 +1522,6 @@ void MifareStaticNested(uint8_t blockNo, uint8_t keyType, uint8_t targetBlockNo,
|
||||||
target_ks[0] = nt2 ^ target_nt[0];
|
target_ks[0] = nt2 ^ target_nt[0];
|
||||||
|
|
||||||
// second collection
|
// second collection
|
||||||
|
|
||||||
if (mifare_classic_halt(pcs, cuid)) {
|
if (mifare_classic_halt(pcs, cuid)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -2836,6 +2835,10 @@ OUT:
|
||||||
crypto1_deinit(pcs);
|
crypto1_deinit(pcs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUDAN card w static encrypted nonces
|
||||||
|
// 2B F9 1C 1B D5 08 48 48 03 A4 B1 B1 75 FF 2D 90
|
||||||
|
// ^^ ^^
|
||||||
|
|
||||||
void OnSuccessMagic(void) {
|
void OnSuccessMagic(void) {
|
||||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||||
LEDsoff();
|
LEDsoff();
|
||||||
|
|
|
@ -434,7 +434,7 @@ int mifare_classic_writeblock_ex(struct Crypto1State *pcs, uint32_t uid, uint8_t
|
||||||
|
|
||||||
if ((len != 1) || (receivedAnswer[0] != 0x0A)) { // 0x0a - ACK
|
if ((len != 1) || (receivedAnswer[0] != 0x0A)) { // 0x0a - ACK
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Cmd Error: %02x", receivedAnswer[0]);
|
if (g_dbglevel >= DBG_ERROR) Dbprintf("Cmd Error: %02x", receivedAnswer[0]);
|
||||||
return 1;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t d_block[18], d_block_enc[18];
|
uint8_t d_block[18], d_block_enc[18];
|
||||||
|
@ -465,11 +465,11 @@ int mifare_classic_writeblock_ex(struct Crypto1State *pcs, uint32_t uid, uint8_t
|
||||||
res |= (crypto1_bit(pcs, 0, 0) ^ BIT(receivedAnswer[0], 3)) << 3;
|
res |= (crypto1_bit(pcs, 0, 0) ^ BIT(receivedAnswer[0], 3)) << 3;
|
||||||
|
|
||||||
if ((len != 1) || (res != 0x0A)) {
|
if ((len != 1) || (res != 0x0A)) {
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Cmd send data2 Error: %02x", res);
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Cmd send data2 Error: %02x", res);
|
||||||
return 2;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mifare_classic_write_cfg_block_gdm(struct Crypto1State *pcs, uint32_t uid, uint8_t *blockData) {
|
int mifare_classic_write_cfg_block_gdm(struct Crypto1State *pcs, uint32_t uid, uint8_t *blockData) {
|
||||||
|
@ -480,7 +480,7 @@ int mifare_classic_write_cfg_block_gdm(struct Crypto1State *pcs, uint32_t uid, u
|
||||||
|
|
||||||
uint16_t len = mifare_sendcmd_short(pcs, 1, MIFARE_MAGIC_GDM_WRITE_CFG, 0, receivedAnswer, receivedAnswerPar, NULL);
|
uint16_t len = mifare_sendcmd_short(pcs, 1, MIFARE_MAGIC_GDM_WRITE_CFG, 0, receivedAnswer, receivedAnswerPar, NULL);
|
||||||
if ((len != 1) || (receivedAnswer[0] != 0x0A)) {
|
if ((len != 1) || (receivedAnswer[0] != 0x0A)) {
|
||||||
return 1;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t d_block[18], d_block_enc[18];
|
uint8_t d_block[18], d_block_enc[18];
|
||||||
|
@ -511,14 +511,12 @@ int mifare_classic_write_cfg_block_gdm(struct Crypto1State *pcs, uint32_t uid, u
|
||||||
res |= (crypto1_bit(pcs, 0, 0) ^ BIT(receivedAnswer[0], 3)) << 3;
|
res |= (crypto1_bit(pcs, 0, 0) ^ BIT(receivedAnswer[0], 3)) << 3;
|
||||||
|
|
||||||
if ((len != 1) || (res != 0x0A)) {
|
if ((len != 1) || (res != 0x0A)) {
|
||||||
return 2;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int mifare_classic_value(struct Crypto1State *pcs, uint32_t uid, uint8_t blockNo, uint8_t *blockData, uint8_t action) {
|
int mifare_classic_value(struct Crypto1State *pcs, uint32_t uid, uint8_t blockNo, uint8_t *blockData, uint8_t action) {
|
||||||
// variables
|
// variables
|
||||||
uint16_t len = 0;
|
uint16_t len = 0;
|
||||||
|
@ -540,8 +538,8 @@ int mifare_classic_value(struct Crypto1State *pcs, uint32_t uid, uint8_t blockNo
|
||||||
len = mifare_sendcmd_short(pcs, 1, command, blockNo, receivedAnswer, receivedAnswerPar, NULL);
|
len = mifare_sendcmd_short(pcs, 1, command, blockNo, receivedAnswer, receivedAnswerPar, NULL);
|
||||||
|
|
||||||
if ((len != 1) || (receivedAnswer[0] != 0x0A)) { // 0x0a - ACK
|
if ((len != 1) || (receivedAnswer[0] != 0x0A)) { // 0x0a - ACK
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Cmd Error: %02x", receivedAnswer[0]);
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Cmd Error: %02x", receivedAnswer[0]);
|
||||||
return 1;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(d_block, blockData, 4);
|
memcpy(d_block, blockData, 4);
|
||||||
|
@ -566,12 +564,12 @@ int mifare_classic_value(struct Crypto1State *pcs, uint32_t uid, uint8_t blockNo
|
||||||
res |= (crypto1_bit(pcs, 0, 0) ^ BIT(receivedAnswer[0], 3)) << 3;
|
res |= (crypto1_bit(pcs, 0, 0) ^ BIT(receivedAnswer[0], 3)) << 3;
|
||||||
|
|
||||||
if ((len != 1) || (res != 0x0A)) {
|
if ((len != 1) || (res != 0x0A)) {
|
||||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Cmd send data2 Error: %02x", res);
|
if (g_dbglevel >= DBG_INFO) Dbprintf("Cmd send data2 Error: %02x", res);
|
||||||
return 2;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mifare_ultra_writeblock_compat(uint8_t blockNo, uint8_t *blockData) {
|
int mifare_ultra_writeblock_compat(uint8_t blockNo, uint8_t *blockData) {
|
||||||
|
@ -585,9 +583,10 @@ int mifare_ultra_writeblock_compat(uint8_t blockNo, uint8_t *blockData) {
|
||||||
len = mifare_sendcmd_short(NULL, CRYPT_NONE, ISO14443A_CMD_WRITEBLOCK, blockNo, receivedAnswer, receivedAnswerPar, NULL);
|
len = mifare_sendcmd_short(NULL, CRYPT_NONE, ISO14443A_CMD_WRITEBLOCK, blockNo, receivedAnswer, receivedAnswerPar, NULL);
|
||||||
|
|
||||||
if (receivedAnswer[0] != 0x0A) { // 0x0a - ACK
|
if (receivedAnswer[0] != 0x0A) { // 0x0a - ACK
|
||||||
if (g_dbglevel >= DBG_ERROR)
|
if (g_dbglevel >= DBG_INFO) {
|
||||||
Dbprintf("Cmd Send Error: %02x %d", receivedAnswer[0], len);
|
Dbprintf("Cmd Send Error: %02x %d", receivedAnswer[0], len);
|
||||||
return 1;
|
}
|
||||||
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(d_block, blockData, 16);
|
memcpy(d_block, blockData, 16);
|
||||||
|
@ -599,11 +598,12 @@ int mifare_ultra_writeblock_compat(uint8_t blockNo, uint8_t *blockData) {
|
||||||
len = ReaderReceive(receivedAnswer, receivedAnswerPar);
|
len = ReaderReceive(receivedAnswer, receivedAnswerPar);
|
||||||
|
|
||||||
if (receivedAnswer[0] != 0x0A) { // 0x0a - ACK
|
if (receivedAnswer[0] != 0x0A) { // 0x0a - ACK
|
||||||
if (g_dbglevel >= DBG_ERROR)
|
if (g_dbglevel >= DBG_INFO) {
|
||||||
Dbprintf("Cmd Send Data Error: %02x %d", receivedAnswer[0], len);
|
Dbprintf("Cmd Send Data Error: %02x %d", receivedAnswer[0], len);
|
||||||
return 2;
|
}
|
||||||
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
return 0;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mifare_ultra_writeblock(uint8_t blockNo, uint8_t *blockData) {
|
int mifare_ultra_writeblock(uint8_t blockNo, uint8_t *blockData) {
|
||||||
|
@ -618,11 +618,12 @@ int mifare_ultra_writeblock(uint8_t blockNo, uint8_t *blockData) {
|
||||||
len = mifare_sendcmd(MIFARE_ULC_WRITE, block, sizeof(block), receivedAnswer, receivedAnswerPar, NULL);
|
len = mifare_sendcmd(MIFARE_ULC_WRITE, block, sizeof(block), receivedAnswer, receivedAnswerPar, NULL);
|
||||||
|
|
||||||
if (receivedAnswer[0] != 0x0A) { // 0x0a - ACK
|
if (receivedAnswer[0] != 0x0A) { // 0x0a - ACK
|
||||||
if (g_dbglevel >= DBG_ERROR)
|
if (g_dbglevel >= DBG_INFO) {
|
||||||
Dbprintf("Cmd Send Error: %02x %d", receivedAnswer[0], len);
|
Dbprintf("Cmd Send Error: %02x %d", receivedAnswer[0], len);
|
||||||
return 1;
|
}
|
||||||
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
return 0;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
int mifare_classic_halt_ex(struct Crypto1State *pcs) {
|
int mifare_classic_halt_ex(struct Crypto1State *pcs) {
|
||||||
uint8_t receivedAnswer[4] = {0x00, 0x00, 0x00, 0x00};
|
uint8_t receivedAnswer[4] = {0x00, 0x00, 0x00, 0x00};
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "crypto/libpcrypto.h"
|
#include "crypto/libpcrypto.h"
|
||||||
|
|
||||||
static bool VerboseMode = false;
|
static bool g_verbose_mode = false;
|
||||||
void mfpSetVerboseMode(bool verbose) {
|
void mfpSetVerboseMode(bool verbose) {
|
||||||
VerboseMode = verbose;
|
g_verbose_mode = verbose;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const PlusErrorsElm_t PlusErrors[] = {
|
static const PlusErrorsElm_t PlusErrors[] = {
|
||||||
|
@ -340,12 +340,12 @@ int MifareAuth4(mf4Session_t *mf4session, uint8_t *keyn, uint8_t *key, bool acti
|
||||||
}
|
}
|
||||||
|
|
||||||
static int intExchangeRAW14aPlus(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen) {
|
static int intExchangeRAW14aPlus(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen) {
|
||||||
if (VerboseMode)
|
if (g_verbose_mode)
|
||||||
PrintAndLogEx(INFO, ">>> %s", sprint_hex(datain, datainlen));
|
PrintAndLogEx(INFO, ">>> %s", sprint_hex(datain, datainlen));
|
||||||
|
|
||||||
int res = ExchangeRAW14a(datain, datainlen, activateField, leaveSignalON, dataout, maxdataoutlen, dataoutlen, false);
|
int res = ExchangeRAW14a(datain, datainlen, activateField, leaveSignalON, dataout, maxdataoutlen, dataoutlen, false);
|
||||||
|
|
||||||
if (VerboseMode)
|
if (g_verbose_mode)
|
||||||
PrintAndLogEx(INFO, "<<< %s", sprint_hex(dataout, *dataoutlen));
|
PrintAndLogEx(INFO, "<<< %s", sprint_hex(dataout, *dataoutlen));
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -367,7 +367,7 @@ int MFPCommitPerso(bool activateField, bool leaveSignalON, uint8_t *dataout, int
|
||||||
int MFPReadBlock(mf4Session_t *mf4session, bool plain, uint8_t blockNum, uint8_t blockCount, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen, uint8_t *mac) {
|
int MFPReadBlock(mf4Session_t *mf4session, bool plain, uint8_t blockNum, uint8_t blockCount, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen, uint8_t *mac) {
|
||||||
uint8_t rcmd[4 + 8] = {(plain ? (0x37) : (0x33)), blockNum, 0x00, blockCount};
|
uint8_t rcmd[4 + 8] = {(plain ? (0x37) : (0x33)), blockNum, 0x00, blockCount};
|
||||||
if (!plain && mf4session)
|
if (!plain && mf4session)
|
||||||
CalculateMAC(mf4session, mtypReadCmd, blockNum, blockCount, rcmd, 4, &rcmd[4], VerboseMode);
|
CalculateMAC(mf4session, mtypReadCmd, blockNum, blockCount, rcmd, 4, &rcmd[4], g_verbose_mode);
|
||||||
|
|
||||||
int res = intExchangeRAW14aPlus(rcmd, plain ? 4 : sizeof(rcmd), activateField, leaveSignalON, dataout, maxdataoutlen, dataoutlen);
|
int res = intExchangeRAW14aPlus(rcmd, plain ? 4 : sizeof(rcmd), activateField, leaveSignalON, dataout, maxdataoutlen, dataoutlen);
|
||||||
if (res)
|
if (res)
|
||||||
|
@ -377,7 +377,7 @@ int MFPReadBlock(mf4Session_t *mf4session, bool plain, uint8_t blockNum, uint8_t
|
||||||
mf4session->R_Ctr++;
|
mf4session->R_Ctr++;
|
||||||
|
|
||||||
if (mf4session && mac && *dataoutlen > 11)
|
if (mf4session && mac && *dataoutlen > 11)
|
||||||
CalculateMAC(mf4session, mtypReadResp, blockNum, blockCount, dataout, *dataoutlen - 8 - 2, mac, VerboseMode);
|
CalculateMAC(mf4session, mtypReadResp, blockNum, blockCount, dataout, *dataoutlen - 8 - 2, mac, g_verbose_mode);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ int MFPWriteBlock(mf4Session_t *mf4session, uint8_t blockNum, uint8_t *data, boo
|
||||||
uint8_t rcmd[1 + 2 + 16 + 8] = {0xA3, blockNum, 0x00};
|
uint8_t rcmd[1 + 2 + 16 + 8] = {0xA3, blockNum, 0x00};
|
||||||
memmove(&rcmd[3], data, 16);
|
memmove(&rcmd[3], data, 16);
|
||||||
if (mf4session)
|
if (mf4session)
|
||||||
CalculateMAC(mf4session, mtypWriteCmd, blockNum, 1, rcmd, 19, &rcmd[19], VerboseMode);
|
CalculateMAC(mf4session, mtypWriteCmd, blockNum, 1, rcmd, 19, &rcmd[19], g_verbose_mode);
|
||||||
|
|
||||||
int res = intExchangeRAW14aPlus(rcmd, sizeof(rcmd), activateField, leaveSignalON, dataout, maxdataoutlen, dataoutlen);
|
int res = intExchangeRAW14aPlus(rcmd, sizeof(rcmd), activateField, leaveSignalON, dataout, maxdataoutlen, dataoutlen);
|
||||||
if (res)
|
if (res)
|
||||||
|
@ -396,7 +396,7 @@ int MFPWriteBlock(mf4Session_t *mf4session, uint8_t blockNum, uint8_t *data, boo
|
||||||
mf4session->W_Ctr++;
|
mf4session->W_Ctr++;
|
||||||
|
|
||||||
if (mf4session && mac && *dataoutlen > 3)
|
if (mf4session && mac && *dataoutlen > 3)
|
||||||
CalculateMAC(mf4session, mtypWriteResp, blockNum, 1, dataout, *dataoutlen, mac, VerboseMode);
|
CalculateMAC(mf4session, mtypWriteResp, blockNum, 1, dataout, *dataoutlen, mac, g_verbose_mode);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue