mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -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(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");
|
||||
else
|
||||
PrintAndLogEx(SUCCESS, " Card have " _RED_("not a default") " iso id for application");
|
||||
|
||||
if (DesfireCheckAuthCmd(ISWIsoID, 0x3f00, 1, MFDES_AUTHENTICATE_EV2F, false)) {
|
||||
PrintAndLogEx(SUCCESS, " Card in the " _GREEN_("AES") " mode");
|
||||
} else if (DesfireCheckAuthCmd(ISWIsoID, 0x3f00, 1, MFDES_AUTHENTICATE_EV2F, true)) {
|
||||
PrintAndLogEx(SUCCESS, " Card in the " _GREEN_("LRP") " mode");
|
||||
if (DesfireCheckAuthCmd(ISWIsoID, 0xdf01, 0, MFDES_AUTHENTICATE_EV2F, false)) {
|
||||
PrintAndLogEx(SUCCESS, " Card in the " _GREEN_("AES") " mode");
|
||||
} else if (DesfireCheckAuthCmd(ISWIsoID, 0xdf01, 0, MFDES_AUTHENTICATE_EV2F, true)) {
|
||||
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};
|
||||
dctx.keyNum = keyNum;
|
||||
dctx.commMode = DCMPlain;
|
||||
dctx.cmdSet = (checklrp) ? DCCNativeISO : DCCNative;
|
||||
dctx.cmdSet = (checklrp || way != ISW6bAID) ? DCCNativeISO : DCCNative;
|
||||
|
||||
// if cant select - return false
|
||||
int res = DesfireSelect(&dctx, way, appID, NULL);
|
||||
|
@ -1587,9 +1587,7 @@ bool DesfireCheckAuthCmd(DesfireISOSelectWay way, uint32_t appID, uint8_t keyNum
|
|||
return false;
|
||||
|
||||
uint8_t data[] = {keyNum, 0x01, (checklrp) ? 0x02 : 0x00};
|
||||
uint8_t datalen = (authcmd == MFDES_AUTHENTICATE_EV2F) ? 2 : 1;
|
||||
if (checklrp)
|
||||
datalen = 3;
|
||||
uint8_t datalen = (authcmd == MFDES_AUTHENTICATE_EV2F) ? 3 : 1;
|
||||
res = DesfireExchangeEx(false, &dctx, authcmd, data, datalen, &respcode, recv_data, &recv_len, false, 0);
|
||||
DropField();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue