Skip to content

fix(application): TLS extensions stay raw in Certificate, CertificateRequest and NewSessionTicket where their RFCs define them (#3254) - #3263

Open
JarryShaw wants to merge 1 commit into
developfrom
fix/3254-tls-extension-rfc-cells
Open

JarryShaw wants to merge 1 commit into
developfrom
fix/3254-tls-extension-rfc-cells

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

  • Put an x into every box [ ] that applies to your pull request (like this: [x])

  • Use the Preview tab to see how your pull request will look

  • Searched for similar pull requests

  • Followed the coding style (make pylint, make mypy, make isort)

  • make test passes, and a test case covers the change

  • Described the user-visible change below and left its changelog entry to the maintainer, keeping docs/source/changelog/ and CHANGELOG.md out of the diff, if the change is user-visible: N/A — centralised

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect

  • feat — adds a feature

  • perf — changes performance, not behaviour

  • refactor — changes neither behaviour nor performance

  • test — tests only

  • docs — documentation only

  • ci — workflows or build tooling

  • release — bumps the version or rolls up a distribution

  • chore — anything else

  • Also tick if it regenerates constant or registry tables, members keeping their numeric values (the const label)


Description of your pull request and other information

Closes #3254.

Each cell decodes, and builds from keyword arguments, where its RFC or the IANA registry's TLS 1.3 column lists it, byte-exact both ways:

Extension Certificate CertificateRequest NewSessionTicket
status_request new CertificateStatus (RFC 6066 §8, RFC 9846 §4.5.1.1) empty (RFC 9846 §4.5.1.1)
signed_certificate_timestamp the list (RFC 9846 §4.5.1.1) empty, the request form (RFC 6962 §3.3.1)
compress_certificate the list (RFC 8879 §3)
early_data new EarlyDataNewSessionTicket (RFC 9846 §4.3.10)

PCAPKIT_MIMIC=wireshark fills #3252's two raw cells, as ssl_dissect_hnd_extension (dissectors/packet-tls-utils.c) reads them. A DTLS Certificate's status_request reads nothing there, since is_tls13 holds for TLS 1.3 alone, so __structure__ gains a DTLS column for it. Only ocsp has a response: RFC 9846 §4.5.1.1 requires RFC 6066's structure, and IANA reserves ocsp_multi.

Tests: test_tls_extension_rfc_cells_3254_unit.py and the updated #3228 table fail on a git archive origin/develop export (unittest: 2 failures, 13 errors). Coverage of ssl/ rises (99.49% to 99.51%, branch). No pins moved. tests/protocols/application, tests/protocols/*.py, tests/*.py, tests/project, tests/utilities and the Sphinx-gated modules pass, but test_conda_dev_release_gate_2458, which fails the same on the export.

@github-actions github-actions Bot added this to the PyPCAPKit v1.10 milestone Nov 30, 2026
@JarryShaw JarryShaw added bug Issues reporting a defect (set by the bug report template; a default, not an assessment) review: running A cross-review is in flight against the current head - no verdict yet labels Nov 30, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Nov 30, 2026
@read-the-docs-community

read-the-docs-community Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

@JarryShaw

Copy link
Copy Markdown
Owner Author

Good to go once two nits are folded in (reviewed at 3a75f644a, Sonnet cross-review). A small amend is under way, and I'll check it before granting.

  • RFC cells: confirmed against RFC 9846 §4.5.1.1 and §4.3.10, RFC 6962 §3.3.1 and RFC 8879 §3, plus the IANA TLS column (18,signed_certificate_timestamp,"CH, CR, CT"). Each builds with make and round-trips byte-exactly.
  • Nothing else moved: of 2640 layout cells (every extension × message × mimic × record layer), exactly the 16 intended changed, each from None to a schema.
  • Wireshark column: is_tls13 is session->version == TLSV1DOT3_VERSION (dissectors/packet-tls-utils.c), so a DTLS 1.3 Certificate reads nothing. That is why the DTLS column exists. early_data in NST reads 4 octets.
  • Nits being folded: the CertificateStatus docstring should also say that a non-ocsp type refuses on build. protocol-family-grouping.rst should mention the IANA TLS 1.3 column.
  • Separate gap confirmed: Wireshark decodes ocsp_multi (OCSPResponseList), and this PR keeps it raw even under wireshark. I'm filing that separately.

@JarryShaw JarryShaw added review: pending No verdict for the current head - never reviewed, or the head moved since the last one and removed review: running A cross-review is in flight against the current head - no verdict yet labels Nov 30, 2026
…Request and NewSessionTicket where their RFCs define them (#3254)

Each TLS and DTLS extension below now decodes, and builds from keyword
arguments, in the messages its RFC or the IANA registry's TLS 1.3 column
lists, with a byte-exact round trip.

- status_request: a CertificateStatus (RFC 6066 section 8) in a Certificate,
  empty in a CertificateRequest (RFC 9846 section 4.5.1.1).
- signed_certificate_timestamp: the list in a Certificate, empty in a
  CertificateRequest.
- compress_certificate: the algorithm list in a CertificateRequest
  (RFC 8879 section 3).
- early_data: max_early_data_size in a NewSessionTicket (RFC 9846
  section 4.3.10).
- With PCAPKIT_MIMIC=wireshark, the CertificateStatus and
  max_early_data_size cells decode as ssl_dissect_hnd_extension reads them,
  but for a DTLS Certificate's status_request, which its is_tls13 test
  leaves unread.
@JarryShaw

Copy link
Copy Markdown
Owner Author

Good to go at 9dd25a2f2. I checked the delta from 3a75f644a myself: two hunks, no code change. The CertificateStatus docstring now says a non-ocsp type stays raw on read and raises on build. protocol-family-grouping.rst now says "that RFC, or the IANA registry's TLS 1.3 column, names". The rest is only re-wrapping.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Nov 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issues reporting a defect (set by the bug report template; a default, not an assessment) review: good-to-go Cross-review at the current head says ready; CI state is separate

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

fix(application): TLS extensions stay raw in Certificate, CertificateRequest and NewSessionTicket where their RFCs define them

1 participant