Repository navigation
fix(application): rebuild an adopted SSLv2 or DTLS 1.3 record from its to_dict() (#2762) - #2764
Merged
Merged
Conversation
…s to_dict() (#2762) A to_dict() export carries no data model, so TLS.from_data read an adopted SSLv2 record's dict as a TLS record, and DTLS._make_data read a unified-header or tls12_cid record's dict as a legacy one; each rebuild raised. - TLS.from_data also hands a dict carrying SSLv2's two_byte_header to SSLv2. - DTLS._make_data dispatches on the fields, as IGMPv3._make_data does: the tls12_cid content type, then sequence_long, the unified header's S bit. - test_ssl_family_to_dict_roundtrip_2762_unit rebuilds each SSLv2, TLS and DTLS version from info, from to_dict() and through its TCP or UDP layer.
Contributor
|
Coverage: 94.45% (unit tier, Python 3.15,
Per-file detail: the |
Owner
Author
|
GOOD TO GO at
|
JarryShaw
added a commit
that referenced
this pull request
Nov 4, 2026
- #2766 (Fixed): a cut list of plain values ends with the data, where 1.5.x read zero values past the cut (a cut Type 0 Routing header, measured on v1.5.1), into the ListField entry; IGMPv3's sources and the Query's num_sources, into the IGMP entry. - #2767: a cut header rebuilt on its own reads back its parsed values, a regression of the 1.6.0 rebuild path, into the cut-header Fixed entry; the round-trip test rule, into the conventions entry. - #2764: SSLv2, TLS and DTLS records rebuild from their to_dict(), into the TLS/DTLS Added entry, as those classes never shipped. - #2765: the further member reorders and guard rules, into the member-order entry, which records the earlier #2490 reorders. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
from_data(info.to_dict())failed on three kinds of record, because their dispatch keyed on the data model's class and a plain dict carries none:an SSLv2 record adopted by TLS:
AttributeError: 'TLS' object has no attribute 'content_type';a DTLS 1.3 unified-header record;
a DTLS 1.2
tls12_cidrecord:invalid connection ID: None.TLS.from_datanow also sends a dict that carriestwo_byte_headerto SSLv2.DTLS._make_datakeys on thetls12_cidcontent type, then onsequence_long(the unified header's S bit). This follows the field-based dispatch thatIGMPv3._make_datauses.Only method bodies change, and nothing is added or moved, so this is safe alongside Reorder protocol class members to the member-order convention #2490.
The new test rebuilds every SSLv2, SSLv3, TLS 1.0–1.3 and DTLS 1.0/1.2/1.3/CID record from
info, fromto_dict(), and through TCP/UDP. It fails on main with 33 errors and passes here.Not changed: a direct
TLS(sslv2_hello)still logs its discarded TLS attempt at CRITICAL level, even though the parse succeeds. That gets its own issue.Closes #2762