flipperzero-firmware icon indicating copy to clipboard operation
flipperzero-firmware copied to clipboard

NFC: support parsing DESFire, add myki and Opal parsers

Open emilytrau opened this issue 1 year ago • 5 comments

What's new

  • Add DESFire support for NFC card parsers
  • Add parser for myki (Melbourne, Australia) image
  • Add parser for Opal (Sydney, Australia) image

https://user-images.githubusercontent.com/13267947/213913551-d78e3341-86db-45d3-aebd-1883063abb7c.mov

Screenshot-20230122-223331 Screenshot-20230122-223352

Verification

For each of the following cards: NFC -> Saved -> [card] -> Info

myki.nfc opal.nfc

Checklist (For Reviewer)

  • [ ] PR has description of feature/bug or link to Confluence/Jira task
  • [ ] Description contains actions to verify feature/bugfix
  • [ ] I've built this code, uploaded it to the device and verified feature/bugfix

emilytrau avatar Jan 22 '23 11:01 emilytrau

I'm not a maintainer, but I think it's bad idea to read the tag 3 times (mf_df_read_card is called in every parser and in nfc_worker_read_mf_desfire). I think the best option would be to run parsers after reading the tag (mf_df_read_card only in nfc_worker_read_mf_desfire) and if someone need additional data (for example with private keys) they can always read it later. Or you can read applications list in every parser via 0x6A command (MF_DF_GET_APPLICATION_IDS) and then read only required data (not whole tag).

AloneLiberty avatar Jan 24 '23 04:01 AloneLiberty

@AloneLiberty that's a good point. I'll look at implementing that. Thanks!

emilytrau avatar Jan 24 '23 04:01 emilytrau

Hello @emilytrau Thanks for the PR! I don't have these cards but I tested with attached files and everything works fine.

However, I am not sure that we can merge your code right now. Flipper has too little free flash memory left. Your code increases firmware size by 4kB and is useful to relatively small number of users.

The best solution here is to implement all supported NFC cards as a library and store it on SD card. Please, give me some time to think about further steps here.

gornekich avatar Jan 24 '23 21:01 gornekich

@gornekich Yes I agree it would be better if there was a way for parsers to live on the SD card especially as more are added. Would allow for more detail and functionality without impact on flash size. Happy to put this on hold and looking forward to hear about how we could proceed. Thanks!

emilytrau avatar Jan 25 '23 01:01 emilytrau

@emilytrau , I need to estimate how much time it will take to rework all parsers to live on SD card. I will convert your PR to draft and come back next week.

gornekich avatar Jan 27 '23 10:01 gornekich

Hey @gornekich, there hasn't been any news since 7 months ago, is this on hold due to waiting for #2529 to land in Master ?

AkechiShiro avatar Aug 04 '23 13:08 AkechiShiro

@AkechiShiro yes, we are waiting for that PR. Also in branch with refactoring we already added opal parser as a plugin, launching from SD card

gornekich avatar Aug 04 '23 14:08 gornekich

@emilytrau we implemented opal and myki parses as plugins in #3050 . You can update the flipper to the latest release and test it. Thanks a lot for your PR!

gornekich avatar Nov 15 '23 09:11 gornekich

@gornekich thank you!

emilytrau avatar Nov 15 '23 09:11 emilytrau