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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 printf("Ending LBA: %" PRIu64 "\n", lkp.ending_lba); | 128 printf("Ending LBA: %" PRIu64 "\n", lkp.ending_lba); |
129 | 129 |
130 /* Allocate a buffer for the kernel */ | 130 /* Allocate a buffer for the kernel */ |
131 lkp.kernel_buffer = Malloc(KERNEL_BUFFER_SIZE); | 131 lkp.kernel_buffer = Malloc(KERNEL_BUFFER_SIZE); |
132 if(!lkp.kernel_buffer) { | 132 if(!lkp.kernel_buffer) { |
133 fprintf(stderr, "Unable to allocate kernel buffer.\n"); | 133 fprintf(stderr, "Unable to allocate kernel buffer.\n"); |
134 return 1; | 134 return 1; |
135 } | 135 } |
136 | 136 |
137 /* TODO: Option for boot mode */ | 137 /* TODO: Option for boot mode */ |
138 lkp.boot_mode = BOOT_MODE_NORMAL; | 138 lkp.boot_flags = 0; |
139 | 139 |
140 /* Call LoadKernel() */ | 140 /* Call LoadKernel() */ |
141 rv = LoadKernel(&lkp); | 141 rv = LoadKernel(&lkp); |
142 printf("LoadKernel() returned %d\n", rv); | 142 printf("LoadKernel() returned %d\n", rv); |
143 | 143 |
144 if (LOAD_KERNEL_SUCCESS == rv) { | 144 if (LOAD_KERNEL_SUCCESS == rv) { |
145 printf("Partition number: %" PRIu64 "\n", lkp.partition_number); | 145 printf("Partition number: %" PRIu64 "\n", lkp.partition_number); |
146 printf("Bootloader address: %" PRIu64 "\n", lkp.bootloader_address); | 146 printf("Bootloader address: %" PRIu64 "\n", lkp.bootloader_address); |
147 printf("Bootloader size: %" PRIu64 "\n", lkp.bootloader_size); | 147 printf("Bootloader size: %" PRIu64 "\n", lkp.bootloader_size); |
148 } | 148 } |
149 | 149 |
150 fclose(image_file); | 150 fclose(image_file); |
151 Free(lkp.kernel_buffer); | 151 Free(lkp.kernel_buffer); |
152 return 0; | 152 return 0; |
153 } | 153 } |
OLD | NEW |