Skip to content

fix(misc): PCAP-NG ZigBee keys hand-roll a short-read record #2688

Closed

Description

@JarryShaw

Found by the short-read audit, and confirmed by an independent re-probe. zigbee_key_held in the PCAP-NG schema module (used by PCAPNG._make_secrets_zigbee_nwk and _make_secrets_zigbee_aps) pads Secrets Data to the key's fixed width with ljust. It unpacks the padded octets, then walks the fixed fields and writes __short_read__ by hand for the first field the data ends inside. That duplicates Schema._note_short_read.

Fix:

  • Drop the ljust and the hand-written loop.
  • Unpack the held octets as they are, with a declared length so that empty Secrets Data does not raise StreamEOFError.
  • Let the built-in record the cut.
  • Discard the already-reported short-read SchemaWarning through hold_warnings, not a warnings filter.

Round trips at every cut must stay exact.

Activity

  1. added this to the PyPCAPKit v1.6 milestone on Nov 2, 2026
  2. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    on Nov 2, 2026
  3. moved this to Pending in PyPCAPKiton Nov 2, 2026
  4. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    Filed from the short-read audit, and confirmed by an independent re-probe. A worker is on it now. Moved to wip.

  5. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 2, 2026
  6. moved this from Pending to WIP in PyPCAPKiton Nov 2, 2026
  7. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    The fix is pushed as branch fix/2688-zigbee-key-short-read (983a5c6df). Opening its PR is held because the Actions queue is at 24; new PRs wait for fewer than 20. A Sonnet review runs on the branch in the meantime.

  8. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    The PR is #2697.

  9. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions