I am installing IncusOS on a bare-metal system. The installation itself goes fine, however after the first reboot I see the following two messages on my screen:
INFO: Upgrading LUKS TPM PCR bindings, this may take a few seconds
ERROR: x509 malformed certificate
After the error is displayed, the system does not make any further progress.
Initially I thought I might have made an error in my image preseed, but this does not seem to be the case as the exact same image installs fine on a virtual machine.
The bare-metal system I am installing on is a workstation with dual Intel Xeon CPUs and an NVIDIA RTX-2000 as a discrete GPU. Because of this config, I have provisioned a custom Secure Boot certificate chain, including:
PK: my own certificateKEK: my own + IncusOS’s certificatesdb: IncusOS’s db certs plus the hash of my GPU’s OpRom
I saw that my GPU’s OpRom is signed with the MS UEFI CA 2011 and I really did not want to onboard this cert in Secure Boot, as this is kind of opening the gates to hell. Therefore, I considered as a better approach to enroll in my db the hash of my GPU’s OpRom. This is fully supported by UEFI Secure Boot and I saw no issues pre-boot.
I believe this hash entry might be the root cause of the error I see in IncusOS. When reconstructing PCR 7 from the TPM event log, both getSigningCertBytes() (event_log.go) and computeExpectedVariableAuthority() (pcrs.go) assume every EV_EFI_VARIABLE_AUTHORITY event’s payload is a full X.509 certificate.
When my GPU’s OpRom executes, I assume that the firmware will log an EV_EFI_VARIABLE_AUTHORITY event recording that it was authorized by the hash entry in db, not a certificate.
If that event’s payload is a SHA256 digest rather than a DER-encoded cert, feeding it to x509.ParseCertificate()will yield the failure I see?
Since this system has only a dGPU, it is not really an option to have the GPU excluded in UEFI (I won’t have any video output). Moreover, given the cert the GPU’s OpRom is signed with, I am also reluctant to “onboard” the MS UEFI CA 2011 cert in db.
Regarding IncusOS:
- Is hash-based db authorization expected to work with IncusOS PCR7 handling?
- If so, would it be feasible to provide a fix for the issue I describe?
- If not, is there any other way forward (which I’m possibly overlooking), apart from onboarding the MS UEFI CA 2011 certificate? It is essential for me to have GPU video output.
Finally, if my hypothesis is correct, could you please consider making the error message I see a bit more descriptive, at least by hinting that this refers to Secure Boot (and not any other certificate that might be provisioned on the system)?
If needed, I am happy to report this as a GitHub Issue. I considered it better to ask here first, to confirm if my hypothesis is correct and if this is actually an issue.