path: root/common/recipes-core
diff options
authorCalifornia Sullivan <>2017-08-28 22:18:59 (GMT)
committerSaul Wold <>2017-08-30 21:25:24 (GMT)
commit7465f7fc99d11f469382bacae514ccfc5006dbe1 (patch)
treedeaa3e1e79fe7f35b2e45e1b6cc2b4710978e7ef /common/recipes-core
parentb03fee437831c35d7064241703704045d7aa3820 (diff)
ovmf: add secureboot bits from refkit
This patch adds a couple secureboot elements to ovmf that originated from refkit. It includes a patch that adds a certificate to the ovmf's enrolled keys, and an image recipe which calls the enrollkeys app. Original work by Mikko Ylinen and Patrick Ohly. Signed-off-by: California Sullivan <> Signed-off-by: Saul Wold <>
Diffstat (limited to 'common/recipes-core')
3 files changed, 124 insertions, 0 deletions
diff --git a/common/recipes-core/ovmf/files/0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch b/common/recipes-core/ovmf/files/0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch
new file mode 100644
index 0000000..62db063
--- /dev/null
+++ b/common/recipes-core/ovmf/files/0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch
@@ -0,0 +1,105 @@
1From 48e511481d83c1614cd00a5a2edcf6b5d746b9c4 Mon Sep 17 00:00:00 2001
2From: Mikko Ylinen <>
3Date: Fri, 7 Apr 2017 12:06:14 +0300
4Subject: [PATCH] ovmf: RefkitTestCA: TEST UEFI SecureBoot
6This patch adds refkit-db.cer (via xxd -i) in OVMF's db
7signature database when used with EnrollDefaultKeys EFI
8application. It's used for testing purposes only.
10Images signed with refkit-db keys are allowed to boot.
12Signed-off-by: Mikko Ylinen <>
14 OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c | 68 +++++++++++++++++++++++++++
15 1 file changed, 68 insertions(+)
17diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
18index 24ab977..a3c12ba 100644
19--- a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
20+++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
21@@ -516,6 +516,73 @@ STATIC CONST UINT8 MicrosoftUefiCA[] = {
22 0x07, 0x92, 0x9b, 0xf5, 0xa6, 0xbc, 0x59, 0x83, 0x58
23 };
25+STATIC CONST UINT8 RefkitTestCA[] = {
26+ 0x30, 0x82, 0x02, 0xfb, 0x30, 0x82, 0x01, 0xe3, 0xa0, 0x03, 0x02, 0x01,
27+ 0x02, 0x02, 0x09, 0x00, 0xd4, 0xf6, 0x48, 0xc2, 0x68, 0x19, 0x91, 0xac,
28+ 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
29+ 0x0b, 0x05, 0x00, 0x30, 0x14, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55,
30+ 0x04, 0x03, 0x0c, 0x09, 0x72, 0x65, 0x66, 0x6b, 0x69, 0x74, 0x2d, 0x64,
31+ 0x62, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x37, 0x30, 0x34, 0x32, 0x30, 0x31,
32+ 0x32, 0x30, 0x36, 0x33, 0x32, 0x5a, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x34,
33+ 0x32, 0x30, 0x31, 0x32, 0x30, 0x36, 0x33, 0x32, 0x5a, 0x30, 0x14, 0x31,
34+ 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x09, 0x72, 0x65,
35+ 0x66, 0x6b, 0x69, 0x74, 0x2d, 0x64, 0x62, 0x30, 0x82, 0x01, 0x22, 0x30,
36+ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
37+ 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02,
38+ 0x82, 0x01, 0x01, 0x00, 0xb4, 0x1c, 0x22, 0xa6, 0x22, 0x01, 0x57, 0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x81, 0x2a, 0xf1, 0x78, 0x73, 0x41, 0xdb,
54+ 0x54, 0xce, 0x7c, 0xce, 0xa2, 0xe3, 0x90, 0x4f, 0x45, 0x1a, 0xf9, 0x3d,
55+ 0x88, 0xfc, 0x0e, 0xed, 0xd3, 0x69, 0x22, 0x4c, 0xfa, 0x0a, 0x69, 0xd1,
56+ 0x48, 0xc0, 0xaa, 0xa9, 0x3a, 0xb3, 0x8f, 0x10, 0x3a, 0x76, 0xa8, 0x0c,
57+ 0x7a, 0x3d, 0xd8, 0x79, 0xce, 0x1c, 0x96, 0x62, 0xf4, 0x06, 0xee, 0x47,
58+ 0xe8, 0xe0, 0x69, 0x91, 0xae, 0xea, 0x34, 0xcf, 0xda, 0xa8, 0xb4, 0x39,
59+ 0x5e, 0xf3, 0x7a, 0xd0, 0x88, 0x48, 0x47, 0x69, 0x02, 0x03, 0x01, 0x00,
60+ 0x01, 0xa3, 0x50, 0x30, 0x4e, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e,
61+ 0x04, 0x16, 0x04, 0x14, 0x68, 0x60, 0x11, 0x25, 0x85, 0x14, 0x78, 0x1b,
62+ 0x1a, 0x9f, 0x46, 0x12, 0xe6, 0x21, 0xe4, 0xef, 0xfb, 0x3b, 0xaa, 0xdd,
63+ 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80,
64+ 0x14, 0x68, 0x60, 0x11, 0x25, 0x85, 0x14, 0x78, 0x1b, 0x1a, 0x9f, 0x46,
65+ 0x12, 0xe6, 0x21, 0xe4, 0xef, 0xfb, 0x3b, 0xaa, 0xdd, 0x30, 0x0c, 0x06,
66+ 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30,
67+ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b,
68+ 0x05, 0x00, 0x03, 0x82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 0x58, 0x14,
83+ 0x46, 0x30, 0x09, 0x7c, 0x55, 0x64, 0x83, 0x0b, 0xb9, 0xdf, 0xcf, 0x25,
84+ 0xee, 0xec, 0xf7, 0xcb, 0xdb, 0xd1, 0x5b, 0x93, 0x93, 0xc8, 0x8a, 0x10,
85+ 0x46, 0xb8, 0xb0, 0x35, 0x1c, 0x6c, 0x0d, 0x8f, 0x03, 0x6a, 0x8f, 0x1b,
86+ 0x36, 0x68, 0xf3, 0x53, 0x89, 0x36, 0x5b, 0x21, 0x80, 0xde, 0xe3, 0x92,
87+ 0x52, 0x94, 0x97, 0x9d, 0x49, 0x89, 0x7d, 0x3e, 0xde, 0x29, 0x51, 0xba,
88+ 0x11, 0xf7, 0xba, 0x01, 0xf7, 0xab, 0xea, 0xc1, 0xa7, 0x2e, 0xa3, 0x4d,
89+ 0x65, 0xfd, 0x40, 0x71, 0xf1, 0xe2, 0x3f, 0x6c, 0x28, 0xcb, 0xd3
92 //
93 // The most important thing about the variable payload is that it is a list of
94 // lists, where the element size of any given *inner* list is constant.
95@@ -908,6 +975,7 @@ ShellAppMain (
96 &gEfiImageSecurityDatabaseGuid,
97 MicrosoftPCA, sizeof MicrosoftPCA, &gEfiCallerIdGuid,
98 MicrosoftUefiCA, sizeof MicrosoftUefiCA, &gEfiCallerIdGuid,
99+ RefkitTestCA, sizeof RefkitTestCA, &gEfiCallerIdGuid,
100 NULL);
101 if (EFI_ERROR (Status)) {
102 return 1;
diff --git a/common/recipes-core/ovmf/ b/common/recipes-core/ovmf/
new file mode 100644
index 0000000..b20f6e5
--- /dev/null
+++ b/common/recipes-core/ovmf/
@@ -0,0 +1,13 @@
1require recipes-core/ovmf/
3WKS_SEARCH_PATH_append = ":${COREBASE}/meta/recipes-core/ovmf"
5QB_DRIVE_TYPE = "/dev/vd"
7do_image_append() {
8 cat > ${IMAGE_ROOTFS}/startup.nsh << EOF
diff --git a/common/recipes-core/ovmf/ovmf_%.bbappend b/common/recipes-core/ovmf/ovmf_%.bbappend
new file mode 100644
index 0000000..25b6075
--- /dev/null
+++ b/common/recipes-core/ovmf/ovmf_%.bbappend
@@ -0,0 +1,6 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
3SRC_URI_append_intel-x86-common = " \
4 file://0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch \
6PACKAGECONFIG_append_intel-x86-common = " secureboot"