Skip to content

efi: allow other architectures in check_host_security and friends - #563

Open
alexclewontin wants to merge 3 commits into
canonical:masterfrom
alexclewontin:check-host-security-unpin-amd64
Open

efi: allow other architectures in check_host_security and friends#563
alexclewontin wants to merge 3 commits into
canonical:masterfrom
alexclewontin:check-host-security-unpin-amd64

Conversation

@alexclewontin

Copy link
Copy Markdown
Member

Checking host security today makes assumes in many ways secboot will only be used on amd64. This PR attempts to lay the groundwork to allow other architectures to leverage much of the same logic.

Big themes:

  • removing architecture-conditional compilation, to allow unit tests to be mocked and run on any host architecture
  • abstracting the mocked test environment (the "fixture") from the actual code under test. This accounts for the bulk of the PR, as a ton of a couple test files now sit inside loops over fixtures. The whitespace insensitive diff is much smaller.
  • adding switch/case statements to the business logic of checking host security, so that each architecture can implement its own ecosystem-aware checks (as even within amd64 there doesn't seem to be a platform agnostic way to handle this).

This is based on top of #562 and is part of an attempt to split up #560.

CheckResult.Warnings is a CompoundError interface that RunChecks leaves
nil when no warnings were detected. Unwrap on a nil interface panics, so
only unwrap when warnings are present.
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.

1 participant