mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
fix info, add there desfire light tests
This commit is contained in:
parent
4bf3c43c7f
commit
81343f0ec1
2 changed files with 14 additions and 11 deletions
|
@ -688,15 +688,20 @@ static int CmdHF14ADesInfo(const char *Cmd) {
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(INFO, "--- " _CYAN_("Desfire Light info"));
|
PrintAndLogEx(INFO, "--- " _CYAN_("Desfire Light info"));
|
||||||
|
|
||||||
if (DesfireSelect(&dctx, ISWIsoID, 0xdf01, NULL) == PM3_SUCCESS)
|
if (DesfireSelect(&dctx, ISWIsoID, 0xdf01, NULL) == PM3_SUCCESS) {
|
||||||
PrintAndLogEx(SUCCESS, " Card have " _GREEN_("default (0xdf01)") " iso id for application");
|
PrintAndLogEx(SUCCESS, " Card have " _GREEN_("default (0xdf01)") " iso id for application");
|
||||||
else
|
|
||||||
PrintAndLogEx(SUCCESS, " Card have " _RED_("not a default") " iso id for application");
|
|
||||||
|
|
||||||
if (DesfireCheckAuthCmd(ISWIsoID, 0x3f00, 1, MFDES_AUTHENTICATE_EV2F, false)) {
|
if (DesfireCheckAuthCmd(ISWIsoID, 0xdf01, 0, MFDES_AUTHENTICATE_EV2F, false)) {
|
||||||
PrintAndLogEx(SUCCESS, " Card in the " _GREEN_("AES") " mode");
|
PrintAndLogEx(SUCCESS, " Card in the " _GREEN_("AES") " mode");
|
||||||
} else if (DesfireCheckAuthCmd(ISWIsoID, 0x3f00, 1, MFDES_AUTHENTICATE_EV2F, true)) {
|
} else if (DesfireCheckAuthCmd(ISWIsoID, 0xdf01, 0, MFDES_AUTHENTICATE_EV2F, true)) {
|
||||||
PrintAndLogEx(SUCCESS, " Card in the " _GREEN_("LRP") " mode");
|
PrintAndLogEx(SUCCESS, " Card in the " _GREEN_("LRP") " mode");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
PrintAndLogEx(SUCCESS, " Card have " _RED_("not a default") " iso id for application");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DesfireCheckAuthCmd(ISWIsoID, 0x3f00, 1, MFDES_AUTHENTICATE_EV2F, true)) {
|
||||||
|
PrintAndLogEx(SUCCESS, " Card have " _GREEN_("LRP") " key in the MF/key1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1579,7 +1579,7 @@ bool DesfireCheckAuthCmd(DesfireISOSelectWay way, uint32_t appID, uint8_t keyNum
|
||||||
DesfireContext_t dctx = {0};
|
DesfireContext_t dctx = {0};
|
||||||
dctx.keyNum = keyNum;
|
dctx.keyNum = keyNum;
|
||||||
dctx.commMode = DCMPlain;
|
dctx.commMode = DCMPlain;
|
||||||
dctx.cmdSet = (checklrp) ? DCCNativeISO : DCCNative;
|
dctx.cmdSet = (checklrp || way != ISW6bAID) ? DCCNativeISO : DCCNative;
|
||||||
|
|
||||||
// if cant select - return false
|
// if cant select - return false
|
||||||
int res = DesfireSelect(&dctx, way, appID, NULL);
|
int res = DesfireSelect(&dctx, way, appID, NULL);
|
||||||
|
@ -1587,9 +1587,7 @@ bool DesfireCheckAuthCmd(DesfireISOSelectWay way, uint32_t appID, uint8_t keyNum
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint8_t data[] = {keyNum, 0x01, (checklrp) ? 0x02 : 0x00};
|
uint8_t data[] = {keyNum, 0x01, (checklrp) ? 0x02 : 0x00};
|
||||||
uint8_t datalen = (authcmd == MFDES_AUTHENTICATE_EV2F) ? 2 : 1;
|
uint8_t datalen = (authcmd == MFDES_AUTHENTICATE_EV2F) ? 3 : 1;
|
||||||
if (checklrp)
|
|
||||||
datalen = 3;
|
|
||||||
res = DesfireExchangeEx(false, &dctx, authcmd, data, datalen, &respcode, recv_data, &recv_len, false, 0);
|
res = DesfireExchangeEx(false, &dctx, authcmd, data, datalen, &respcode, recv_data, &recv_len, false, 0);
|
||||||
DropField();
|
DropField();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue