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 # Run verified boot firmware and kernel verification tests. | 7 # Run verified boot firmware and kernel verification tests. |
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 12 matching lines...) Expand all Loading... |
23 ${TESTKEY_DIR}/key_rsa8192.keyb \ | 23 ${TESTKEY_DIR}/key_rsa8192.keyb \ |
24 ${TESTKEY_DIR}/key_rsa${keylen}.pem \ | 24 ${TESTKEY_DIR}/key_rsa${keylen}.pem \ |
25 ${TESTKEY_DIR}/key_rsa${keylen}.keyb | 25 ${TESTKEY_DIR}/key_rsa${keylen}.keyb |
26 if [ $? -ne 0 ] | 26 if [ $? -ne 0 ] |
27 then | 27 then |
28 return_code=255 | 28 return_code=255 |
29 fi | 29 fi |
30 let algorithmcounter=algorithmcounter+1 | 30 let algorithmcounter=algorithmcounter+1 |
31 done | 31 done |
32 done | 32 done |
33 cd ${TEST_DIR} && ${TEST_DIR}/big_firmware_tests | |
34 if [ $? -ne 0 ] | |
35 then | |
36 return_code=255 | |
37 fi | |
38 } | 33 } |
39 | 34 |
40 function test_kernel_verification { | 35 function test_kernel_verification { |
41 # Test for various combinations of firmware signing algorithm and | 36 # Test for various combinations of firmware signing algorithm and |
42 # kernel signing algorithm | 37 # kernel signing algorithm |
43 firmware_algorithmcounter=0 | 38 firmware_algorithmcounter=0 |
44 kernel_algorithmcounter=0 | 39 kernel_algorithmcounter=0 |
45 for firmware_keylen in ${key_lengths[@]} | 40 for firmware_keylen in ${key_lengths[@]} |
46 do | 41 do |
47 for firmware_hashalgo in ${hash_algos[@]} | 42 for firmware_hashalgo in ${hash_algos[@]} |
(...skipping 16 matching lines...) Expand all Loading... |
64 if [ $? -ne 0 ] | 59 if [ $? -ne 0 ] |
65 then | 60 then |
66 return_code=255 | 61 return_code=255 |
67 fi | 62 fi |
68 let kernel_algorithmcounter=kernel_algorithmcounter+1 | 63 let kernel_algorithmcounter=kernel_algorithmcounter+1 |
69 done | 64 done |
70 done | 65 done |
71 let firmware_algorithmcounter=firmware_algorithmcounter+1 | 66 let firmware_algorithmcounter=firmware_algorithmcounter+1 |
72 done | 67 done |
73 done | 68 done |
74 cd ${TEST_DIR} && ${TEST_DIR}/big_kernel_tests | |
75 if [ $? -ne 0 ] | |
76 then | |
77 return_code=255 | |
78 fi | |
79 } | 69 } |
80 | 70 |
81 check_test_keys | 71 check_test_keys |
82 echo | 72 echo |
83 echo "Testing high-level firmware image verification..." | 73 echo "Testing high-level firmware image verification..." |
84 test_firmware_verification | 74 test_firmware_verification |
85 | 75 |
86 echo | 76 echo |
87 echo "Testing high-level kernel image verification..." | 77 echo "Testing high-level kernel image verification..." |
88 test_kernel_verification | 78 test_kernel_verification |
89 | 79 |
90 exit $return_code | 80 exit $return_code |
OLD | NEW |