mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
CHG: 'hf mfdes info' : Now checks for 7b uid's. This will remove some faulty claims of tagidentifications.
This commit is contained in:
parent
179748a5df
commit
0c2c6f3fd7
2 changed files with 20 additions and 6 deletions
|
@ -110,7 +110,13 @@ void MifareDesfireGetInformation(){
|
||||||
OnError(1);
|
OnError(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( card.uidlen != 7 ) {
|
||||||
|
if (MF_DBGLEVEL >= MF_DBG_ERROR) Dbprintf("Wrong UID size. Expected 7byte got %d", card.uidlen);
|
||||||
|
OnError(2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(dataout, card.uid, 7);
|
memcpy(dataout, card.uid, 7);
|
||||||
|
|
||||||
LED_A_ON();
|
LED_A_ON();
|
||||||
|
@ -123,7 +129,7 @@ void MifareDesfireGetInformation(){
|
||||||
len = DesfireAPDU(cmd, cmd_len, resp);
|
len = DesfireAPDU(cmd, cmd_len, resp);
|
||||||
if ( !len ) {
|
if ( !len ) {
|
||||||
print_result("ERROR <--: ", resp, len);
|
print_result("ERROR <--: ", resp, len);
|
||||||
OnError(2);
|
OnError(3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +142,7 @@ void MifareDesfireGetInformation(){
|
||||||
len = DesfireAPDU(cmd, cmd_len, resp);
|
len = DesfireAPDU(cmd, cmd_len, resp);
|
||||||
if ( !len ) {
|
if ( !len ) {
|
||||||
print_result("ERROR <--: ", resp, len);
|
print_result("ERROR <--: ", resp, len);
|
||||||
OnError(2);
|
OnError(3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +154,7 @@ void MifareDesfireGetInformation(){
|
||||||
len = DesfireAPDU(cmd, cmd_len, resp);
|
len = DesfireAPDU(cmd, cmd_len, resp);
|
||||||
if ( !len ) {
|
if ( !len ) {
|
||||||
print_result("ERROR <--: ", resp, len);
|
print_result("ERROR <--: ", resp, len);
|
||||||
OnError(2);
|
OnError(3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,7 +437,7 @@ void MifareDES_Auth1(uint8_t mode, uint8_t algo, uint8_t keyno, uint8_t *datain
|
||||||
AesCtx ctx;
|
AesCtx ctx;
|
||||||
if ( AesCtxIni(&ctx, IV, key->data, KEY128, CBC) < 0 ){
|
if ( AesCtxIni(&ctx, IV, key->data, KEY128, CBC) < 0 ){
|
||||||
if( MF_DBGLEVEL >= 4) {
|
if( MF_DBGLEVEL >= 4) {
|
||||||
Dbprintf("AES context failed to init");
|
DbpString("AES context failed to init");
|
||||||
}
|
}
|
||||||
OnError(7);
|
OnError(7);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -145,7 +145,15 @@ int CmdHF14ADesInfo(const char *Cmd){
|
||||||
}
|
}
|
||||||
uint8_t isOK = resp.arg[0] & 0xff;
|
uint8_t isOK = resp.arg[0] & 0xff;
|
||||||
if ( !isOK ){
|
if ( !isOK ){
|
||||||
PrintAndLog("Command unsuccessful");
|
switch ( resp.arg[1] ) {
|
||||||
|
case 1:
|
||||||
|
PrintAndLog("Can't select card"); break;
|
||||||
|
case 2:
|
||||||
|
PrintAndLog("Card is most likely not Desfire. Its UID has wrong size"); break;
|
||||||
|
case 3:
|
||||||
|
default:
|
||||||
|
PrintAndLog("Command unsuccessful"); break;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
PrintAndLog("");
|
PrintAndLog("");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue