Skip to content

fix(internet): the Mobility Header refuses RFC 6275's 12-octet Binding Authorization Data and RFC 4285's 17-octet authentication option (#3237) - #3241

Merged
JarryShaw merged 1 commit into
developfrom
fix/3237-mh-authenticator-lengths
Nov 30, 2026
Merged

JarryShaw merged 1 commit into
developfrom
fix/3237-mh-authenticator-lengths

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

  • Put an x into every box [ ] that applies to your pull request (like this: [x])

  • Use the Preview tab to see how your pull request will look

  • Searched for similar pull requests

  • Followed the coding style (make pylint, make mypy, make isort)

  • make test passes, and a test case covers the change

  • Described the user-visible change below and left its changelog entry to the maintainer, keeping docs/source/changelog/ and CHANGELOG.md out of the diff, if the change is user-visible: N/A — centralised

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect

  • feat — adds a feature

  • perf — changes performance, not behaviour

  • refactor — changes neither behaviour nor performance

  • test — tests only

  • docs — documentation only

  • ci — workflows or build tooling

  • release — bumps the version or rolls up a distribution

  • chore — anything else

  • Also tick if it regenerates constant or registry tables, members keeping their numeric values (the const label)


Description of your pull request and other information

Closes #3237.

Tests: tests/protocols/internet/test_mh_authenticator_lengths_3237_unit.py, parse alone and in IPv6 → rebuild, and make() with an enum or an int, at 12, 17 and 25, at every Length to 255, and cut short by the capture. Everything but the Length-under-5 guard fails on an origin/develop export. mh/protocol.py coverage over the MH unit modules rises from 91.27% to 91.52%. tests/protocols/internet, tests/protocols/*.py, tests/*.py, tests/project and its Sphinx-gated modules pass after make_samples.py, but for test_conda_dev_release_gate_2458.py's script runs, which fail the same way on a develop export.

@JarryShaw JarryShaw moved this to In review in PyPCAPKit Nov 30, 2026
@JarryShaw JarryShaw added bug Issues reporting a defect (set by the bug report template; a default, not an assessment) review: running A cross-review is in flight against the current head - no verdict yet labels Nov 30, 2026
@github-actions github-actions Bot added this to the PyPCAPKit v1.10 milestone Nov 30, 2026
@read-the-docs-community

read-the-docs-community Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 PyPCAPKit | 🛠️ Build #36253957 | 📁 Comparing 5c81d8b against latest (07f7bc8)

  🔍 Preview build  

3 files changed
± genindex.html
± pcapkit/protocols/internet/mh.html
± _modules/pcapkit/protocols/internet/mh/protocol.html

…g Authorization Data and RFC 4285's 17-octet authentication option (#3237)

- _read_opt_bad and _make_opt_bad no longer require a multiple of eight
  octets: RFC 6275 section 6.2.7 sizes the authenticator by its procedure,
  12 octets for return routability.
- _read_opt_auth and _make_opt_auth no longer require an Option Length one
  less than a multiple of four: RFC 4285 section 5 sizes the data by subtype
  and SPI, a Length of 17 for MN-HA and, from HMAC_SHA1's untruncated output,
  25 for MN-AAA under HMAC_SHA1_SPI. A Length under 5, with no room for the
  subtype and SPI, is still refused.
- Both rules read an option's alignment as a length; each maker is now
  bounded only by its one-octet Option Length.
- The MH option generator builds both options at their RFC lengths.
@JarryShaw
JarryShaw force-pushed the fix/3237-mh-authenticator-lengths branch from 99f89eb to 5c81d8b Compare November 30, 2026 04:31
@JarryShaw

JarryShaw commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner Author

Good to go at 5c81d8b9d, from a Sonnet cross-review and my check of the nit fix.

  • RFC readings: confirmed against the RFC text. RFC 6275 §6.2.7's 8n + 2 and RFC 4285 §5's 4n + 1 are alignments, not lengths. Return routability gives 12, MN-HA gives 17, and MN-AAA under HMAC_SHA1_SPI (§8, value 3) gives 25, from HMAC_SHA1's untruncated output.
  • Fuzzing: the reviewer ran every Length from 0 to 255 for options 5 and 9, alone and inside IPv6. Parse→rebuild and make→parse are byte-exact. Option 9 under Length 5 stays quietly refused, and the makers refuse only at 256.
  • Tests: 422 checks fail on develop. Coverage of mh/protocol.py rises, and the moved pins assert no less. tests/protocols/internet (1190), tests/project (2435) and the top-level and root suites (1008) pass.
  • Nit fix: it removes the timed wording, and the 20 octets are now stated as derived from untruncated HMAC_SHA1. Only prose changed, and it is still one commit on 07f7bc8ff.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 94.98% (unit tier, Python 3.15, 5c81d8b9d, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 116 4 20 2 95.59%
pcapkit/const 22386 224 3186 191 98.28%
pcapkit/corekit 3160 83 1058 40 96.85%
pcapkit/dumpkit 423 3 148 5 98.60%
pcapkit/foundation 4350 24 1364 26 99.12%
pcapkit/interface 112 4 40 3 95.39%
pcapkit/protocols 28984 153 7672 128 99.22%
pcapkit/toolkit 1273 35 470 9 96.67%
pcapkit/utilities 639 7 176 5 98.53%
pcapkit/vendor 6575 2396 1478 258 60.24%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Required checks passed is green. Of the 15 KTLO and experimental legs, the only failing id is on Python 3.14t (experimental): test_lazy_exports_threads_2771_unit.py::…test_member_and_helper_first_imports_hold_the_lock. One trial of four kept an HTTP/1 layer raw for "dictionary changed size during iteration".

That is a free-threading race in concurrent first imports, and nothing in this PR's Mobility Header change touches it. The same leg passed on develop 07f7bc8ff and on #3239, #3240 and #3242. It is filed as #3243, which is being fixed separately, so it does not hold this PR.

@JarryShaw
JarryShaw merged commit 5d96b34 into develop Nov 30, 2026
73 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Nov 30, 2026
@JarryShaw
JarryShaw deleted the fix/3237-mh-authenticator-lengths branch November 30, 2026 13:50
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issues reporting a defect (set by the bug report template; a default, not an assessment)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(internet): the Mobility Header refuses RFC 6275's 12-octet Binding Authorization Data and RFC 4285's 17-octet authentication option

1 participant