nfc-tools / libfreefare

A convenience API for NFC cards manipulations on top of libnfc.
Other
395 stars 106 forks source link

DESFire key diversification - problem with random UID #144

Open ledvinap opened 1 year ago

ledvinap commented 1 year ago

mifare_key_deriver_update_uid is trying to get actual UID when key diversification is enabled (mifare_desfire_get_card_uid_raw), but it does not update UID length. Only 4 bytes of UID are stored in diversification input as a result https://github.com/nfc-tools/libfreefare/blob/master/libfreefare/mifare_key_deriver.c#L148-L161