pn532: bump InListPassiveTarget response_length to 64 to handle long ATS #70
      
        
          +1
        
        
          −1
        
        
          
        
      
    
  
  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.