ISSUE-4106: Fix NFC read stuck on Mifare Ultralight when signature read fails (fi…#4353
Draft
herbenderbler wants to merge 2 commits intoflipperdevices:devfrom
Draft
Conversation
…flipperdevices#4106) Treat Read Signature as optional: if the card supports it but the command fails (e.g. FWT timeout), continue to Auth/ReadPages instead of aborting the read. Zero the signature buffer on failure. Unify Auth/AuthMfulC choice in read_signature handler. Made-with: Cursor
beef4d2 to
5c9b8ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's new
This fixes the NFC read getting stuck on
Don't Movefor some ISO 14443-3A Mifare Ultralight / NTAG213 cards when the Read Signature step fails (e.g. FWT timeouts).Why?
On affected cards, version detection succeeds and the tag is identified as NTAG213, but the signature read repeatedly fails. The poller then transitioned to
ReadFailed, so the whole read was aborted and the device kept retrying indefinitely.Changes
mf_ultralight_poller_handler_read_signature, when the card supportsRead Signature, but the read returns an error, it continues the read instead of going toReadFailed:data->signatureso no stale data is storedAuth(orAuthMfulCfor MfulC) so page read and the rest of the flow runs as normalmf_ultralight_poller_handler_read_signature, the choice betweenAuthandAuthMfulCis now made in a single place using asignature_read_okflag, removing the duplicated feature-check logic from the “signature failed” and “skip signature” branches.Verification
Checklist (For Reviewer)