Skip to content

fix(misc): PCAP-NG secrets blocks rebuilt from a dict lose their captured octets #2698

Closed

Description

@JarryShaw

Found while reviewing the #2688 fix, and confirmed by a Sonnet cross-review. It is independent of that change. Rebuilding a PCAP-NG Decryption Secrets Block from a plain dict, PCAPNG.from_data(parsed.info.to_dict(), …), does not give back the captured block:

  • ZigBee NWK/APS keys: the rebuild differs on every count except the exact key width. Through the dict path, _make_secrets_zigbee_nwk/_aps get secrets=None, with data, nwk_key and pan_id in **kwargs. They ignore data and write the zero-padded key.
  • TLS key log: from_data(info) is exact, but from_data(info.to_dict()) on CLIENT_RANDOM 00112233 aabbccdd\n gains a # generated by PyPCAPKit line and trailing octets.

Every round trip must match, so the dict path has to rebuild the octets as captured, as the model path does.

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. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    The host load has cleared, so a worker is on it now. Moved to wip.

  4. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 2, 2026
  5. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    The fix is ready at b5a4c11f0. Its PR is held while the Actions queue is at 39; new PRs open once it is below 20. A Sonnet review is running on the local commit in the meantime.

  6. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    The PR is #2707.

  7. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 3, 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