mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
MifareFesFireGetInformation(): warningw when tag answer is too short
This commit is contained in:
parent
8a1cb4e8bf
commit
fc4e912fc1
1 changed files with 19 additions and 0 deletions
|
@ -182,6 +182,12 @@ void MifareDesfireGetInformation(void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (len < sizeof(payload.versionHW)+1) {
|
||||||
|
Dbprintf("Tag answer to MFDES_GET_VERSION was too short: data in Hardware Information is probably invalid.");
|
||||||
|
print_result("Answer", resp, len);
|
||||||
|
memset(resp+len, 0xFF, sizeof(payload.versionHW)+1 - len); // clear remaining bytes
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(payload.versionHW, resp + 1, sizeof(payload.versionHW));
|
memcpy(payload.versionHW, resp + 1, sizeof(payload.versionHW));
|
||||||
|
|
||||||
// ADDITION_FRAME 1
|
// ADDITION_FRAME 1
|
||||||
|
@ -194,6 +200,13 @@ void MifareDesfireGetInformation(void) {
|
||||||
switch_off();
|
switch_off();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (len < sizeof(payload.versionSW)+1) {
|
||||||
|
Dbprintf("Tag answer to MFDES_ADDITIONAL_FRAME 1 was too short: data in Software Information is probably invalid.");
|
||||||
|
print_result("Answer", resp, len);
|
||||||
|
memset(resp+len, 0xFF, sizeof(payload.versionSW)+1 - len); // clear remaining bytes
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(payload.versionSW, resp + 1, sizeof(payload.versionSW));
|
memcpy(payload.versionSW, resp + 1, sizeof(payload.versionSW));
|
||||||
|
|
||||||
// ADDITION_FRAME 2
|
// ADDITION_FRAME 2
|
||||||
|
@ -206,6 +219,12 @@ void MifareDesfireGetInformation(void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (len < sizeof(payload.details)+1) {
|
||||||
|
Dbprintf("Tag answer to MFDES_ADDITIONAL_FRAME 2 was too short: data in Batch number and Production date is probably invalid");
|
||||||
|
print_result("Answer", resp, len);
|
||||||
|
memset(resp+len, 0xFF, sizeof(payload.details)+1 - len); // clear remaining bytes
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(payload.details, resp + 1, sizeof(payload.details));
|
memcpy(payload.details, resp + 1, sizeof(payload.details));
|
||||||
|
|
||||||
LED_B_ON();
|
LED_B_ON();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue