Revert to MF_DBG_ERROR level in mifare_classic_halt() and don't issue the halt command for gen1b

This commit is contained in:
Fl0-0 2017-07-12 08:36:08 +02:00
commit 8004437b42
2 changed files with 101 additions and 96 deletions

View file

@ -1281,11 +1281,14 @@ void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
}; };
if (workFlags & 0x04) { if (workFlags & 0x04) {
if (mifare_classic_halt(NULL, cuid)) { // do no issue halt command for gen1b magic tag (#db# halt error. response len: 1)
if (MF_DBGLEVEL > 2) Dbprintf("Halt error"); if (!(workFlags & 0x40)) {
// Continue, some magic tags misbehavies and send an answer to it. if (mifare_classic_halt(NULL, cuid)) {
// break; if (MF_DBGLEVEL > 2) Dbprintf("Halt error");
}; // Continue, some magic tags misbehavies and send an answer to it.
// break;
}
}
} }
isOK = 1; isOK = 1;
@ -1362,11 +1365,14 @@ void MifareCGetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
memcpy(data, receivedAnswer, 18); memcpy(data, receivedAnswer, 18);
if (workFlags & 0x04) { if (workFlags & 0x04) {
if (mifare_classic_halt(NULL, cuid)) { // do no issue halt command for gen1b magic tag (#db# halt error. response len: 1)
if (MF_DBGLEVEL > 2) Dbprintf("Halt error"); if (!(workFlags & 0x40)) {
// Continue, some magic tags misbehavies and send an answer to it. if (mifare_classic_halt(NULL, cuid)) {
// break; if (MF_DBGLEVEL > 1) Dbprintf("Halt error");
}; // Continue, some magic tags misbehavies and send an answer to it.
// break;
}
}
} }
isOK = 1; isOK = 1;

View file

@ -511,8 +511,7 @@ int mifare_classic_halt(struct Crypto1State *pcs, uint32_t uid)
len = mifare_sendcmd_short(pcs, pcs == NULL ? false:true, 0x50, 0x00, receivedAnswer, receivedAnswerPar, NULL); len = mifare_sendcmd_short(pcs, pcs == NULL ? false:true, 0x50, 0x00, receivedAnswer, receivedAnswerPar, NULL);
if (len != 0) { if (len != 0) {
// change from MF_DBG_ERROR to MF_DBG_ALL, to much halt error for moagic tags if (MF_DBGLEVEL >= MF_DBG_ERROR)
if (MF_DBGLEVEL > MF_DBG_ALL)
Dbprintf("halt error. response len: %x", len); Dbprintf("halt error. response len: %x", len);
return 1; return 1;
} }