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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 RSA-${signing_keylen}/${signing_hashalgo}${COL_STOP} \ | 62 RSA-${signing_keylen}/${signing_hashalgo}${COL_STOP} \ |
63 and ${COL_YELLOW}data key algorithm RSA-${datakeylen}/\ | 63 and ${COL_YELLOW}data key algorithm RSA-${datakeylen}/\ |
64 ${datahashalgo}${COL_STOP}" | 64 ${datahashalgo}${COL_STOP}" |
65 # Remove old file | 65 # Remove old file |
66 keyblockfile=${TESTKEY_DIR}/sign${signing_algorithmcounter}_data${data
_algorithmcounter}.keyblock | 66 keyblockfile=${TESTKEY_DIR}/sign${signing_algorithmcounter}_data${data
_algorithmcounter}.keyblock |
67 rm -f ${keyblockfile} | 67 rm -f ${keyblockfile} |
68 | 68 |
69 # Pack | 69 # Pack |
70 ${UTIL_DIR}/vbutil_keyblock --pack ${keyblockfile} \ | 70 ${UTIL_DIR}/vbutil_keyblock --pack ${keyblockfile} \ |
71 --datapubkey \ | 71 --datapubkey \ |
72 tests/testkeys/key_alg${data_algorithmcounter}.vbpubk \ | 72 ${TESTKEY_DIR}/key_alg${data_algorithmcounter}.vbpubk \ |
73 --signprivate ${TESTKEY_DIR}/key_rsa${signing_keylen}.pem \ | 73 --signprivate ${TESTKEY_DIR}/key_rsa${signing_keylen}.pem \ |
74 --algorithm $signing_algorithmcounter | 74 --algorithm $signing_algorithmcounter |
75 if [ $? -ne 0 ] | 75 if [ $? -ne 0 ] |
76 then | 76 then |
77 return_code=255 | 77 return_code=255 |
78 fi | 78 fi |
79 | 79 |
80 # Unpack | 80 # Unpack |
81 ${UTIL_DIR}/vbutil_keyblock --unpack ${keyblockfile} \ | 81 ${UTIL_DIR}/vbutil_keyblock --unpack ${keyblockfile} \ |
82 --signpubkey \ | 82 --signpubkey \ |
83 tests/testkeys/key_alg${signing_algorithmcounter}.vbpubk | 83 ${TESTKEY_DIR}/key_alg${signing_algorithmcounter}.vbpubk |
84 # TODO: check data key against the packed one? | 84 # TODO: check data key against the packed one? |
85 if [ $? -ne 0 ] | 85 if [ $? -ne 0 ] |
86 then | 86 then |
87 return_code=255 | 87 return_code=255 |
88 fi | 88 fi |
89 | 89 |
90 let data_algorithmcounter=data_algorithmcounter+1 | 90 let data_algorithmcounter=data_algorithmcounter+1 |
91 done | 91 done |
92 done | 92 done |
93 let signing_algorithmcounter=signing_algorithmcounter+1 | 93 let signing_algorithmcounter=signing_algorithmcounter+1 |
94 done | 94 done |
95 done | 95 done |
96 } | 96 } |
97 | 97 |
98 | 98 |
99 check_test_keys | 99 check_test_keys |
100 | 100 |
101 echo | 101 echo |
102 echo "Testing vbutil_key..." | 102 echo "Testing vbutil_key..." |
103 test_vbutil_key | 103 test_vbutil_key |
104 | 104 |
105 echo | 105 echo |
106 echo "Testing vbutil_keyblock..." | 106 echo "Testing vbutil_keyblock..." |
107 test_vbutil_keyblock | 107 test_vbutil_keyblock |
108 | 108 |
109 | 109 |
110 exit $return_code | 110 exit $return_code |
111 | 111 |
OLD | NEW |