diff --git a/armsrc/mifaredesfire.c b/armsrc/mifaredesfire.c index d0cb34193..eedbb06cc 100644 --- a/armsrc/mifaredesfire.c +++ b/armsrc/mifaredesfire.c @@ -334,12 +334,17 @@ void MifareDES_Auth1(uint8_t *datain) { return; } + int rndlen=8; int expectedlen = 1 + 8 + 2 + 2; if (payload->algo == MFDES_ALGO_AES || payload->algo == MFDES_ALGO_3K3DES) { expectedlen = 1 + 16 + 2 + 2; + rndlen=16; } - int rndlen = len - 1 - 2 - 2; + if (payload->mode == MFDES_AUTH_PICC) { + expectedlen = 1 + 1 + 8 + 2; + rndlen=8; + } if (len != expectedlen) { if (DBGLEVEL >= DBG_ERROR) { diff --git a/client/cmdhfmfdes.c b/client/cmdhfmfdes.c index 66e5e9b00..63755fe65 100644 --- a/client/cmdhfmfdes.c +++ b/client/cmdhfmfdes.c @@ -1664,7 +1664,6 @@ static int CmdHF14ADesCreateStdFile(const char *Cmd) { } mfdes_file_t ft; - bool usefid = true; memcpy(ft.fid, fid, 2); memcpy(ft.filesize, filesize, 3); ft.fileno = fileno; @@ -2347,6 +2346,9 @@ static command_t CommandTable[] = { '88' Internal Authenticate '82' External Authenticate + Write Data: + 90 3d 00 00 16 01 00 00 00 0f 00 00 00 0f 20 00 3b 00 34 04 06 e1 04 0f fe 00 00 00 + 90 3d 00 00 09 02 00 00 00 02 00 00 00 00 00 */ {NULL, NULL, NULL, NULL} };