Repository navigation
refactor(protocols): range-check link and SSLv2 makers with _make_uint - #2629
Merged
Merged
Conversation
#2614) - GRE, FRAD, Netlink, Loopback: make()'s inline unsigned-int checks go through ProtocolBase._make_uint; Netlink and Loopback pack with _make_pack. The byte-order checks stay inline. - FRAD: a float flag bit such as cr=1.0 raises ProtocolError rather than a raw ValueError; the flag and snap_pid messages drop their suffix. - SSLv2: padding, and session_id_hit in make() and read(), use _make_uint; a bool or non-int 3-octet padding raises ProtocolError. Messages read 'SSLv2: invalid <name>: <value>'; their pins follow. - OSPF keeps its check: _make_uint reads self.alias, unset before read(). - The #1739 sweep skips the bits=/size= field width a value helper takes. Byte-identical make() output on a 5743-case grid and the samples; tests pass.
Owner
Author
|
GOOD TO GO at |
JarryShaw
added a commit
that referenced
this pull request
Nov 2, 2026
…types and the registry split into 1.6.0 (#2449) - Breaking: Quick-Start values their fields cannot carry raise, reversing 1.5.0's round-down of a TCP rate under 80 kbps (#2630). - Folded into unreleased entries: tls12_cid records and DTLSContext (#2631), LinkType 105 and 127 in Frame and PCAP-NG (#2632), and DTLS.analyze_handshake behind dtls_handshake and packet (#2634). - Changed: foundation.registry.protocols split into per-layer submodules (#2635); 1.6.0's register_* roles and 1.5.0's three register_protocol* roles point at their submodules, 1.5.0's text unchanged. - The conventions entry records the per-layer wrapper placement (#2635) and parse ownership (#2634). No entry for #2629, which changes no released behaviour. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
1 of 5 tasks
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?
refactor— changes neither behaviour nor performanceDescription of your pull request and other information
GRE, FRAD, Netlink and Loopback
make(), and SSLv2'smake/readguard, range-check their fields throughProtocolBase._make_uintand pack through_make_pack, replacing their inline checks. Valid input builds the same bytes as before: 5,743 cases, and all 23 regenerated captures are identical.Per the owner's ruling on #2614 (2a), out-of-range input raises
ProtocolError. FRAD flag bits given as floats used to leak a bareValueError. SSLv2 three-octetpadding=True/Falseused to pack 1/0, and non-int padding raisedTypeError. Four SSLv2 messages and the FRAD flag/snap_pidmessages now take the'{alias}: invalid {name}: {value!r}'form. The RFC-constants sweep exempts a width passed asbits=/size=to the shared helpers, and a planted constant is still caught. OSPF follows in the next #2614 commit, which addsalias=.A Sonnet cross-review checked every site pair and the byte identity. Its findings, the sweep rule and two missing pins, are folded in.
Part of #2614