pub/scm/linux/kernel/git/jejb/efitools.git  about / heads / tags
UEFI secure boot toolkit
$ git log --pretty=format:'%h %s (%cs)%d'
392836a Version: 1.9.2 (2019-01-08)
	(HEAD -> master, tag: v1.9.2)
dac1ff8 sha256: do not align raw section sizes (2019-01-08)
05fa125 sign-efi-sig-list: add man page entry for engine option (2019-01-07)
141a106 Version: 1.9.1 (2019-01-06)
	(tag: v1.9.1)
8b69565 Makefile: Reverse the order of lib.a and -lcrypto (2019-01-06)
48a9687 Version: 1.9.0 (2019-01-06)
	(tag: v1.9.0)
e57bafc use SignedData instead of PKCS7 for variable updates (2019-01-05)
7c4991f support engine based keys (2019-01-05)
0844b10 factor out variable signing code (2019-01-05)
ff81e55 efi-updatevar: remove all authenticated attributes from signature (2018-12-18)
...

$ git cat-file blob HEAD:README
How to use these files

simply typing make will build you everything including sample certificates for
PK, KEK and db.

The prerequisites are the standard development environment, gnu-efi version
3.0q or later, help2man and sbsigntools.

There will be one file called LockDown.efi.  If run on your efi platform in
Setup Mode, this binary will *replace* all the values in the PK, KEK and db
variables with the ones you just generated and place the platform back into
User Mode (booting securely).  If you don't want to replace all the variables,
take a dump of your current variables, see sig-list-to-cert(1), and add them
to the EFI signature list files before creating LockDown.efi

Say you want to concatenate an existing platform-db.esl file, do this:

make DB.esl
cat platform.esl DB.esl > newDB.esl
mv newDB.esl DB.esl

and then make LockDown.efi in the usual way.

All of the EFI programs are also generated in signed form (signed by both db
and KEK).


Loader.efi
==========

This EFI binary is created to boot an unsigned EFI file on the platform. Since
this explicitly breaks the security of the platform, it will first check to
see if the boot binary is naturally executable and execute it if it is (either
it's properly signed or the platform isn't in Secure Boot mode).  If the
binary gives an EFI_ACCESS_DENIED error meaning it isn't properly signed,
Loader.efi will request present user authorisation before proceeding to boot.

The idea is that Loader.efi may serve as a chain for elilo.efi or another boot
loader on distributed linux live and install CDs and even as the boot loader
for the distribution on the hard disk assuming the user does not wish to take
control of the platform and replace the keys.

To build a secure bootable CD, simply use Loader.efi as the usual
/efi/boot/bootX64.efi and place the usual loader in the same directory as the
file boot.efi.

In order to add further convenience, if the user places the platform in setup
mode and re-runs the loader, it will ask permission to add the signature the
unsigned boot loader, boot.efi, to the authorised signatures database, meaning
Loader.efi will now no longer ask for present user authorisation every time
the system is started.


Creating, using and installing your own keys
============================================

To create PEM files with the certificate and the key for PK for example, do

openssl req -new -x509 -newkey rsa:2048 -subj "/CN=PK/" -keyout PK.key -out PK.crt -days 3650 -nodes -sha256

Which will create a self signed X509 certificate for PK in PK.crt (using
unprotected key PK.key with the subject common name PK (that's what the CN=PK
is doing).

You need to create at least three sets of certificates: one for PK, one for
KEK and one for db.

Now you need to take all the efi binaries in /usr/share/efitools/efi and sign
them with your own db key using

sbsign --key db.key --cert db.crt --output HelloWorld-signed.efi HelloWorld.efi

To install your new keys on the platform, first create your authorised update
bundles:

cert-to-sig-list PK.crt PK.esl
sign-efi-sig-list -k PK.key -c PK.crt PK PK.esl PK.auth

And repeat for KEK and db.  In setup mode, it only matters that the PK update
PK.auth is signed by the new platform key.  None of the other variables will
have their signatures checked.

Now on your platform update the variables, remembering to do PK last because
an update to PK usually puts the platform into secure mode

UpdateVars db db.auth
UpdateVars KEK KEK.auth
UpdateVars PK PK.auth

And you should now be running in secure mode with your own keys.

# heads (aka `branches'):
$ git for-each-ref --sort=-creatordate refs/heads \
	--format='%(HEAD) %(refname:short) %(subject) (%(creatordate:short))'
* master       Version: 1.9.2 (2019-01-08)

# tags:
$ git for-each-ref --sort=-creatordate refs/tags \
	--format='%(refname:short) %(subject) (%(creatordate:short))'
v1.9.2       Version 1.9.2 (2019-01-08) tar.gz
v1.9.1       version 1.9.1 (2019-01-06) tar.gz
v1.9.0       version 1.9.0 (2019-01-06) tar.gz
v1.8.1       version 1.8.1 (2018-02-20) tar.gz
v1.8.0       Version: 1.8.0 (2017-10-19) tar.gz
v1.7.0       Version: 1.7.0 (2016-03-25) tar.gz
v1.6.1       Version: 1.6.1 (2016-02-14) tar.gz
v1.6.0       Version: 1.6.0 (2016-02-09) tar.gz
v1.5.3       V1.5.3 (2015-03-12) tar.gz
v1.5.2       V1.5.2 (2015-01-22) tar.gz
...

# associated public inboxes:
# (number on the left is used for dev purposes)
          4 lkml
          4 linux-devicetree
          4 linux-arm-kernel
          3 linux-rockchip
          3 u-boot
          2 linux-samsung-soc
          2 qemu-devel
          2 netdev
          2 linux-btrfs
          2 linux-rdma
          2 linux-ext4
          2 dpdk-dev
          2 linuxppc-dev
          2 git
          2 dri-devel
          2 intel-gfx
          2 ceph-devel
          2 linux-raid
          2 dm-devel
          2 lvm-devel
          1 linux-fscrypt
          1 linux-wireless
          1 linux-mtd
          1 cocci
          1 linux-block
          1 linux-riscv
          1 linux-nvme
          1 linux-xfs
          1 live-patching
          1 bpf
          1 linux-nfs
          1 linux-mediatek
          1 linux-crypto
          1 linux-efi
          1 linux-acpi
          1 netfilter-devel
          1 linux-integrity
          1 linux-fsdevel
          1 linux-edac
          1 linux-cifs
          1 linux-arm-msm
          1 linux-amlogic
          1 linux-erofs
          1 linux-mm
          1 linux-nvdimm
          1 linux-iommu
          1 linux-media
          1 xen-devel
          1 stable
          1 linux-snps-arc
          1 linux-mips
          1 fstests
          1 linux-pm
          1 linux-hwmon
          1 linux-rtc
          1 linux-input
          1 alsa-devel
          1 linux-scsi
          1 kvmarm
          1 driverdev-devel
          1 linux-usb
          1 linux-renesas-soc
          1 linux-kselftest
          1 selinux
          1 kernel-hardening
          1 linux-clk
          1 linux-iio
          1 linux-gpio
          1 dmaengine
          1 linux-next
          1 linux-parisc
          1 linux-leds
          1 linux-security-module
          1 linux-pci
          1 linux-f2fs-devel
          1 kvm
          1 linux-modules
          1 kernelnewbies
          1 linux-rt-users
          1 linux-bluetooth
          1 linux-sgx
          1 linux-ide
          1 linux-serial
          1 linux-watchdog
          1 linux-trace-devel
          1 linux-hyperv
          1 workflows
          1 rcu
          1 linux-m68k
          1 linux-i3c
          1 util-linux
          1 linux-spdx
          1 linux-wpan
          1 ksummit-discuss
          1 wireguard
          1 backports
          1 io-uring
          1 linux-kernel-mentees
          1 linux-doc
          1 linux-csky
          1 linux-man
          1 linux-mmc
          1 amd-gfx
          1 tpmdd-devel
          1 linux-unionfs
          1 linux-firmware
          1 linux-api
          1 cip-dev
          1 linux-omap
          1 linux-audit
          1 linux-spi
          1 linux-i2c
          1 linux-remoteproc
          1 linux-dash
          1 linux-bcache
          1 linux-sparse
          1 mm-commits
          1 linux-pwm
          1 linux-tegra
          1 lttng-dev
          1 virtualization
          1 linux-kbuild
          1 linux-fpga
          1 linux-arch
          1 linux-can
          1 containers
          1 xdp-newbies
          1 platform-driver-x86
          1 phone-devel
          1 openbmc
          1 linux-hardening
          1 dash
          1 keyrings
          1 linux-fbdev
          1 linux-sctp
          1 linux-cxl
          1 linux-perf-users
          1 target-devel
          1 lustre-devel
          1 linux-sh
          1 soc
          1 ocfs2-devel
          1 rust-for-linux
          1 ath10k
          1 ath11k
          1 nouveau
          1 linux-phy
          1 linux-s390
          1 kernel-janitors
          1 sparclinux
          1 linux-staging
          1 linux-sunxi
          1 mptcp
          1 linux-coco
          1 regressions
          1 ksummit
          1 b43-dev
          1 nvdimm
          1 linux-nfc
          1 linux-bcachefs
          1 ath9k-devel
          1 buildroot
          1 ntfs3
          1 llvm
          1 fio
          1 iwd
          1 ell
          1 ofono
          1 ltp
          1 yocto
          1 yocto-meta-freescale
          1 openembedded-core
          1 yocto-toaster
          1 yocto-meta-arm
          1 yocto-docs
          1 openembedded-devel
          1 bitbake-devel
          1 linux-patches
          1 yocto-meta-virtualization
          1 chrome-platform
          1 ntb
          1 yocto-meta-ti
          1 yocto-meta-arago
          1 outreachy
          1 xenomai
          1 damon
          1 asahi
          1 openrisc
          1 intel-wired-lan
          1 kexec
          1 loongarch
          1 imx
          1 ath12k
          1 b4-sent
          1 linux-trace-kernel
          1 oe-linux-nfc
          1 oe-kbuild-all
          1 oe-chipsec
          1 batman
          1 intel-xe
          1 linux-um
          1 virtio-dev
          1 virtio-comment
          1 v9fs
          1 ecryptfs
          1 poky
          1 qemu-riscv
          1 linux-ia64
          1 cluster-devel
          1 grub-devel
          1 kbd
          1 autofs
          1 cpufreq
          1 dccp
          1 cgroups
          1 devicetree-spec
          1 devicetree-compiler
          1 initramfs
          1 kvm-ppc
          1 hail-devel
          1 kvm-ia64
          1 linux-8086
          1 kernel-testers
          1 linux-alpha
          1 linux-btrace
          1 linux-embedded
          1 linux-hams
          1 linux-hexagon
          1 linux-hotplug
          1 linux-laptop
          1 linux-sound
          1 trinity
          1 reiserfs-devel
          1 linux-metag
          1 linux-x25
          1 linux-nilfs
          1 lvs-devel
          1 netfilter
          1 linux-oxnas
          1 u-boot-amlogic
          1 lm-sensors
          1 acpica-devel
          1 perfbook
          1 virtio-fs
          1 smatch
          1 ../../../../../../../fuego
          1 ../../../../../../../wireless-regdb
          1 ../../../../../../../igt-dev
          1 ../../../../../../../powertop

git clone https://yhbt.net/lore/pub/scm/linux/kernel/git/jejb/efitools.git