Repository navigation
refactor(protocols): finish the shared value helpers on ProtocolBase and move TLS onto them - #2638
Conversation
|
GOOD TO GO at
It also ran 6,625 TLS/DTLS parse/build cases. The only differences are oversize makes, which now raise Its NEEDS CHANGES round is folded in:
The two re-pinned SCTP messages are listed in the description. |
…o them (#2614) - ProtocolBase: add _read_octets, _read_uint, _read_sint, _read_mac_addr, _read_text, _make_octets, _make_sint, _uint_size and _make_mac_addr; _read_vector reads through them and _make_uint takes alias=. - Ethernet uses the base MAC pair, and its dead PAT_MAC_ADDR goes, as does PCAP-NG's; PCAP-NG and 802.11 keep only the overrides that change behaviour. - protocol-member-order.rst: ARP is the worked example and the reference. - TLS: drop _take, with octets and messages unchanged; every maker and the record header pack through _make_pack, so an oversize value is StructError. - SCTP: chunk flags and invalid-stream reserved use _make_octets, naming the chunk or cause in name=; OSPF.make checks packet_length with _make_uint. TLS/DTLS/SSL, link, helper, #2296 and member-order tests pass.
c82e1b6 to
0d23b5e
Compare
|
Rebased onto |
|
Coverage: 94.08% -- tests failure, so this is partial (unit tier, Python 3.15,
Per-file detail: the |
…shared value helpers into 1.6.0 (#2449) - Breaking: NoPayload and its data model and schema move from misc.null to misc.no_payload with no re-export, so a frame pickled by 1.5.x fails to load (#2636). 1.5.0's three NoPayload roles and 1.6.0's own point at misc.no_payload, 1.5.0's text unchanged. - Added: the IP, L2TP, ICMP, IGMP and LinuxSLL bases give a member on read, make and from_data, version= naming it, with the refusals and IPv4's Version check ahead of the header (#2639). - Changed: SCTP's chunk-flag and Invalid Stream Identifier reserved-octet messages (#2638). Folded into the TLS/DTLS entry: make() raises StructError for a value too wide for its field (#2638), and the DTLS_CIDCiphertext and TLS_ConnectionId package exports (#2641). - The conventions entry records the version= dispatch rule (#2639) and ARP as the member-order reference (#2638). - No entry for #2638's private value helpers or the Ethernet and PCAP-NG PAT_MAC_ADDR, as for #1844's OSPF copy; #2640's docstring fixes; or the test-only #2620, #2637, #2645 and #2646. - 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?
refactor— changes neither behaviour nor performanceDescription of your pull request and other information
This finishes the shared value helpers on
ProtocolBasefrom #2614's audit, and moves TLS onto them.New helpers:
_read_octets,_read_uint,_read_sint/_make_sint,_uint_size,_make_octets,_read_mac_addr/_make_mac_addr,_read_text, andalias=on_make_uint.Adoption:
_take. Every TLS hello, handshake, content and record-header maker packs through_make_pack, so an oversize value raisesStructError: TLS: pack failedinstead of wrapping or leaking a bare error. TLS and DTLS are not in any release.packet_lengthwith_make_uint(alias='OSPF')._make_octets.Owner ruling (3): the member-order page's worked example and reference class move to ARP, so Ethernet loses its delegate and pylint pragma.
Changed messages:
SCTP: [Chunk 132] invalid flags: must be one octet, not b''→SCTP: invalid [Chunk 132] flags: must be 1 octet, not b''SCTP: [Cause 1] invalid reserved: must be two octets, not b''→SCTP: invalid [Cause 1] reserved: must be 2 octets, not b''The owner accepted these re-pins when choosing
_make_octets.Verification:
main.Part of #2614