Skip to content

Feature/add permit no hardware root of trust#551

Merged
frederic-hoerni merged 2 commits into
masterfrom
feature/add-PermitNoHardwareRootOfTrust
Jun 23, 2026
Merged

Feature/add permit no hardware root of trust#551
frederic-hoerni merged 2 commits into
masterfrom
feature/add-PermitNoHardwareRootOfTrust

Conversation

@frederic-hoerni

@frederic-hoerni frederic-hoerni commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PermitNoHardwareRootOfTrust handling in preinstall checks, including a new ErrorKindNoHardwareRootOfTrust classification 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.

Comment thread Makefile
Comment thread Makefile
Comment thread README.md Outdated
Comment thread internal/efitest/wincert.go Outdated
Comment thread internal/efitest/wincert.go Outdated
Comment thread efi/preinstall/efi_images_test.go Outdated
Comment thread COPYING
Comment thread Makefile Outdated

@pedronis pedronis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if the introduction of convertErrorsToActions was done separately from adding add PermitNoHardwareRootOfTrust, it would make reviewing easier

Comment thread efi/preinstall/checks_context.go
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.
@frederic-hoerni
frederic-hoerni force-pushed the feature/add-PermitNoHardwareRootOfTrust branch from 1231e5c to c84837e Compare June 22, 2026 16:12
@pedronis
pedronis self-requested a review June 23, 2026 10:08

@pedronis pedronis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@frederic-hoerni
frederic-hoerni merged commit 457b03a into master Jun 23, 2026
2 checks passed
@frederic-hoerni
frederic-hoerni deleted the feature/add-PermitNoHardwareRootOfTrust branch June 23, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants