Repository navigation
fix(internet): build an MH CGA parameter from its data model or a schema without public_key_test (#2725) - #2732
Merged
Merged
Conversation
…ema without public_key_test (#2725) Two defects in building the MH CGA Parameters option, both on main. - _passes_raw, which gates the re-parse of a made header that holds raw items, did not look inside a data model. A CGA parameter's data model with a raw extension, given directly or carried by from_data, left the octets in the made header, and _read_cga_extensions raised AttributeError. It looks into a data model as into a dict, and into a multi-mapping through every value of each key, so a raw item in a later option is found too. - _make_opt_cga_param set public_key_test only when hasattr() said it was missing, which it never did: a schema does not store an unset field, so hasattr() found the class's field object and packing raised KeyError. It tests the schema's keys, and sets the key test on a copy, leaving the caller's schema as given. - test_mh_unit reaches that branch without deleting the class attribute, and checks the made key test and the caller's untouched schema. The new module and the test_mh_unit case fail on 468f9c2 without the pcapkit/ change; the internet modules and the project guards pass.
Owner
Author
|
GOOD TO GO at
|
Contributor
|
Coverage: 94.45% (unit tier, Python 3.15,
Per-file detail: the |
JarryShaw
added a commit
that referenced
this pull request
Nov 3, 2026
- Breaking: FrameRecord is an Info and TLSKeyLog.entries a TLSKeyLogEntries data model, not dicts (#2734); a new entry with 1.5.1's behaviour, and pickles checked loading both ways. - Fixed: MH's CGA Parameters maker builds a data model's raw extension and a schema without public_key_test (#2732), into the makers' Fixed entry. - Fixed: a capture cut inside or in front of an option area reads as a short read in MH, HOPOPT and IPv6-Opts, and an odd item list raises ProtocolError (#2731, ab7be2f, which the merge of 07ceaf7 also brings in); the short-read ruling into the conventions entry. - Old values measured against v1.5.1. - 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?
fix— corrects a defectTwo MH CGA parameter build defects, both present on
main:AttributeErrorin_read_cga_extensions.ProtocolBase._passes_rawnever looked inside a data model, which is aMappingbut not adict, so the made header was never re-parsed. It now looks inside one, and reads every value of a multi-mapping, so a raw item in a later CGA option is found too. Across the option captures, every other layer's_make_rawis unchanged, andfrom_datatakes no longer.public_key_testraisedKeyError.hasattrfound the unset field's class attribute, so the maker never set the key test. The maker now checks'public_key_test' not in dataand builds the key test on a copy, leaving the caller's schema untouched.The new tests fail on
main, and so does the updatedtest_mh_unitcase.Closes #2725