Skip to content

ncry v3: keep response limit out of legacy sessions - #65

Merged
doc-hex merged 1 commit into
Coldcard:masterfrom
scgbckbone:fix/ncry-v3-response-limit
Aug 19, 2026
Merged

ncry v3: keep response limit out of legacy sessions#65
doc-hex merged 1 commit into
Coldcard:masterfrom
scgbckbone:fix/ncry-v3-response-limit

Conversation

@scgbckbone

Copy link
Copy Markdown
Contributor

Summary

  • enforce the HID response-size limit only for ncry v3
  • restore the historical v1/v2 response behavior
  • remove the legacy-overlong rejection test; v3 rejection coverage remains

Rationale

MAX_MSG_LEN historically bounds requests, not legacy responses. Applying it to v1/v2 rejected larger simulator/debug responses and left unread HID fragments queued, cascading into framing errors. The authenticated v3 path retains its strict wire-size limit and terminal failure behavior.

An end-to-end v3 overlong-response test is included in Coldcard/firmware#759.

Tests

python -m pytest tests/test_usb_ncry.py -k ncry_v3

12 passed, 4 deselected.

@doc-hex
doc-hex merged commit c39db29 into Coldcard:master Aug 19, 2026
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.

2 participants