Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFC: support parsing DESFire, add myki and Opal parsers #2326

Closed
wants to merge 3 commits into from

Conversation

emilytrau
Copy link
Contributor

What's new

  • Add DESFire support for NFC card parsers
  • Add parser for myki (Melbourne, Australia) image
  • Add parser for Opal (Sydney, Australia) image
IMG_1211.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

furi_assert(nfc_worker);
MifareDesfireData* data = &nfc_worker->dev_data->mf_df_data;

if(!furi_hal_nfc_detect(&nfc_worker->dev_data->nfc_data, 300)) return false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure why this extra operation is needed compared to ultralight, but the card fails to read successfully without it. Would anyone be able to shine some light on this?

@AloneLiberty
Copy link
Contributor

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).

@emilytrau
Copy link
Contributor Author

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

@skotopes skotopes added NFC NFC-related New Feature Contains an IMPLEMENTATION of a new feature labels Jan 24, 2023
@gornekich
Copy link
Member

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.

@emilytrau
Copy link
Contributor Author

@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!

@gornekich
Copy link
Member

@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 gornekich marked this pull request as draft January 27, 2023 10:26
@AkechiShiro
Copy link

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 ?

@gornekich
Copy link
Member

@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
Copy link
Member

@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 gornekich closed this Nov 15, 2023
@emilytrau
Copy link
Contributor Author

@gornekich thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature Contains an IMPLEMENTATION of a new feature NFC NFC-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants