Skip to content

Commit 7346750

Browse files
committed
update documentation
1 parent a85f3e3 commit 7346750

1 file changed

Lines changed: 43 additions & 2 deletions

File tree

README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,50 @@ sudo dnf install gnu-efi-devel
3535
sudo make install
3636
```
3737

38-
### Create and enroll your keys (FIXME)
38+
### Create and enroll your keys
3939

40-
Copy the `.vardata` files to the efivars filesystem (requires administrator privilege):
40+
Keys and certificates can be created with the `openssl x509` command; see [Controlling Secure Boot](https://www.rodsbooks.com/efi-bootloaders/controlling-sb.html).
41+
Let's assume you have created three pairs consisting of 6 files:
42+
43+
```
44+
PK.key PK.crt
45+
KEK.key KEK.crt
46+
myOrg.key myOrg.crt
47+
```
48+
49+
We could have called the last pair `db.key` and `db.crt`. But let's assume for now that we also want to enroll the "fedora secure boot signing certificate" along with `myOrg.crt`.
50+
51+
The fedora certificate comes in the form of an additional file `fedora.crt`. Note that we do not have the corresponding private key.
52+
53+
Choose a guid and convert all your `crt` files to "efi-siglist" format:
54+
55+
```sh
56+
guid=4212023e-a290-11f0-bd3b-e446b04ad651
57+
for name in PK KEK myOrg fedora; do
58+
cert-to-efi-sig-list -g $guid $name.crt $name.esl
59+
done
60+
```
61+
62+
The `esl` files can be concatenated. Combine `myOrg.esl` and `fedora.esl` to create `db.esl`:
63+
64+
```sh
65+
cat myOrg.esl fedora.esl > db.esl
66+
```
67+
68+
Now sign your `esl` files, thus creating three files `PK.vardata`, `KEK.vardata` and `db.vardata`:
69+
70+
```sh
71+
timestamp="2025-10-06 12:00:01"
72+
# PK signs PK
73+
sign-efi-siglist -g $guid -t "$timestamp" -k PK.key -c PK.crt PK PK.esl PK.vardata
74+
# PK signs KEK
75+
sign-efi-siglist -g $guid -t "$timestamp" -k PK.key -c PK.crt KEK KEK.esl KEK.vardata
76+
# KEK signs db
77+
sign-efi-siglist -g $guid -t "$timestamp" -k KEK.key -c KEK.crt db db.esl db.vardata
78+
```
79+
80+
The `vardata` files do not contain private key data, so they can be shared.
81+
Boot the target system in "Secure Boot Setup Mode" and enroll your keys:
4182

4283
```sh
4384
chattr -i /sys/firmware/efi/efivars/*

0 commit comments

Comments
 (0)