pn532: bump InListPassiveTarget response_length to 64 to handle long ATS - #70
Merged
Merged
Conversation
FoamyGuy
approved these changes
Jan 14, 2026
FoamyGuy
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me, Thank you!
adafruit-adabot
pushed a commit
to adafruit/Adafruit_CircuitPython_Bundle
that referenced
this pull request
Jan 15, 2026
Updating https://github.com/adafruit/Adafruit_CircuitPython_PN532 to 2.4.7 from 2.4.6: > Merge pull request adafruit/Adafruit_CircuitPython_PN532#70 from gdudek/fix/long-ats-buffer Updating https://github.com/adafruit/Adafruit_CircuitPython_RA8875 to 3.1.27 from 3.1.26: > Merge pull request adafruit/Adafruit_CircuitPython_RA8875#32 from LoganCarter08/main Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 3.5.0 from 3.4.3: > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#118 from relic-se/chunked-transfer-encoding
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.
pn532: bump InListPassiveTarget response_length to 64 to handle long ATS
Some ISO14443-A/EMV cards return longer ATS in the 0x4A response.
The previous 30–44 byte bound can truncate and trigger checksum errors.
Using 64 provides safe headroom with no behavior change for shorter replies.
What changed
In get_passive_target() (106A path), increase:
response_length=30
to:
response_length=64
Rationale
call_function(..., response_length=N) is an upper bound, not a strict size. Longer ATS payloads (ATSLen + ATS) can push total reply length past 30–44 bytes; truncation leads to the checksum mismatch. Using 64 is conservative and low-risk. A value of 44 works well for me and fixed the error I was seeing, but I used 64 for future-proofing.
Backwards compatibility / risk
Very low. Only increases the allowed maximum response size for a single command; no API changes.