Merge pull request #138 from AlexandreFenyo/patch-2
support of a new ATS for DESFire EV1 on JCOP3
This commit is contained in:
commit
c2b0cfa4b9
1 changed files with 8 additions and 6 deletions
|
@ -271,19 +271,21 @@ le24toh(uint8_t data[3])
|
||||||
bool
|
bool
|
||||||
mifare_desfire_taste(nfc_device *device, nfc_target target)
|
mifare_desfire_taste(nfc_device *device, nfc_target target)
|
||||||
{
|
{
|
||||||
// We have two different ATS prefixes to
|
// We have three different ATS prefixes to
|
||||||
// check for, standalone and JCOP.
|
// check for, standalone, JCOP and JCOP3.
|
||||||
static const char STANDALONE_DESFIRE[] = { 0x75, 0x77, 0x81, 0x02 };
|
static const char STANDALONE_DESFIRE[] = { 0x75, 0x77, 0x81, 0x02 };
|
||||||
static const char JCOP_DESFIRE[] = { 0x75, 0xf7, 0xb1, 0x02 };
|
static const char JCOP_DESFIRE[] = { 0x75, 0xf7, 0xb1, 0x02 };
|
||||||
|
static const char JCOP3_DESFIRE[] = { 0x78, 0x77, 0x71, 0x02 };
|
||||||
|
|
||||||
(void) device;
|
(void) device;
|
||||||
|
|
||||||
return target.nm.nmt == NMT_ISO14443A &&
|
return target.nm.nmt == NMT_ISO14443A &&
|
||||||
target.nti.nai.btSak == 0x20 &&
|
target.nti.nai.btSak == 0x20 && ((
|
||||||
target.nti.nai.szAtsLen >= 5 && (
|
target.nti.nai.szAtsLen >= 5 && (
|
||||||
memcmp(target.nti.nai.abtAts, STANDALONE_DESFIRE, sizeof(STANDALONE_DESFIRE)) == 0 ||
|
memcmp(target.nti.nai.abtAts, STANDALONE_DESFIRE, sizeof(STANDALONE_DESFIRE)) == 0 ||
|
||||||
memcmp(target.nti.nai.abtAts, JCOP_DESFIRE, sizeof(JCOP_DESFIRE)) == 0
|
memcmp(target.nti.nai.abtAts, JCOP_DESFIRE, sizeof(JCOP_DESFIRE)) == 0))
|
||||||
);
|
|| (target.nti.nai.szAtsLen == 4 &&
|
||||||
|
memcmp(target.nti.nai.abtAts, JCOP3_DESFIRE, sizeof(JCOP3_DESFIRE)) == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue