| 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 * Functions for generating and manipulating a verified boot kernel image. | 5 * Functions for generating and manipulating a verified boot kernel image. |
| 6 * (Userland portion) | 6 * (Userland portion) |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "kernel_image.h" | 9 #include "kernel_image.h" |
| 10 | 10 |
| 11 #include <fcntl.h> | 11 #include <fcntl.h> |
| 12 #include <stdio.h> | 12 #include <stdio.h> |
| 13 #include <sys/types.h> | 13 #include <sys/types.h> |
| 14 #include <sys/stat.h> | 14 #include <sys/stat.h> |
| 15 #include <unistd.h> | 15 #include <unistd.h> |
| 16 | 16 |
| 17 #include "cryptolib.h" | |
| 18 #include "file_keys.h" | 17 #include "file_keys.h" |
| 18 #include "padding.h" |
| 19 #include "rollback_index.h" | 19 #include "rollback_index.h" |
| 20 #include "rsa_utility.h" |
| 21 #include "sha_utility.h" |
| 20 #include "signature_digest.h" | 22 #include "signature_digest.h" |
| 21 #include "utility.h" | 23 #include "utility.h" |
| 22 | 24 |
| 23 /* Macro to determine the size of a field structure in the KernelImage | 25 /* Macro to determine the size of a field structure in the KernelImage |
| 24 * structure. */ | 26 * structure. */ |
| 25 #define FIELD_LEN(field) (sizeof(((KernelImage*)0)->field)) | 27 #define FIELD_LEN(field) (sizeof(((KernelImage*)0)->field)) |
| 26 | 28 |
| 27 KernelImage* KernelImageNew(void) { | 29 KernelImage* KernelImageNew(void) { |
| 28 KernelImage* image = (KernelImage*) Malloc(sizeof(KernelImage)); | 30 KernelImage* image = (KernelImage*) Malloc(sizeof(KernelImage)); |
| 29 if (image) { | 31 if (image) { |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 Free(kernel_buf); | 549 Free(kernel_buf); |
| 548 Free(config_blob); | 550 Free(config_blob); |
| 549 return 1; | 551 return 1; |
| 550 } | 552 } |
| 551 | 553 |
| 552 void PrintKernelEntry(kernel_entry* entry) { | 554 void PrintKernelEntry(kernel_entry* entry) { |
| 553 debug("Boot Priority = %d\n", entry->boot_priority); | 555 debug("Boot Priority = %d\n", entry->boot_priority); |
| 554 debug("Boot Tries Remaining = %d\n", entry->boot_tries_remaining); | 556 debug("Boot Tries Remaining = %d\n", entry->boot_tries_remaining); |
| 555 debug("Boot Success Flag = %d\n", entry->boot_success_flag); | 557 debug("Boot Success Flag = %d\n", entry->boot_success_flag); |
| 556 } | 558 } |
| OLD | NEW |