Skip to content

fix(pcapng): a malformed TLS key-log line in a Decryption Secrets Block aborts extraction #1985

Closed

Description

@JarryShaw

In a well-sized Decryption Secrets Block whose TLS key log has a malformed line that is not the last line, the whole extract aborts.

  • Repro (on main): build SHB + IDB + EPB, then a TLS DSB whose secrets are b'NOT_A_LABEL aa bb\n' followed by one valid CLIENT_RANDOM <64 hex> <96 hex> line, then an EPB.
  • Result: FieldValueError: invalid TLS key log format: 'NOT_A_LABEL aa bb', raised from TLSKeyLog.post_process via Schema.unpack. CLIENT_RANDOM zz yy, or a garbage line in the middle of the log, fails the same way.
  • Contrast: after fix(pcapng): cap a Decryption Secrets Block's secrets at its block (#1980) #1983, a key log cut short by its block drops the partial last line and keeps the rest.

Fix: warn about a malformed key-log line and keep it as captured, rather than aborting. The complete entries and every frame should survive. The rebuilt block must stay byte-exact.

Found while reviewing #1983 (#1980).

Activity

  1. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    fixPull requests that fix a defect (fix: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 20, 2026
  2. JarryShaw commented on Oct 20, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1983 merges. The key-log parsing it changes sits next to #1983's DSB secrets cap.

  3. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 20, 2026
  4. moved this to Blocked in PyPCAPKiton Oct 20, 2026
  5. JarryShaw commented on Oct 20, 2026

    @JarryShaw
    OwnerAuthor

    A related case: a TLS key log whose cut last line still fits within the pad (declared 186 over 185 held) is not an overrun. The partial line then raises FieldValueError at parse. The fix here should cover it, so a malformed or cut line anywhere warns and is kept.

  6. JarryShaw commented on Oct 20, 2026

    @JarryShaw
    OwnerAuthor

    #1983 has merged, so this is unblocked. A worker has started.

  7. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 20, 2026
  8. moved this from Blocked to WIP in PyPCAPKiton Oct 20, 2026
  9. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 20, 2026
  10. added this to the PyPCAPKit v1.5 milestone on Oct 26, 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)fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions