Repository navigation
Feat/secure boot lockdown - #224
Merged
Merged
Conversation
A sdkconfig.secure bootloader no longer burns secure boot on its first boot (bootloader_components/secure_boot_opt_in). Settings → Security → Secure Boot does it, after checking that the running app is signed by one of the three embedded key digests and the flashed bootloader by all of them. `just sbtest-flash` runs the whole flow on virtual eFuses with test keys.
… and the frozen bootloader
Secure download mode refuses espefuse, so the post-lock checks use esptool get-security-info and the Secure Boot page, and the manual lockdown burns ENABLE_SECURITY_DOWNLOAD last.
In secure download mode esptool cannot detect the flash size, and with --flash-size keep the ROM refuses writes past 2 MB, which the app reaches.
In secure download mode the ROM takes flash data uncompressed, in 1 KiB blocks, and needs the flash size set; register reads and the stub are unavailable. Image headers are no longer rewritten on any device, so a signed bootloader lands as built.
Their flash is unpowered in download mode and powering it takes register writes, which secure download mode refuses: once locked they could not be flashed over USB again.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds on-device Secure Boot v2 lockdown and everything a release needs to support it.
What changes
--wrapbootloader component keeps the bootloader from enabling secure boot by itself.sdkconfig.secureat security version 0, which burns nothing. The Secure Boot page shows the eFuse counter once locked.kern_secure_boot/bootloaders/for the four variants (v1/v3 x QIO/DIO), signed by all three keys, with a manifest and a GPG-signedSHA256SUMS. New tooling:just bootloader-stage,scripts/freeze_bootloader.sh,just bootloader-import.sdkconfig.release+sdkconfig.secureand ship the frozen bootloader.sign_release.shrefuses a bootloader that is not signed by all three keys.docs/secure-boot.mdanddocs/security-plan.md.