forked from pool/grub2
8e26f638e0
- TPM Support (FATE#315831) * 0001-tpm-Core-TPM-support.patch * 0002-tpm-Measure-kernel-initrd.patch * 0003-tpm-Add-BIOS-boot-measurement.patch * 0004-tpm-Rework-linux-command.patch * 0005-tpm-Rework-linux16-command.patch * 0006-tpm-Measure-kernel-and-initrd-on-BIOS-systems.patch * 0007-tpm-Measure-the-kernel-commandline.patch * 0008-tpm-Measure-commands.patch * 0009-tpm-Measure-multiboot-images-and-modules.patch * 0010-tpm-Fix-boot-when-there-s-no-TPM.patch * 0011-tpm-Fix-build-error.patch * 0012-tpm-Build-tpm-as-module.patch - grub2.spec : Add grub-tpm.efi for Secure Boot OBS-URL: https://build.opensuse.org/request/show/477882 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=263
74 lines
2.3 KiB
Diff
74 lines
2.3 KiB
Diff
From fd82340829d9fce685f80163ddb6ee3399929c3c Mon Sep 17 00:00:00 2001
|
|
From: Matthew Garrett <mjg59@coreos.com>
|
|
Date: Tue, 1 Sep 2015 16:02:55 -0700
|
|
Subject: [PATCH 09/11] Measure multiboot images and modules
|
|
|
|
---
|
|
grub-core/loader/i386/multiboot_mbi.c | 3 +++
|
|
grub-core/loader/multiboot.c | 2 ++
|
|
grub-core/loader/multiboot_mbi2.c | 3 +++
|
|
3 files changed, 8 insertions(+)
|
|
|
|
Index: grub-2.02~rc1/grub-core/loader/i386/multiboot_mbi.c
|
|
===================================================================
|
|
--- grub-2.02~rc1.orig/grub-core/loader/i386/multiboot_mbi.c
|
|
+++ grub-2.02~rc1/grub-core/loader/i386/multiboot_mbi.c
|
|
@@ -36,6 +36,7 @@
|
|
#include <grub/net.h>
|
|
#include <grub/i18n.h>
|
|
#include <grub/lib/cmdline.h>
|
|
+#include <grub/tpm.h>
|
|
|
|
#ifdef GRUB_MACHINE_EFI
|
|
#include <grub/efi/efi.h>
|
|
@@ -173,6 +174,8 @@ grub_multiboot_load (grub_file_t file, c
|
|
return grub_errno;
|
|
}
|
|
|
|
+ grub_tpm_measure((unsigned char*)buffer, len, GRUB_BINARY_PCR, "grub_multiboot", filename);
|
|
+
|
|
header = find_header (buffer, len);
|
|
|
|
if (header == 0)
|
|
Index: grub-2.02~rc1/grub-core/loader/multiboot.c
|
|
===================================================================
|
|
--- grub-2.02~rc1.orig/grub-core/loader/multiboot.c
|
|
+++ grub-2.02~rc1/grub-core/loader/multiboot.c
|
|
@@ -42,6 +42,7 @@
|
|
#include <grub/video.h>
|
|
#include <grub/memory.h>
|
|
#include <grub/i18n.h>
|
|
+#include <grub/tpm.h>
|
|
|
|
GRUB_MOD_LICENSE ("GPLv3+");
|
|
|
|
@@ -424,6 +425,7 @@ grub_cmd_module (grub_command_t cmd __at
|
|
}
|
|
|
|
grub_file_close (file);
|
|
+ grub_tpm_measure (module, size, GRUB_BINARY_PCR, "grub_multiboot", argv[0]);
|
|
return GRUB_ERR_NONE;
|
|
}
|
|
|
|
Index: grub-2.02~rc1/grub-core/loader/multiboot_mbi2.c
|
|
===================================================================
|
|
--- grub-2.02~rc1.orig/grub-core/loader/multiboot_mbi2.c
|
|
+++ grub-2.02~rc1/grub-core/loader/multiboot_mbi2.c
|
|
@@ -36,6 +36,7 @@
|
|
#include <grub/i18n.h>
|
|
#include <grub/net.h>
|
|
#include <grub/lib/cmdline.h>
|
|
+#include <grub/tpm.h>
|
|
|
|
#if defined (GRUB_MACHINE_EFI)
|
|
#include <grub/efi/efi.h>
|
|
@@ -131,6 +132,8 @@ grub_multiboot_load (grub_file_t file, c
|
|
|
|
COMPILE_TIME_ASSERT (MULTIBOOT_HEADER_ALIGN % 4 == 0);
|
|
|
|
+ grub_tpm_measure ((unsigned char *)mld.buffer, len, GRUB_BINARY_PCR, "grub_multiboot", filename);
|
|
+
|
|
header = find_header (mld.buffer, len);
|
|
|
|
if (header == 0)
|