OLD | NEW |
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* Routines for verifying a file's signature. Useful in testing the core | 6 /* Routines for verifying a file's signature. Useful in testing the core |
7 * RSA verification implementation. | 7 * RSA verification implementation. |
8 */ | 8 */ |
9 | 9 |
10 #include <inttypes.h> /* For PRIu64 macro */ | 10 #include <inttypes.h> /* For PRIu64 macro */ |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 if (key_blob) { | 164 if (key_blob) { |
165 gbb->rootkey_offset = gbb->header_size; | 165 gbb->rootkey_offset = gbb->header_size; |
166 gbb->rootkey_size = key_size; | 166 gbb->rootkey_size = key_size; |
167 Memcpy((uint8_t*)gbb + gbb->rootkey_offset, key_blob, key_size); | 167 Memcpy((uint8_t*)gbb + gbb->rootkey_offset, key_blob, key_size); |
168 | 168 |
169 gbb->recovery_key_offset = gbb->rootkey_offset; | 169 gbb->recovery_key_offset = gbb->rootkey_offset; |
170 gbb->recovery_key_size = key_size; | 170 gbb->recovery_key_size = key_size; |
171 } | 171 } |
172 | 172 |
173 /* Initialize the shared data area */ | 173 /* Initialize the shared data area */ |
174 lkp.shared_data_blob = Malloc(LOAD_FIRMWARE_SHARED_DATA_REC_SIZE); | 174 lkp.shared_data_blob = Malloc(VB_SHARED_DATA_REC_SIZE); |
175 lkp.shared_data_size = LOAD_FIRMWARE_SHARED_DATA_REC_SIZE; | 175 lkp.shared_data_size = VB_SHARED_DATA_REC_SIZE; |
176 shared = (VbSharedDataHeader*)lkp.shared_data_blob; | 176 shared = (VbSharedDataHeader*)lkp.shared_data_blob; |
177 if (0 != VbSharedDataInit(shared, lkp.shared_data_size)) { | 177 if (0 != VbSharedDataInit(shared, lkp.shared_data_size)) { |
178 fprintf(stderr, "Unable to init shared data\n"); | 178 fprintf(stderr, "Unable to init shared data\n"); |
179 return 1; | 179 return 1; |
180 } | 180 } |
181 /* Copy in the key blob, if any */ | 181 /* Copy in the key blob, if any */ |
182 if (key_blob) { | 182 if (key_blob) { |
183 if (0 != VbSharedDataSetKernelKey(shared, (VbPublicKey*)key_blob)) { | 183 if (0 != VbSharedDataSetKernelKey(shared, (VbPublicKey*)key_blob)) { |
184 fprintf(stderr, "Unable to set key in shared data\n"); | 184 fprintf(stderr, "Unable to set key in shared data\n"); |
185 return 1; | 185 return 1; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 lkp.partition_guid[12], | 250 lkp.partition_guid[12], |
251 lkp.partition_guid[13], | 251 lkp.partition_guid[13], |
252 lkp.partition_guid[14], | 252 lkp.partition_guid[14], |
253 lkp.partition_guid[15]); | 253 lkp.partition_guid[15]); |
254 } | 254 } |
255 | 255 |
256 fclose(image_file); | 256 fclose(image_file); |
257 Free(lkp.kernel_buffer); | 257 Free(lkp.kernel_buffer); |
258 return rv != LOAD_KERNEL_SUCCESS; | 258 return rv != LOAD_KERNEL_SUCCESS; |
259 } | 259 } |
OLD | NEW |