tpm-enrol: move NV cert index off OEM-occupied 0x01800001 → 0x01800100
The Dell 820 kept "finding a cert" and bypassing enrolment despite repeated BIOS TPM clears. tpm2_nvreadpublic revealed 0x01800001 on that hardware is a FIRMWARE platform index (platformcreate|policydelete|writelocked, 70 bytes — not our cert; siblings at 0x01800003/4 + 0x01810000). platformcreate survives TPM2_Clear and policydelete needs the platform's secret policy, so it's permanent and unusable by us — the blind check false-positived on it, and enrolment could never write there anyway. Same class of bug as the EK-handle collision. Move the NV cert index default 0x01800001 -> 0x01800100 (free on the 820, owner range, overridable via rd.dot1x.nvindex): cmdline (extract-artifacts.sh), fleet-enrol -nvindex, the dracut hooks, bench scripts, CLAUDE.md invariant #1, and design/SSP docs. The signing-key handle (0x81000100) is unchanged. Harden WriteNVCert: refuse a platformcreate index with a clear "pick a free owner index via rd.dot1x.nvindex" error instead of a confusing undefine failure. Regression simtest/TestWriteNVCertRefusesPlatformIndex; NV roundtrip + ReadNVCert tests moved to 0x01800100. All go tests + packer validate pass.
This commit is contained in:
@@ -106,10 +106,13 @@ instead of working around it.
|
||||
All host identity derives from the TPM at runtime (signing key at persistent
|
||||
handle `0x81000100` — a **non-reserved owner handle**, deliberately NOT the
|
||||
EK slot `0x81010001` nor the SRK `0x81000001`, which firmware/swtpm
|
||||
provisioning already occupy; cert at NV index `0x01800001`, hostnqn derived
|
||||
from the cert serial). If a change needs per-host data, it belongs in the
|
||||
enrolment flow, not the image. (The handle is overridable via
|
||||
`rd.dot1x.handle=` / `fleet-enrol -handle`.)
|
||||
provisioning already occupy; cert at NV index `0x01800100` — also chosen to
|
||||
avoid **OEM platform NV**: a Dell 820 firmware squats `0x01800001`–`0x01800004`
|
||||
+ `0x01810000` as `platformcreate|policydelete` indices that no owner/BIOS
|
||||
clear can remove, so the original `0x01800001` collided; hostnqn derived from
|
||||
the cert serial). If a change needs per-host data, it belongs in the enrolment
|
||||
flow, not the image. (Both are overridable: `rd.dot1x.handle=` /
|
||||
`rd.dot1x.nvindex=` / `fleet-enrol -handle -nvindex`.)
|
||||
1. **The hook ordering in `dot1x-macsec-up.sh` is load-bearing.**
|
||||
NV-cert extraction → supplicant start → wait for `Authorized` + macsec0 →
|
||||
DHCP **on macsec0** → hostnqn derivation. Never DHCP before auth
|
||||
|
||||
Reference in New Issue
Block a user