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

Side by Side Diff: tests/run_vbutil_tests.sh

Issue 4194003: Add support for using external signing application and .pem private key files to vbutil_keyblock. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: fix read() bug Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/external_rsa_signer.sh ('k') | utility/vbutil_keyblock.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 # Check 117 # Check
118 if ! cmp -s \ 118 if ! cmp -s \
119 ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk \ 119 ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk \
120 ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk2 120 ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk2
121 then 121 then
122 echo -e "${COL_RED}Check${COL_STOP}" 122 echo -e "${COL_RED}Check${COL_STOP}"
123 return_code=255 123 return_code=255
124 exit 1 124 exit 1
125 fi 125 fi
126 126
127 echo -e "${COL_YELLOW}Testing keyblock creation using \
128 external signer.${COL_STOP}"
129 # Pack using external signer
130 # Pack
131 ${UTIL_DIR}/vbutil_keyblock --pack ${keyblockfile} \
132 --datapubkey \
133 ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk \
134 --signprivate_pem \
135 ${TESTKEY_DIR}/key_rsa${signing_keylen}.pem \
136 --pem_algorithm "${signing_algorithmcounter}" \
137 --externalsigner "${SCRIPT_DIR}/external_rsa_signer.sh"
138
139 if [ $? -ne 0 ]
140 then
141 echo -e "${COL_RED}Pack${COL_STOP}"
142 return_code=255
143 fi
144
145 # Unpack
146 ${UTIL_DIR}/vbutil_keyblock --unpack ${keyblockfile} \
147 --datapubkey \
148 ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk2 \
149 --signpubkey \
150 ${TESTKEY_SCRATCH_DIR}/key_alg${signing_algorithmcounter}.vbpubk
151 if [ $? -ne 0 ]
152 then
153 echo -e "${COL_RED}Unpack${COL_STOP}"
154 return_code=255
155 fi
156
157 # Check
158 if ! cmp -s \
159 ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk \
160 ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk2
161 then
162 echo -e "${COL_RED}Check${COL_STOP}"
163 return_code=255
164 exit 1
165 fi
166
127 let data_algorithmcounter=data_algorithmcounter+1 167 let data_algorithmcounter=data_algorithmcounter+1
128 done 168 done
129 done 169 done
130 let signing_algorithmcounter=signing_algorithmcounter+1 170 let signing_algorithmcounter=signing_algorithmcounter+1
131 done 171 done
132 done 172 done
133 } 173 }
134 174
135 175
136 check_test_keys 176 check_test_keys
137 177
138 echo 178 echo
139 echo "Testing vbutil_key..." 179 echo "Testing vbutil_key..."
140 test_vbutil_key 180 test_vbutil_key
141 181
142 echo 182 echo
143 echo "Testing vbutil_keyblock..." 183 echo "Testing vbutil_keyblock..."
144 test_vbutil_keyblock 184 test_vbutil_keyblock
145 185
146 186
147 exit $return_code 187 exit $return_code
148 188
OLDNEW
« no previous file with comments | « tests/external_rsa_signer.sh ('k') | utility/vbutil_keyblock.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698