OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Generate test cases for use for the RSA verify benchmark. | 7 # Generate test cases for use for the RSA verify benchmark. |
8 | 8 |
9 # Load common constants and variables. | 9 # Load common constants and variables. |
10 . "$(dirname "$0")/common.sh" | 10 . "$(dirname "$0")/common.sh" |
(...skipping 15 matching lines...) Expand all Loading... |
26 --firmware_sign_key_pub ${TESTKEY_DIR}/key_rsa4096.keyb \ | 26 --firmware_sign_key_pub ${TESTKEY_DIR}/key_rsa4096.keyb \ |
27 --firmware_sign_algorithm 8 \ | 27 --firmware_sign_algorithm 8 \ |
28 --firmware_key_version 1 \ | 28 --firmware_key_version 1 \ |
29 --firmware_version 1 \ | 29 --firmware_version 1 \ |
30 --out ${TESTCASE_DIR}/firmware.signed | 30 --out ${TESTCASE_DIR}/firmware.signed |
31 cp ${TESTKEY_DIR}/key_rsa8192.keyb ${TESTCASE_DIR}/root_key.keyb | 31 cp ${TESTKEY_DIR}/key_rsa8192.keyb ${TESTCASE_DIR}/root_key.keyb |
32 | 32 |
33 echo "Generating signed kernel test image..." | 33 echo "Generating signed kernel test image..." |
34 # Generate a test verified boot kernel image and copy firmware public key. | 34 # Generate a test verified boot kernel image and copy firmware public key. |
35 ${UTIL_DIR}/kernel_utility --generate \ | 35 ${UTIL_DIR}/kernel_utility --generate \ |
36 --in $1 \ | |
37 --firmware_key ${TESTKEY_DIR}/key_rsa4096.pem \ | 36 --firmware_key ${TESTKEY_DIR}/key_rsa4096.pem \ |
38 --kernel_key ${TESTKEY_DIR}/key_rsa1024.pem \ | 37 --kernel_key ${TESTKEY_DIR}/key_rsa1024.pem \ |
39 --kernel_key_pub ${TESTKEY_DIR}/key_rsa1024.keyb \ | 38 --kernel_key_pub ${TESTKEY_DIR}/key_rsa1024.keyb \ |
40 --firmware_sign_algorithm 8 \ | 39 --firmware_sign_algorithm 8 \ |
41 --kernel_sign_algorithm 2 \ | 40 --kernel_sign_algorithm 2 \ |
42 --kernel_key_version 1 \ | 41 --kernel_key_version 1 \ |
43 --kernel_version 1 \ | 42 --kernel_version 1 \ |
| 43 --vmlinuz /dev/null \ |
| 44 --config /dev/null \ |
| 45 --bootloader ${TEST_FILE} \ |
44 --out ${TESTCASE_DIR}/kernel.signed | 46 --out ${TESTCASE_DIR}/kernel.signed |
45 cp ${TESTKEY_DIR}/key_rsa4096.keyb ${TESTCASE_DIR}/firmware_key.keyb | 47 cp ${TESTKEY_DIR}/key_rsa4096.keyb ${TESTCASE_DIR}/firmware_key.keyb |
46 } | 48 } |
47 | 49 |
48 function pre_work { | 50 function pre_work { |
49 # Generate a file to serve as random bytes for firmware/kernel contents. | 51 # Generate a file to serve as random bytes for firmware/kernel contents. |
| 52 # NOTE: The kernel and config file can't really be random, but the bootloader |
| 53 # can. That's probably close enough. |
50 echo "Generating test file..." | 54 echo "Generating test file..." |
51 dd if=/dev/urandom of=${TEST_FILE} bs=${TEST_FILE_SIZE} count=1 | 55 dd if=/dev/urandom of=${TEST_FILE} bs=${TEST_FILE_SIZE} count=1 |
52 } | 56 } |
53 mkdir -p ${TESTCASE_DIR} | 57 mkdir -p ${TESTCASE_DIR} |
54 pre_work | 58 pre_work |
55 check_test_keys | 59 check_test_keys |
56 generate_fuzzing_images ${TEST_FILE} | 60 generate_fuzzing_images ${TEST_FILE} |
OLD | NEW |