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

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

Issue 1578035: Change VerifyFirmware() to take separate pointers to firmware verification header and firmware data. (Closed)
Patch Set: review fixes Created 10 years, 8 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
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 5fcdc5e799b110b266539a774a38ad6fb1933851..6f68d35273825124e3a097a364f9f8f5fb312d95 100644
--- a/src/platform/vboot_reference/tests/test_common.c
+++ b/src/platform/vboot_reference/tests/test_common.c
@@ -80,13 +80,13 @@ FirmwareImage* GenerateTestFirmwareImage(int algorithm,
return image;
}
-uint8_t* GenerateTestFirmwareBlob(int algorithm,
- const uint8_t* firmware_sign_key,
- int firmware_key_version,
- int firmware_version,
- uint64_t firmware_len,
- const char* root_key_file,
- const char* firmware_key_file) {
+uint8_t* GenerateTestVerificationBlob(int algorithm,
+ const uint8_t* firmware_sign_key,
+ int firmware_key_version,
+ int firmware_version,
+ uint64_t firmware_len,
+ const char* root_key_file,
+ const char* firmware_key_file) {
FirmwareImage* image = NULL;
uint8_t* firmware_blob = NULL;
uint64_t firmware_blob_len = 0;
@@ -104,12 +104,11 @@ uint8_t* GenerateTestFirmwareBlob(int algorithm,
return firmware_blob;
}
-uint8_t* GenerateRollbackTestFirmwareBlob(int firmware_key_version,
- int firmware_version,
- int is_corrupt) {
+uint8_t* GenerateRollbackTestVerificationBlob(int firmware_key_version,
+ int firmware_version) {
FirmwareImage* image = NULL;
uint64_t len;
- uint8_t* firmware_blob = NULL;
+ uint8_t* verification_blob = NULL;
uint8_t* firmware_sign_key = NULL;
firmware_sign_key = BufferFromFile("testkeys/key_rsa1024.keyb",
@@ -126,14 +125,9 @@ uint8_t* GenerateRollbackTestFirmwareBlob(int firmware_key_version,
'F');
if (!image)
return NULL;
- if (is_corrupt) {
- /* Invalidate image. */
- Memset(image->firmware_data, 'X', image->firmware_len);
- }
-
- firmware_blob = GetFirmwareBlob(image, &len);
+ verification_blob = GetFirmwareBlob(image, &len);
FirmwareImageFree(image);
- return firmware_blob;
+ return verification_blob;
}
« no previous file with comments | « src/platform/vboot_reference/tests/test_common.h ('k') | src/platform/vboot_reference/tests/verify_firmware_fuzz_driver.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698