Skip to content

Audit round 3: ST/TOT/SAT-PID wire fixes, CRC-8 HEM cleanup, reassembler resync#3

Merged
fishloa merged 1 commit into
mainfrom
audit-round-3-fixes
Jun 4, 2026
Merged

Audit round 3: ST/TOT/SAT-PID wire fixes, CRC-8 HEM cleanup, reassembler resync#3
fishloa merged 1 commit into
mainfrom
audit-round-3-fixes

Conversation

@fishloa
Copy link
Copy Markdown
Owner

@fishloa fishloa commented Jun 4, 2026

Third full adversarial audit (4 parallel auditors). All previously-fixed areas held; new findings fixed here — the notable wire-level ones verified against the vendored PDFs first:

  • ST rejected non-zero stuffing; §5.2.8 prose: data_byte 'may take any value and has no meaning'
  • TOT serialized SSI=1; §5.2.6 prose: 'shall be set to 0b0' (the SSI=0-with-CRC exception)
  • SAT PID was 0x0010; EN 300 468 Table 1 says 0x001B
  • bbframe 'HEM CRC-8 init=0xB5' was a length-9 coincidence — replaced with the spec's crc8 XOR MODE; unreachable Crc8Mismatch removed
  • T2-MI reassembler now treats pointer_field as authoritative (corrupt-length resync)

Plus: CAT round-trip preservation, CIT length-field desync removal, BAT CRC-contract consistency, dead smallvec/rayon features removed, serde test coverage completed across all three crates, docs.rs metadata, and a tail of doc-cite fixes.

🤖 Generated with Claude Code

…assembler resync

Verified against the vendored PDFs before changing tested code.

dvb-si tables:
- St: accept any data_byte per §5.2.8 PDF prose ('may take any value and has
  no meaning') — was rejecting real-world 0xFF stuffing fill
- Tot: serialize SSI=0 per §5.2.6 PDF prose ('shall be set to 0b0'; the TOT
  exception — SSI=0 yet CRC_32 present); doc warning re Section short-form path
- Sat: PID 0x0010 → 0x001B (EN 300 468 Table 1); pid::well_known::SAT added
- Cat: keep descriptor loop raw for round-trip; ca_descriptors() typed view
- Cit: drop desyncable prepend_strings_length (derived, guarded ≤255)
- Bat: drop lone in-parse CRC verify — Section::validate_crc owns CRC
- Nit/Bat: need/have swapped in per-entry BufferTooShort
- dsmcc: document SSI/short-form limitation

dvb-si descriptors/docs:
- §-cites: bouquet_name 6.2.6, network_name 6.2.28, parental_rating 6.2.30,
  service_list 6.2.36, stream_identifier 6.2.41
- descriptors/mod.rs: doc no longer overstates the Descriptor enum (4 typed
  variants, not a full dispatcher); stale design-doc path removed
- remove dead smallvec/rayon features (advertised, never implemented)
- README dep snippet uses dash crate name; SDT example self-contained

dvb-bbframe:
- remove fictitious 'HEM CRC-8 init=0xB5' (length-9 coincidence): parse now
  uses the §5.1.7 formula crc8 XOR MODE; Crc8Mismatch variant was unreachable
  by construction and is removed; InvalidMode is the spec's integrity signal

dvb-t2mi:
- PacketReassembler: pointer_field now authoritative — corrupt-length partial
  dropped at next PUSI (resync test), pointer-past-end drops sync; unused pid
  param removed from feed()
- Header::payload_bytes() accessor added (README promised it; revives
  PayloadLengthMismatch); serialize guards for p2_bias 15-bit +
  fef_null/fef_iq s2_field; RFU policy documented in lib.rs
- docs: Table 13 garbled-extraction warning; timestamp layout completes

Cross-cutting:
- serde tests added for t2mi (header + 4 payloads) and bbframe (Bbheader,
  Issy); dvb-si serde test now covers all 22 tables
- [package.metadata.docs.rs] all-features on all four crates
- .gitignore: drop stale Cargo.lock line (lock is committed), ignore audit venv

All gates green: tests (stable + MSRV 1.75), clippy -D warnings, --locked.
@fishloa fishloa merged commit 09b1af7 into main Jun 4, 2026
4 checks passed
@fishloa fishloa deleted the audit-round-3-fixes branch June 4, 2026 07:01
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.

1 participant