[Fix/Feature] Implement ISO-DEP Chaining & Integrated EMV Scanning Suite#400
Open
nieldk wants to merge 8 commits intoRfidResearchGroup:mainfrom
Open
[Fix/Feature] Implement ISO-DEP Chaining & Integrated EMV Scanning Suite#400nieldk wants to merge 8 commits intoRfidResearchGroup:mainfrom
nieldk wants to merge 8 commits intoRfidResearchGroup:mainfrom
Conversation
|
You are welcome to add an entry to the CHANGELOG.md as well |
Removed duplicate rc522.h include and adjusted spacing.
Built artifacts for commit 94c1203FirmwareClient |
Contributor
Author
|
To test:
If you just want, short info, just use 'emv scan' |
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.
This PR addresses a critical limitation in the Chameleon Ultra’s NFC-A Level 4 (ISO-DEP) implementation and introduces a complete suite for EMV application scanning and emulation.
Previously, the firmware was unable to reassemble card responses exceeding the 64-byte hardware FIFO, causing truncation during PPSE and Record retrieval. This PR implements R(ACK) chaining and upgrades internal data handling to support large APDUs.
Key Technical Changes
Firmware (C)
• 16-bit Length Support: Upgraded internal response trackers (ppse_rlen, sel_rlen, gpo_rlen, rr_rlen) from uint8_t to uint16_t, removing the 255-byte logical ceiling.
• ISO-DEP Chaining: Added a robust R(ACK) loop to DATA_CMD_HF14A_4_READER_APDU. The firmware now correctly detects the "More Data" bit and requests subsequent blocks until reassembly is complete.
• Buffer Management: Introduced a resp_chain[512] reassembly buffer while maintaining the rbuf[64] window for RC522 hardware FIFO compatibility.
CLI (Python)
• emv scan: Automates the discovery of AIDs and the exhaustive retrieval of public card records.
• emv load: Enables loading captured EMV profiles directly into tag slots for emulation.
• Synchronized Parsing: Updated packet unpacking logic to match the 16-bit little-endian headers provided by the new firmware.
Hardware Performance & Compatibility
• Validated on DevKit: Successfully tested with Visa and Mastercard cards, retrieving full multi-block records that were previously unreachable.
• Standard CU Note: While the software logic is now correct for all models, the standard "small" CU remains physically sensitive to antenna noise during long chains. This PR ensures the software is no longer the bottleneck.
• Compatibility: Adheres strictly to ISO 14443-4. Note: This may impact legacy/non-compliant stacks (e.g., Windows Phone) that do not support extended frame sizes, a necessary trade-off for modern EMV research.