Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: src/platform/vboot_reference/tests/test_common.c

Issue 2589001: Add a kernel subkey signing algorithm key and algorithm fields to firmware preamble. (Closed) Base URL: ssh://git@gitrw.chromium.org/chromiumos
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/platform/vboot_reference/vboot_firmware/include/firmware_image_fw.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/tests/test_common.c
diff --git a/src/platform/vboot_reference/tests/test_common.c b/src/platform/vboot_reference/tests/test_common.c
index 5c39413fbd491aa37fa5728d6f2fb7306c61dd90..8270c3adca697789bd83b9411a376f70873c14c6 100644
--- a/src/platform/vboot_reference/tests/test_common.c
+++ b/src/platform/vboot_reference/tests/test_common.c
@@ -72,6 +72,12 @@ FirmwareImage* GenerateTestFirmwareImage(int algorithm,
/* Populate firmware and preamble with dummy data. */
image->firmware_version = firmware_version;
image->firmware_len = firmware_len;
+ /* Make the kernel subkey the same as the firmware signing key. */
+ image->kernel_subkey_sign_algorithm = algorithm;
+ image->kernel_subkey_sign_key = (uint8_t*) Malloc(
+ RSAProcessedKeySize(image->kernel_subkey_sign_algorithm));
+ Memcpy(image->kernel_subkey_sign_key, firmware_sign_key,
+ RSAProcessedKeySize(image->kernel_subkey_sign_algorithm));
image->preamble_signature = image->firmware_signature = NULL;
Memset(image->preamble, 'P', FIRMWARE_PREAMBLE_SIZE);
image->firmware_data = Malloc(image->firmware_len);
« no previous file with comments | « no previous file | src/platform/vboot_reference/vboot_firmware/include/firmware_image_fw.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698