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: Fix Mifare DESFire reading #757

Closed
wants to merge 1 commit into from

Conversation

Willy-JL
Copy link
Contributor

@Willy-JL Willy-JL commented May 28, 2024

What's new

  • Previous fix for EMV read crash in 75ece9b caused DESFire to never read
  • Was comparing sizes of same buffer, and also logic should have compared size and capacity, destination buffer is always empty in beginning so size is 0
  • Changed check to use same parameters as the furi_check()s that cause the crash in this original bugfix from 75ece9b
  • Fixes [NFC] DESfire Reading: Success on OFW, Fail on Unlshd #756

Verification

  • Read any Mifare DESFire card
  • Read EMV cards that used to cause crashes before 75ece9b

Checklist (For Reviewer)

  • PR has description of feature/bug
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@Willy-JL Willy-JL requested a review from xMasterX as a code owner May 28, 2024 04:59
@Willy-JL
Copy link
Contributor Author

cc @Leptopt1los for

Read EMV cards that used to cause crashes before 75ece9b

@Leptopt1los
Copy link
Member

hi @Willy-JL! sorry for delay. i tested this PR and unfortunately it beaks emv read. i tried to come to a different solution again, but today my buggy emv card died. i will order new one. will ping you here when i get it, ok?

@Willy-JL
Copy link
Contributor Author

Willy-JL commented Jun 5, 2024

Sounds good to me! I think it's worth noting that some emv card do still read with this PR, it seems to be an exception rather than the rule with the one you had. It might be worth considering merging as a temporary fix since the trade-off is no desfire at all, or only some emv cards break, but that decision is for your team to make. I'll gladly try to find the root cause when you receive the new card :D

@xMasterX
Copy link
Member

xMasterX commented Jun 5, 2024

Sounds good to me! I think it's worth noting that some emv card do still read with this PR, it seems to be an exception rather than the rule with the one you had. It might be worth considering merging as a temporary fix since the trade-off is no desfire at all, or only some emv cards break, but that decision is for your team to make. I'll gladly try to find the root cause when you receive the new card :D

Since we are currently in situation when we have options

  • Break desfire
  • Break emv (when this PR is merged) (@Leptopt1los haven't explained that this fix actually breaks reading all of his cards)
  • and return all to previous state where we had paritally broken emv reader (some cards only)
    and have desfire working at same time

I chosen 3rd option and did this
1db05ed

Ill keep PR open until we found solution to fully fix that, which is impossible without test card at the moment sadly

@xMasterX xMasterX marked this pull request as draft June 9, 2024 22:35
@Willy-JL
Copy link
Contributor Author

no longer required, fixed by 180d1f0

@Willy-JL Willy-JL closed this Oct 22, 2024
@Willy-JL Willy-JL deleted the fix-mf-desfire branch October 22, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NFC] DESfire Reading: Success on OFW, Fail on Unlshd
4 participants