Go to file
Steve McIntyre 57e2a32bef Fix up some of the options we're using at build time
Definitely don't want to be setting EFI_PATH, as that over-rides the
vendored gnu-efi. Argh
2021-03-23 23:33:13 +00:00
.github/workflows Make httpboot.c always get built. 2021-02-16 09:12:48 +01:00
Cryptlib Use gcc -Os instead of -O0. 2021-02-16 09:12:48 +01:00
data Add a .sbat section to EFI binaries 2021-02-12 12:51:32 -05:00
debian Fix up some of the options we're using at build time 2021-03-23 23:33:13 +00:00
include sbat: make shim to parse it's own .sbat section on init 2021-02-19 14:28:10 -05:00
lib Make the variable name and pointer const in all of our efi vars functions 2021-02-16 09:12:48 +01:00
.clang-format Add some linked list primitives. 2021-02-13 12:58:23 -05:00
.gitignore .gitignore: ignore .gdbinit 2021-02-15 17:20:05 -05:00
buildid.c Fix up a bunch of our license statements and add SPDX most places 2021-02-16 09:12:48 +01:00
BUILDING Add ENABLE_SHIM_DEVEL config to change what our debug variable name is 2021-02-16 09:12:48 +01:00
cert.S Fix up a bunch of our license statements and add SPDX most places 2021-02-16 09:12:48 +01:00
COPYRIGHT Import upstream version 0~20120728.3df9e294 2012-08-29 16:51:10 -07:00
crypt_blowfish.c SPDX: Clarify the attribution for crypt_blowfish 2021-02-16 09:12:48 +01:00
elf_aarch64_efi.lds efi bins: add an easy way for vendors to add .sbat data 2021-02-12 19:27:21 +01:00
elf_arm_efi.lds efi bins: add an easy way for vendors to add .sbat data 2021-02-12 19:27:21 +01:00
elf_ia32_efi.lds efi bins: add an easy way for vendors to add .sbat data 2021-02-12 19:27:21 +01:00
elf_ia64_efi.lds efi bins: add an easy way for vendors to add .sbat data 2021-02-12 19:27:21 +01:00
elf_x86_64_efi.lds Include missing .text sections in PE/COFF binary 2021-02-20 17:48:22 -05:00
errlog.c Fix up a bunch of our license statements and add SPDX most places 2021-02-16 09:12:48 +01:00
fallback.c fallback: show a countdown menu before reset 2021-02-16 09:12:48 +01:00
httpboot.c Fix up a bunch of our license statements and add SPDX most places 2021-02-16 09:12:48 +01:00
make-certs Use portable shebangs: /bin/bash -> /usr/bin/env bash 2020-07-23 20:53:24 -04:00
Make.coverity Try to make coverity.mk work without cov-build installed. 2021-02-15 17:20:05 -05:00
Make.defaults build: add some basic $EFI_PATH checking 2021-02-19 11:09:36 -05:00
Make.rules efi bins: add an easy way for vendors to add .sbat data 2021-02-12 19:27:21 +01:00
Make.scan-build Try to make scan-build.mk work without scan-build installed. 2021-02-15 17:20:05 -05:00
Makefile Add --set-section-alignment '.sbat=512' to objcopy command line 2021-02-20 17:50:42 -05:00
model.c Fix up a bunch of our license statements and add SPDX most places 2021-02-16 09:12:48 +01:00
mok.c Make sure MIN() and MAX() are always defined. 2021-02-16 09:12:48 +01:00
MokManager.c console: Move the countdown function to console.c 2021-02-16 09:12:48 +01:00
MokVars.txt Rename check_{white,black}list to check_{allow,deny}list 2021-02-16 09:12:48 +01:00
netboot.c src/netboot.c: remove the execute bit 2021-02-16 09:12:48 +01:00
PasswordCrypt.c Fix up a bunch of our license statements and add SPDX most places 2021-02-16 09:12:48 +01:00
pe.c sbat: make shim to parse it's own .sbat section on init 2021-02-19 14:28:10 -05:00
README.fallback New upstream version 12+1501864225.b586175 2017-08-07 17:34:45 -04:00
README.md Rename check_{white,black}list to check_{allow,deny}list 2021-02-16 09:12:48 +01:00
README.tpm Rename check_{white,black}list to check_{allow,deny}list 2021-02-16 09:12:48 +01:00
replacements.c Fix up a bunch of our license statements and add SPDX most places 2021-02-16 09:12:48 +01:00
sbat.c sbat: Fix two NULL derefs found with "gcc -fanalyzer" 2021-02-19 14:28:10 -05:00
SBAT.example.md fix not 2021-02-17 16:25:02 -08:00
SBAT.md Add --set-section-alignment '.sbat=512' to objcopy command line 2021-02-20 17:50:42 -05:00
shim.c sbat: make shim to parse it's own .sbat section on init 2021-02-19 14:28:10 -05:00
shim.h Make sure MIN() and MAX() are always defined. 2021-02-16 09:12:48 +01:00
testplan.txt Fix a bunch of trivial trailing whitespace issues. 2021-02-16 09:12:48 +01:00
TODO Add mm/fb hashing to TODO, put that and related things under 'Reproducible builds' 2021-02-15 17:20:05 -05:00
tpm.c Fix up a bunch of our license statements and add SPDX most places 2021-02-16 09:12:48 +01:00
version.c.in Fix up a bunch of our license statements and add SPDX most places 2021-02-16 09:12:48 +01:00
version.h Fix up a bunch of our license statements and add SPDX most places 2021-02-16 09:12:48 +01:00

shim, a first-stage UEFI bootloader

shim is a trivial EFI application that, when run, attempts to open and execute another application. It will initially attempt to do this via the standard EFI LoadImage() and StartImage() calls. If these fail (because Secure Boot is enabled and the binary is not signed with an appropriate key, for instance) it will then validate the binary against a built-in certificate. If this succeeds and if the binary or signing key are not forbidden then shim will relocate and execute the binary.

shim will also install a protocol which permits the second-stage bootloader to perform similar binary validation. This protocol has a GUID as described in the shim.h header file and provides a single entry point. On 64-bit systems this entry point expects to be called with SysV ABI rather than MSABI, so calls to it should not be wrapped.

On systems with a TPM chip enabled and supported by the system firmware, shim will extend various PCRs with the digests of the targets it is loading. A full list is in the file README.tpm .

To use shim, simply place a DER-encoded public certificate in a file such as pub.cer and build with make VENDOR_CERT_FILE=pub.cer.

There are a couple of build options, and a couple of ways to customize the build, described in BUILDING.