diff --git a/libfreefare/freefare.c b/libfreefare/freefare.c index bd1b380..2e17db8 100644 --- a/libfreefare/freefare.c +++ b/libfreefare/freefare.c @@ -28,11 +28,14 @@ #define NXP_MANUFACTURER_CODE 0x04 +/* Number of bytes of ATS to compare */ +#define ATS_LENGTH 4 + struct supported_tag supported_tags[] = { { CLASSIC_1K, "Mifare Classic 1k", 0x08, 0, { 0x00 } }, { CLASSIC_4K, "Mifare Classic 4k", 0x18, 0, { 0x00 } }, { CLASSIC_4K, "Mifare Classic 4k (Emulated)", 0x38, 0, { 0x00 } }, - { DESFIRE, "Mifare DESFire", 0x20, 5, { 0x75, 0x77, 0x81, 0x02, 0x80 }}, + { DESFIRE, "Mifare DESFire", 0x20, 5, { 0x75, 0x77, 0x81, 0x02 /*, 0xXX */ }}, { ULTRALIGHT, "Mifare UltraLight", 0x00, 0, { 0x00 } }, }; @@ -51,7 +54,7 @@ freefare_tag_new (nfc_device_t *device, nfc_iso14443a_info_t nai) if (((nai.szUidLen == 4) || (nai.abtUid[0] == NXP_MANUFACTURER_CODE)) && (nai.btSak == supported_tags[i].SAK) && (nai.szAtsLen == supported_tags[i].ATS_length) && - (0 == memcmp (nai.abtAts, supported_tags[i].ATS, supported_tags[i].ATS_length))) { + (0 == memcmp (nai.abtAts, supported_tags[i].ATS, ATS_LENGTH))) { tag_info = &(supported_tags[i]); found = true;