netlink: add nl80211.key for the AP key control plane - #696
Open
lneto wants to merge 2 commits into
Open
Conversation
lneto
force-pushed
the
claude_nl80211_key
branch
from
August 9, 2026 14:17
74b80c3 to
5e62bba
Compare
An `include` list now emits its names verbatim and lets the C compiler validate them, instead of intersecting them with the integer-expression scan. This is what lets a curated spec pull in constants defined as function-like macros (e.g. `WLAN_CIPHER_SUITE_* = SUITE(...)`), which the scan deliberately rejects; an unknown name becomes a build error rather than a silent drop. Output is unchanged for the existing enum-member specs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lneto
force-pushed
the
claude_nl80211_key
branch
from
August 9, 2026 17:58
5e62bba to
697d197
Compare
`netlink.nl80211.key():add/del` installs and removes an AP's keys over the "nl80211" family: a group key (GTK) without a MAC, a pairwise key (PTK) with one (the kernel infers the type from the MAC's presence). Exposes the WLAN_CIPHER_SUITE_* suites as `linux.nl80211.cipher` for KEY_CIPHER. The test drives the group-key path on hwsim (install, out-of-range index raises, remove); the pairwise path needs a real association and belongs to the WPA handshake test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lneto
force-pushed
the
claude_nl80211_key
branch
from
August 9, 2026 21:11
697d197 to
c91c123
Compare
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.
Completes the Phase 0 nl80211 control plane (
docs/design/wireless-ap/plan.md) with the key object, alongside the mergedwiphy/interface/ap/station.What
netlink.nl80211.key():add/del— installs and removes an AP's keys over the"nl80211"family. A group key (GTK) has no MAC; a pairwise key (PTK) has one — the kernel infers the type from the MAC's presence, matching WPA semantics andstation.lua's minimalism.indexis packed as au8(NL80211_ATTR_KEY_IDXisNLA_POLICY_MAX(NLA_U8, 7); strict validation would reject au32);data/mac/seqare raw bytes.WLAN_CIPHER_SUITE_*suites aslinux.nl80211.cipher(CCMP, CCMP_256, GCMP, GCMP_256, TKIP) forKEY_CIPHER, plus theNEW_KEY/DEL_KEYcommands andKEY_*attributes.autogen: authoritative include lists
The cipher suites are
#define WLAN_CIPHER_SUITE_CCMP SUITE(0x000FAC, 4)— function-like macros that the autogen's integer-expression scan deliberately rejects. The first commit makes an explicitincludelist authoritative: it emits its names verbatim and lets the C compiler validate them (an unknown name is a build error, not a silent drop). Output is unchanged for the existing enum-member specs; this also unlocksBIT()-based constants in future.Testing
tests/netlink/nl80211_key.shonmac80211_hwsim(skips if absent), validated locally — 3/3:The test drives the group-key path (install as hostapd does after START_AP, out-of-range index raises, remove). The pairwise path needs a real association — installing a PTK on a manually-added, non-associated station tears the interface down on hwsim — so it belongs to the WPA handshake test (Phase 3), not here.
🤖 Generated with Claude Code