Repository navigation
feat(application): parse TLS handshake extensions - #2595
Conversation
|
GOOD TO GO at |
|
Coverage: 93.95% (unit tier, Python 3.15,
Per-file detail: the |
|
Prefer to have those value unpack/pack helper methods (uint, vector, etc.) added as part of the base Protocol's utility helper methods so they can be shared across other protocols. |
|
Owner request, paraphrased: the value pack and unpack helpers this PR adds as module-level functions in |
- Add the IANA TLS ExtensionType registry: pcapkit.vendor.tls.extension_type and the pcapkit.const.tls.extension_type module it generates. - Add SSL.__extension__ with register_extension and the register_tls_extension wrapper; decode server_name, supported_groups, signature_algorithms, ALPN, supported_versions and key_share in ClientHello, ServerHello, HelloRetryRequest and EncryptedExtensions. - Keep unknown extensions, and bodies their decoder rejects, as raw octets, the rejection quiet under CaughtByCaller; decode EncryptedExtensions. - Build extensions from data models, raw octets or (type, kwargs) pairs, byte-exact both ways; add the tls-extension options-generator family. - Add the shared value helpers to Protocol: _read_vector, _read_whole_vector, _read_uints, _make_uint, _make_vector and _make_uints, which the SSL extension readers and makers call. - Document the models, registry and wrapper, and the decoded bodies in the DTLS models, the roadmap and the TLS/DTLS pages; bump the const pins.
11cf6ba to
0ef7139
Compare
|
The fix round for the helper request is pushed:
|
|
GOOD TO GO at
|
|
Merged at |
…6.0 (#2449) - Folded into the TLS/DTLS entry: the hello and EncryptedExtensions extension lists, their registered body decoders, register_tls_extension and the pcapkit.const.tls extension types (#2595), and each whole DTLS record in a datagram as a further layer (#2603). - The conventions entry records #2611's per-test purge rule; the member-order entry cites #2491. - No entry for #2595's private ProtocolBase value helpers, as for the other private API. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
feat— adds a featureDescription of your pull request and other information
TLS handshake extensions are now parsed. ClientHello, ServerHello and EncryptedExtensions decode their extension lists, with decoders for
server_name,supported_versions,supported_groups,signature_algorithms,key_shareand ALPN. The extension types come from the IANA ExtensionType registry, with a crawler plus a generated const module.SSL.__extension__holds the decoders, andSSL.register_extensionandregister_tls_extensionregister more.An extension with no decoder, or whose decoder rejects its body, keeps its octets raw. That rejection is built inside
CaughtByCaller(ProtocolError), so it logs nothing and leavessys.excepthookalone (#2588). A broken extension list or EncryptedExtensions vector still refuses the message. Round trips are byte-exact.Settled on the worker's recommendations, open to the owner:
msg_type;register_tls_extension, after IANA's TLS registry;server_nameand ALPN names arebytes.An odd-length ClientHello
supported_versionsbody now yields no version list.Closes #2514