summaryrefslogtreecommitdiff
path: root/tests/big_firmware_tests.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-08-27 16:17:04 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-29 21:55:46 +0000
commit78d59bffec45da47b4e8a763186723192dd24f87 (patch)
tree66ede5905f2a1e326828b3b4e25af79d2fe9fc9b /tests/big_firmware_tests.c
parent631c661be0f08a7e4770b7e767b9d57ddf0ba600 (diff)
downloadvboot-78d59bffec45da47b4e8a763186723192dd24f87.tar.gz
cleanup: remove ancient tests that haven't been run in years
There are a number of tests that haven't even been compiled in a LOOOONG time. Let's get them out of the way. We can always put them back later. I'm adding a comment to this CL in the Makefile. BUG=none BRANCH=ToT TEST=make runalltests Change-Id: Id2d9f0b71fc40e4a260f54cf919c6af5e0ff85c5 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/214610 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'tests/big_firmware_tests.c')
-rw-r--r--tests/big_firmware_tests.c75
1 files changed, 0 insertions, 75 deletions
diff --git a/tests/big_firmware_tests.c b/tests/big_firmware_tests.c
deleted file mode 100644
index efb81d14..00000000
--- a/tests/big_firmware_tests.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- *
- * Tests if firmware image library deals with very large firmware. This
- * is a quick and dirty test for detecting integer overflow issues.
- */
-
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "cryptolib.h"
-#include "file_keys.h"
-#include "firmware_image.h"
-#include "test_common.h"
-#include "utility.h"
-
-/* Choose a firmware size greater than the range of 32-bits unsigned. */
-#define BIG_FIRMWARE_SIZE (0x100000000ULL)
-
-#define ROOT_KEY_BASE_NAME "testkeys/key_rsa8192"
-#define FIRMWARE_KEY_BASE_NAME "testkeys/key_rsa1024"
-
-const char* kRootKeyPublicFile = ROOT_KEY_BASE_NAME ".keyb";
-const char* kRootKeyFile = ROOT_KEY_BASE_NAME ".pem";
-const char* kFirmwareKeyPublicFile = FIRMWARE_KEY_BASE_NAME ".keyb";
-const char* kFirmwareKeyFile = FIRMWARE_KEY_BASE_NAME ".pem";
-
-int BigFirmwareTest(void) {
- int error_code = 0;
- uint64_t len;
- uint8_t* firmware_blob = NULL;
- RSAPublicKey* root_key = RSAPublicKeyFromFile(kRootKeyPublicFile);
- uint8_t* root_key_blob = BufferFromFile(kRootKeyPublicFile, &len);
- uint8_t* firmware_sign_key_buf= BufferFromFile(kFirmwareKeyPublicFile, &len);
- VBDEBUG(("Generating Big FirmwareImage..."));
- FirmwareImage* image =
- GenerateTestFirmwareImage(0, /* RSA1024/SHA1 */
- firmware_sign_key_buf,
- 1, /* Firmware Key Version. */
- 1, /* Firmware Version */
- BIG_FIRMWARE_SIZE,
- kRootKeyFile,
- kFirmwareKeyFile,
- 'F'); /* Firmware data fill. */
- if (!root_key || !root_key_blob || !firmware_sign_key_buf || !image) {
- error_code = 1;
- goto cleanup;
- }
- VBDEBUG(("Done.\n"));
- TEST_EQ(VerifyFirmwareImage(root_key, image),
- VERIFY_FIRMWARE_SUCCESS,
- "Big FirmwareImage Verification");
- firmware_blob = GetFirmwareBlob(image, &len);
- TEST_EQ(VerifyFirmware(root_key_blob, image->firmware_data, firmware_blob),
- VERIFY_FIRMWARE_SUCCESS,
- "Big Firmware Blob Verification");
-
- cleanup:
- Free(firmware_blob);
- FirmwareImageFree(image);
- Free(firmware_sign_key_buf);
- RSAPublicKeyFree(root_key);
- return error_code;
-}
-
-int main(int argc, char* argv[1])
-{
- int error_code = 0;
- error_code = BigFirmwareTest();
- if (!gTestSuccess)
- error_code = 255;
- return error_code;
-}