Repository navigation
refactor(protocols)!: refuse fixed-size octets and timestamp counts the makers masked (#2676) - #2691
Conversation
|
NEEDS CHANGES at
|
9ee57bd to
6ca69b2
Compare
|
Pushed the fix round
A Sonnet re-review is running. |
|
NEEDS CHANGES at
One hole remains: the zero-fill fires whenever the model carries any
|
6ca69b2 to
ea9935d
Compare
|
Pushed the fix round
A Sonnet re-review is running; |
|
NEEDS CHANGES at
|
…he makers masked (#2676) - _make_octets: a caller's octets for a fixed-size field raise ProtocolError at any other width instead of being padded or cut -- the IPv4, MH, HIP, ICMP, IGMP, IPX and OSPF checksums, the CALIPSO checksum, MH cookies and keygen tokens, HIP opaque and payload data, PCAP-NG ZigBee keys, IPX addresses, and the reserved, unused and zero octets of HOPOPT, IPv6-Opts, IPv6-Frag, IPv6-Route, MH, HIP, ICMP, IGMPv3, OSPF and IP_Pseudo. - _fill_short_read: a model's reserved octets are zero-filled before the check only where its short read ends at or before them, for the rebuild to cut back; any other model's are checked as a caller's are. - IPv4 TS: a slot count past nine (list) or four (dict) raises instead of being cut; the default is derived from the form. - Empty defaults of fixed-size fields become zero octets of their width. - protocol.rst documents the shared value helpers and how makers use them. - MH ipv4_dhcp.mode=True is unchanged: S is one bit, which takes a bool. - Tests: a source sweep finds every fixed-size octet field a maker writes; every refusal fails on main; cut captures rebuild as captured; the widest values build and round-trip.
ea9935d to
d57c0a4
Compare
|
Pushed
A Sonnet re-review is running; |
|
GOOD TO GO at
|
…s.pickle, FRAD's pad and the TCP and HIP maker fixes into 1.6.0 (#2449) - Breaking: a fixed-size octet field given any other width raises, where 1.5.x padded or cut it, and IPv4's Timestamp option refuses a slot count past what it holds, where 1.5.x cut it (#2691); folded into the IPv4 to HIP makers' range-check entry, with the ZigBee keys into the PCAP-NG entry. Old values measured against v1.5.1. - Added: pcapkit.utilities.pickle, whose ReduceAsProtocol2 lets Info, Schema and the reassembly engines pickle under protocols 0 and 1 on GraalPy, and numbers._reduce_unregistered_member's removal (#2722). - Fixed: TCP's raw-octet options, HIP's default version, HIP's ENCRYPTED IV and its cipher on parse (#2724). - Folded into unreleased entries: FRAD's pad field and make(pad=) (#2721). - No entry for the docstring-only 596dcfa, the test-only 149cced, or #2724's MH annotation. - 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
The rest of #2676, after the registry-code bullet, which #2594's rework takes.
_make_octetsand raiseProtocolErrorat any other width, instead of being padded or cut. This covers the checksums of IPv4, MH, HIP, ICMP, IGMP, IPX and OSPF, the CALIPSO checksum, MH cookies and keygen tokens, HIP opaque and payload data, PCAP-NG ZigBee keys, IPX addresses, and the reserved and unused octets of the IPv6 extensions, MH, HIP, ICMP, IGMPv3, OSPF andIP_Pseudo. A source sweep in the tests finds every such field a maker writes, so a new one fails without a row.ipv4_dhcp.mode=Trueis unchanged: it is a one-bit field, which takes abool.Breaking: released makers that padded or cut a fixed-size value now raise.
Closes #2676