Feature/add permit no hardware root of trust#551
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the EFI preinstall compatibility checks to support a new PermitNoHardwareRootOfTrust flag, enabling RunChecksContext.Run() to classify and suggest corrective action (via ActionProceed) for NoHardwareRootOfTrustError instead of immediately stopping analysis. It also refactors a significant amount of test fixture data to reduce duplication and adds basic top-level project files.
Changes:
- Add
PermitNoHardwareRootOfTrusthandling in preinstall checks, including a newErrorKindNoHardwareRootOfTrustclassification and proceed-flag wiring. - Refactor EFI preinstall test data (mock images, MEI HFSTS register blobs, signature parsing helpers) to reduce repeated hard-coded values and add coverage for the new flag behavior.
- Add baseline repository scaffolding (README, COPYING, Makefile) and increase test timeout in
run-tests.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| run-tests | Increases go test timeout to 30 minutes. |
| README.md | Adds a basic project overview and license pointer. |
| Makefile | Adds build/test convenience targets (needs fixes noted in review comments). |
| COPYING | Adds GPLv3 license text. |
| internal/efitest/wincert.go | Refactors Authenticode WinCertificate parsing into reusable helpers. |
| efi/preinstall/preinstall_test.go | Centralizes detached Authenticode WinCert creation for tests. |
| efi/preinstall/intel_mei_test.go | Introduces shared mocked MEI HFSTS register payloads for tests. |
| efi/preinstall/errors.go | Updates NoHardwareRootOfTrustError documentation to reflect new permit flag. |
| efi/preinstall/error_kinds.go | Adds ErrorKindNoHardwareRootOfTrust. |
| efi/preinstall/efi_images_test.go | Adds shared default mock EFI images/digests for tests. |
| efi/preinstall/checks.go | Adds PermitNoHardwareRootOfTrust flag and converts matching host-security errors into warnings when permitted. |
| efi/preinstall/checks_test.go | Refactors repeated fixtures; adds test for permitting no HW root-of-trust. |
| efi/preinstall/checks_context.go | Adds classification + action/proceed-flag wiring for the new error kind; refactors error→action conversion logic. |
| efi/preinstall/check_pcr7_test.go | Replaces repeated digest literals with shared defaults. |
| efi/preinstall/check_pcr4_test.go | Replaces repeated digest literals with shared defaults. |
| efi/preinstall/check_host_security_intel_test.go | Replaces repeated MEI fw_status literals with shared fixtures. |
| efi/preinstall/check_host_security_amd64.go | Allows NoHardwareRootOfTrust errors to be accumulated (joinError) instead of aborting immediately. |
| efi/preinstall/check_host_security_amd64_test.go | Updates tests to use shared MEI fixtures and passes a log where required. |
| cmd/test_efi_fde_compat/main.go | Adds CLI flag to enable PermitNoHardwareRootOfTrust. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pedronis
left a comment
There was a problem hiding this comment.
I would prefer if the introduction of convertErrorsToActions was done separately from adding add PermitNoHardwareRootOfTrust, it would make reviewing easier
This changes the way RunChecksContext.Run() handles NoHardwareRootOfTrustError. Run() with no action will raise NoHardwareRootOfTrustError as before but will continue the preinstall compatibility analysis and suggest a corrective action using PermitNoHardwareRootOfTrust. The related error kind is ErrorKindNoHardwareRootOfTrust. Run() with ActionProceed and PermitNoHardwareRootOfTrust will ignore the error and continue the preinstall compatibility analysis.
1231e5c to
c84837e
Compare
efi/preinstall: add PermitNoHardwareRootOfTrust
This changes the way RunChecksContext.Run() handles NoHardwareRootOfTrustError.
Run() with no action will raise NoHardwareRootOfTrustError as before but will
continue the preinstall compatibility analysis and suggest a corrective action
using PermitNoHardwareRootOfTrust. The related error kind is
ErrorKindNoHardwareRootOfTrust.
Run() with ActionProceed and PermitNoHardwareRootOfTrust will ignore the error
and continue the preinstall compatibility analysis.