Use the actual UID length to select a target.

Without it, the libfreefare cannot use 4-bytes-long random UIDs of Mifare
DESFire EV1.
This commit is contained in:
Romain Tartiere 2010-10-01 19:32:03 +00:00
parent a77fa7ae4a
commit 93011b4c07

View file

@ -282,7 +282,7 @@ mifare_desfire_connect (MifareTag tag)
ASSERT_MIFARE_DESFIRE (tag); ASSERT_MIFARE_DESFIRE (tag);
nfc_target_info_t pnti; nfc_target_info_t pnti;
if (nfc_initiator_select_passive_target (tag->device, NM_ISO14443A_106, tag->info.abtUid, 7, &pnti)) { if (nfc_initiator_select_passive_target (tag->device, NM_ISO14443A_106, tag->info.abtUid, tag->info.szUidLen, &pnti)) {
tag->active = 1; tag->active = 1;
free (MIFARE_DESFIRE (tag)->session_key); free (MIFARE_DESFIRE (tag)->session_key);
MIFARE_DESFIRE (tag)->session_key = NULL; MIFARE_DESFIRE (tag)->session_key = NULL;