flipperdevices / flipperzero-firmware

Flipper Zero firmware source code
https://flipperzero.one
GNU General Public License v3.0
12.95k stars 2.74k forks source link

Problem reading stored DESFire card #1430

Closed FlorianTopf closed 2 years ago

FlorianTopf commented 2 years ago

Describe the bug I was reading a NFC card which Flipper (FW 0.62.1) detected as DESFire type. I was able to read the tag and I also ran the compatible app successfully. I can have a look at some data in the following view and I am able to save. However when I want to load the saved data I get an error screen saying that the file can not be parsed. (see screenshots)

IMG_1004

IMG_1005

IMG_1006

To Reproduce The content of the supposedly corrupt file is as follows:

Filetype: Flipper NFC device
Version: 2
# Nfc device type can be UID, Mifare Ultralight, Mifare Classic, Bank card
Device type: Mifare DESFire
# UID, ATQA and SAK are common for all formats
UID: 04 8B 37 FA F3 39 80
ATQA: 44 03
SAK: 20
# Mifare DESFire specific data
PICC Version: 04 01 01 01 00 16 05 04 01 01 01 04 16 05 04 8B 37 FA F3 39 80 BA 54 90 DB 80 21 14
PICC Free Memory: 1856
PICC Change Key ID: 00
PICC Config Changeable: true
PICC Free Create Delete: true
PICC Free Directory List: true
PICC Key Changeable: true
PICC Max Keys: 01
PICC Key 0 Version: 00
Application Count: 1
Application IDs: 01 60 C2

I was asking around on Discord #NFC and after being suggested I tried several other NFCs to read, store and load, all of which have been successfully. I also swapped the SD card to another just to be sure. Same issue. Unfortunately however, I don't have another DESFire card to test.

Expected behavior I expect the saved data to be loadable to the point where I can see the card data just like I saw it when running the compatible app.

Logs This is what I saw in the debug logs during reading and saving:

66916146 [D][NfcWorker]: Found DESFire tag
66916188 [W][NfcWorker]: Bad DESFire GET_KEY_SETTINGS response
66916191 [D][DolphinState]: icounter 108, butthurt 0
66936545 [D][ViewDispatcher]: View changed while key press 0x20011de0 -> 0x200147e0. Sending key: Back, type: Release, sequence: 0x1ab to previous view port
66941700 [D][DolphinState]: icounter 108, butthurt 0
66947148 [D][BrowserWorker]: Start
66947165 [D][BrowserWorker]: Enter folder: /any/nfc items: 14 idx: -1
66947167 [D][BrowserWorker]: Load offset: 0 cnt: 100
66948939 [D][BrowserWorker]: End
skotopes commented 2 years ago

Please check latest release and reopen if issue persist.