Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2014 The Chromium OS Authors. All rights reserved. |
| 2 | * Use of this source code is governed by a BSD-style license that can be |
| 3 | * found in the LICENSE file. |
| 4 | */ |
| 5 | |
Joel Kitching | 9adf2aa | 2019-08-20 17:43:50 +0800 | [diff] [blame] | 6 | #ifndef VBOOT_REFERENCE_2RETURN_CODES_H_ |
| 7 | #define VBOOT_REFERENCE_2RETURN_CODES_H_ |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 8 | |
Joel Kitching | ffd42a8 | 2019-08-29 13:58:52 +0800 | [diff] [blame] | 9 | #include "2sysincludes.h" |
| 10 | |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 11 | /* |
Joel Kitching | 90671fa | 2019-07-31 13:17:08 +0800 | [diff] [blame] | 12 | * Functions which return an error all return this type. This is a 32-bit |
| 13 | * value rather than an int so it's consistent across different architectures. |
| 14 | */ |
| 15 | typedef uint32_t vb2_error_t; |
| 16 | |
| 17 | /* |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 18 | * Return codes from verified boot functions. |
| 19 | * |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 20 | * Note that other values may be passed through from vb2ex_*() calls; see |
| 21 | * the comment for VB2_ERROR_EX below. |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 22 | */ |
| 23 | enum vb2_return_code { |
| 24 | /* Success - no error */ |
| 25 | VB2_SUCCESS = 0, |
| 26 | |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 27 | /* |
| 28 | * All vboot2 error codes start at a large offset from zero, to reduce |
| 29 | * the risk of overlap with other error codes (TPM, etc.). |
| 30 | */ |
Randall Spangler | 02e11b3 | 2014-11-19 12:48:36 -0800 | [diff] [blame] | 31 | VB2_ERROR_BASE = 0x10000000, |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 32 | |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 33 | /* Unknown / unspecified error */ |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 34 | VB2_ERROR_UNKNOWN = VB2_ERROR_BASE + 1, |
| 35 | |
Randall Spangler | a7ab8b5 | 2014-06-10 17:05:08 -0700 | [diff] [blame] | 36 | /* Mock error for testing */ |
| 37 | VB2_ERROR_MOCK, |
| 38 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 39 | /********************************************************************** |
Joel Kitching | 1ed2dff | 2019-08-30 16:19:35 +0800 | [diff] [blame] | 40 | * ancient pre-vboot1 errors |
| 41 | * TODO: deprecate these once they have all moved over to vboot2 style |
| 42 | */ |
| 43 | /* Invalid public key passed to a signature verficiation function. */ |
| 44 | VBOOT_PUBLIC_KEY_INVALID = 4, |
| 45 | /* Preamble internal structure is invalid */ |
| 46 | VBOOT_PREAMBLE_INVALID = 5, |
| 47 | /* Shared data is invalid. */ |
| 48 | VBOOT_SHARED_DATA_INVALID = 7, |
| 49 | /* Kernel Preamble does not contain flags */ |
| 50 | VBOOT_KERNEL_PREAMBLE_NO_FLAGS = 8, |
| 51 | |
| 52 | /********************************************************************** |
Joel Kitching | 1db2f38 | 2019-07-29 18:35:08 +0800 | [diff] [blame] | 53 | * vboot1-style errors |
| 54 | * TODO: deprecate these once they have all moved over to vboot2 style |
| 55 | */ |
Joel Kitching | 1db2f38 | 2019-07-29 18:35:08 +0800 | [diff] [blame] | 56 | /* Unable to initialize shared data */ |
| 57 | VBERROR_INIT_SHARED_DATA = 0x10001, |
Joel Kitching | 1db2f38 | 2019-07-29 18:35:08 +0800 | [diff] [blame] | 58 | /* Unable to set boot mode state in TPM */ |
| 59 | VBERROR_TPM_SET_BOOT_MODE_STATE = 0x10006, |
| 60 | /* Calling firmware needs to perform a reboot. */ |
| 61 | VBERROR_REBOOT_REQUIRED = 0x10007, |
| 62 | /* Unable to set up TPM */ |
| 63 | VBERROR_TPM_FIRMWARE_SETUP = 0x10008, |
| 64 | /* Unable to read kernel versions from TPM */ |
| 65 | VBERROR_TPM_READ_KERNEL = 0x10009, |
Joel Kitching | 1db2f38 | 2019-07-29 18:35:08 +0800 | [diff] [blame] | 66 | /* Unable to write kernel versions to TPM */ |
| 67 | VBERROR_TPM_WRITE_KERNEL = 0x1000B, |
| 68 | /* Unable to lock kernel versions in TPM */ |
| 69 | VBERROR_TPM_LOCK_KERNEL = 0x1000C, |
| 70 | /* Calling firmware requested shutdown via VbExIsShutdownRequested() */ |
| 71 | VBERROR_SHUTDOWN_REQUESTED = 0x1000D, |
| 72 | /* Unable to find a boot device on which to look for a kernel */ |
| 73 | VBERROR_NO_DISK_FOUND = 0x1000E, |
| 74 | /* No OS kernel found on any boot device */ |
| 75 | VBERROR_NO_KERNEL_FOUND = 0x1000F, |
| 76 | /* All OS kernels found were invalid (corrupt, improperly signed...) */ |
| 77 | VBERROR_INVALID_KERNEL_FOUND = 0x10010, |
| 78 | /* VbSelectAndLoadKernel() requested recovery mode */ |
| 79 | VBERROR_LOAD_KERNEL_RECOVERY = 0x10011, |
| 80 | /* Other error inside VbSelectAndLoadKernel() */ |
| 81 | VBERROR_LOAD_KERNEL = 0x10012, |
| 82 | /* Invalid Google binary block */ |
| 83 | VBERROR_INVALID_GBB = 0x10013, |
| 84 | /* Invalid bitmap volume */ |
| 85 | VBERROR_INVALID_BMPFV = 0x10014, |
| 86 | /* Invalid screen index */ |
| 87 | VBERROR_INVALID_SCREEN_INDEX = 0x10015, |
Joel Kitching | 1db2f38 | 2019-07-29 18:35:08 +0800 | [diff] [blame] | 88 | /* VbExBeep() can't make sound in the background */ |
| 89 | VBERROR_NO_BACKGROUND_SOUND = 0x10019, |
| 90 | /* Need EC to reboot to read-only code to switch RW slot */ |
| 91 | VBERROR_EC_REBOOT_TO_SWITCH_RW = 0x1001A, |
Joel Kitching | 1db2f38 | 2019-07-29 18:35:08 +0800 | [diff] [blame] | 92 | /* Need EC to reboot to read-only code */ |
| 93 | VBERROR_EC_REBOOT_TO_RO_REQUIRED = 0x10022, |
Joel Kitching | f241514 | 2019-07-30 10:02:44 +0800 | [diff] [blame] | 94 | /* No image present */ |
Joel Kitching | 1db2f38 | 2019-07-29 18:35:08 +0800 | [diff] [blame] | 95 | VBERROR_NO_IMAGE_PRESENT = 0x10026, |
| 96 | /* failed to draw screen */ |
| 97 | VBERROR_SCREEN_DRAW = 0x10027, |
Joel Kitching | 1db2f38 | 2019-07-29 18:35:08 +0800 | [diff] [blame] | 98 | /* Error reading FWMP from TPM (note: not present is not an error) */ |
| 99 | VBERROR_TPM_READ_FWMP = 0x10029, |
| 100 | /* Peripheral busy. Cannot upgrade firmware at present. */ |
| 101 | VBERROR_PERIPHERAL_BUSY = 0x10030, |
Joel Kitching | 1db2f38 | 2019-07-29 18:35:08 +0800 | [diff] [blame] | 102 | /* Error writing VPD */ |
| 103 | VBERROR_VPD_WRITE = 0x10032, |
Joel Kitching | 1db2f38 | 2019-07-29 18:35:08 +0800 | [diff] [blame] | 104 | /* Detachable UI internal functions may return the following codes */ |
| 105 | /* No error; return to UI loop */ |
| 106 | VBERROR_KEEP_LOOPING = 0x30000, |
| 107 | |
| 108 | /********************************************************************** |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 109 | * SHA errors |
| 110 | */ |
| 111 | VB2_ERROR_SHA = VB2_ERROR_BASE + 0x010000, |
| 112 | |
| 113 | /* Bad algorithm in vb2_digest_init() */ |
| 114 | VB2_ERROR_SHA_INIT_ALGORITHM, |
| 115 | |
| 116 | /* Bad algorithm in vb2_digest_extend() */ |
| 117 | VB2_ERROR_SHA_EXTEND_ALGORITHM, |
| 118 | |
| 119 | /* Bad algorithm in vb2_digest_finalize() */ |
| 120 | VB2_ERROR_SHA_FINALIZE_ALGORITHM, |
| 121 | |
| 122 | /* Digest size buffer too small in vb2_digest_finalize() */ |
| 123 | VB2_ERROR_SHA_FINALIZE_DIGEST_SIZE, |
| 124 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 125 | /********************************************************************** |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 126 | * RSA errors |
| 127 | */ |
| 128 | VB2_ERROR_RSA = VB2_ERROR_BASE + 0x020000, |
| 129 | |
| 130 | /* Padding mismatch in vb2_check_padding() */ |
| 131 | VB2_ERROR_RSA_PADDING, |
| 132 | |
| 133 | /* Bad algorithm in vb2_check_padding() */ |
| 134 | VB2_ERROR_RSA_PADDING_ALGORITHM, |
| 135 | |
| 136 | /* Null param passed to vb2_verify_digest() */ |
| 137 | VB2_ERROR_RSA_VERIFY_PARAM, |
| 138 | |
| 139 | /* Bad algorithm in vb2_verify_digest() */ |
| 140 | VB2_ERROR_RSA_VERIFY_ALGORITHM, |
| 141 | |
| 142 | /* Bad signature length in vb2_verify_digest() */ |
| 143 | VB2_ERROR_RSA_VERIFY_SIG_LEN, |
| 144 | |
| 145 | /* Work buffer too small in vb2_verify_digest() */ |
| 146 | VB2_ERROR_RSA_VERIFY_WORKBUF, |
| 147 | |
| 148 | /* Digest mismatch in vb2_verify_digest() */ |
| 149 | VB2_ERROR_RSA_VERIFY_DIGEST, |
| 150 | |
Randall Spangler | c8c2f02 | 2014-10-23 09:48:20 -0700 | [diff] [blame] | 151 | /* Bad size calculation in vb2_check_padding() */ |
| 152 | VB2_ERROR_RSA_PADDING_SIZE, |
| 153 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 154 | /********************************************************************** |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 155 | * NV storage errors |
| 156 | */ |
| 157 | VB2_ERROR_NV = VB2_ERROR_BASE + 0x030000, |
| 158 | |
| 159 | /* Bad header in vb2_nv_check_crc() */ |
| 160 | VB2_ERROR_NV_HEADER, |
| 161 | |
| 162 | /* Bad CRC in vb2_nv_check_crc() */ |
| 163 | VB2_ERROR_NV_CRC, |
| 164 | |
Joel Kitching | a93aa4a | 2019-11-18 21:13:29 +0800 | [diff] [blame] | 165 | /* Read error in nvdata backend */ |
| 166 | VB2_ERROR_NV_READ, |
| 167 | |
| 168 | /* Write error in nvdata backend */ |
| 169 | VB2_ERROR_NV_WRITE, |
| 170 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 171 | /********************************************************************** |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 172 | * Secure data storage errors |
| 173 | */ |
| 174 | VB2_ERROR_SECDATA = VB2_ERROR_BASE + 0x040000, |
| 175 | |
Joel Kitching | fbde3aa | 2019-08-27 17:13:55 +0800 | [diff] [blame] | 176 | /* Bad CRC in vb2api_secdata_firmware_check() */ |
| 177 | VB2_ERROR_SECDATA_FIRMWARE_CRC, |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 178 | |
Joel Kitching | fbde3aa | 2019-08-27 17:13:55 +0800 | [diff] [blame] | 179 | /* Bad struct version in vb2api_secdata_firmware_check() */ |
| 180 | VB2_ERROR_SECDATA_FIRMWARE_VERSION, |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 181 | |
Joel Kitching | 2abf0e7 | 2019-10-02 00:06:29 +0800 | [diff] [blame] | 182 | /* Invalid param in vb2_secdata_firmware_get(); |
| 183 | Deprecated with chromium:972956. */ |
| 184 | VB2_ERROR_DEPRECATED_SECDATA_FIRMWARE_GET_PARAM, |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 185 | |
Joel Kitching | 2abf0e7 | 2019-10-02 00:06:29 +0800 | [diff] [blame] | 186 | /* Invalid param in vb2_secdata_firmware_set(); |
| 187 | Deprecated with chromium:972956. */ |
| 188 | VB2_ERROR_DEPRECATED_SECDATA_FIRMWARE_SET_PARAM, |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 189 | |
Joel Kitching | 2abf0e7 | 2019-10-02 00:06:29 +0800 | [diff] [blame] | 190 | /* Invalid flags passed to vb2_secdata_firmware_set(); |
| 191 | Deprecated with chromium:972956. */ |
| 192 | VB2_ERROR_DEPRECATED_SECDATA_FIRMWARE_SET_FLAGS, |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 193 | |
Joel Kitching | 2abf0e7 | 2019-10-02 00:06:29 +0800 | [diff] [blame] | 194 | /* Called vb2_secdata_firmware_get() with uninitialized secdata; |
| 195 | Deprecated with chromium:972956. */ |
| 196 | VB2_ERROR_DEPRECATED_SECDATA_FIRMWARE_GET_UNINITIALIZED, |
Julius Werner | b550fb1 | 2015-01-30 14:27:54 -0800 | [diff] [blame] | 197 | |
Joel Kitching | 2abf0e7 | 2019-10-02 00:06:29 +0800 | [diff] [blame] | 198 | /* Called vb2_secdata_firmware_set() with uninitialized secdata; |
| 199 | Deprecated with chromium:972956. */ |
| 200 | VB2_ERROR_DEPRECATED_SECDATA_FIRMWARE_SET_UNINITIALIZED, |
Julius Werner | b550fb1 | 2015-01-30 14:27:54 -0800 | [diff] [blame] | 201 | |
Joel Kitching | fbde3aa | 2019-08-27 17:13:55 +0800 | [diff] [blame] | 202 | /* Bad CRC in vb2api_secdata_kernel_check() */ |
| 203 | VB2_ERROR_SECDATA_KERNEL_CRC, |
Randall Spangler | bf9c276 | 2015-05-12 13:44:30 -0700 | [diff] [blame] | 204 | |
Joel Kitching | fbde3aa | 2019-08-27 17:13:55 +0800 | [diff] [blame] | 205 | /* Bad struct version in vb2_secdata_kernel_init() */ |
| 206 | VB2_ERROR_SECDATA_KERNEL_VERSION, |
Randall Spangler | bf9c276 | 2015-05-12 13:44:30 -0700 | [diff] [blame] | 207 | |
Joel Kitching | fbde3aa | 2019-08-27 17:13:55 +0800 | [diff] [blame] | 208 | /* Bad uid in vb2_secdata_kernel_init() */ |
| 209 | VB2_ERROR_SECDATA_KERNEL_UID, |
Randall Spangler | bf9c276 | 2015-05-12 13:44:30 -0700 | [diff] [blame] | 210 | |
Joel Kitching | 2abf0e7 | 2019-10-02 00:06:29 +0800 | [diff] [blame] | 211 | /* Invalid param in vb2_secdata_kernel_get(); |
| 212 | Deprecated with chromium:972956. */ |
| 213 | VB2_ERROR_DEPRECATED_SECDATA_KERNEL_GET_PARAM, |
Randall Spangler | bf9c276 | 2015-05-12 13:44:30 -0700 | [diff] [blame] | 214 | |
Joel Kitching | 2abf0e7 | 2019-10-02 00:06:29 +0800 | [diff] [blame] | 215 | /* Invalid param in vb2_secdata_kernel_set(); |
| 216 | Deprecated with chromium:972956. */ |
| 217 | VB2_ERROR_DEPRECATED_SECDATA_KERNEL_SET_PARAM, |
Randall Spangler | bf9c276 | 2015-05-12 13:44:30 -0700 | [diff] [blame] | 218 | |
Joel Kitching | 2abf0e7 | 2019-10-02 00:06:29 +0800 | [diff] [blame] | 219 | /* Invalid flags passed to vb2_secdata_kernel_set(); |
| 220 | Deprecated with chromium:972956. */ |
| 221 | VB2_ERROR_DEPRECATED_SECDATA_KERNEL_SET_FLAGS, |
Randall Spangler | bf9c276 | 2015-05-12 13:44:30 -0700 | [diff] [blame] | 222 | |
Joel Kitching | 2abf0e7 | 2019-10-02 00:06:29 +0800 | [diff] [blame] | 223 | /* Called vb2_secdata_kernel_get() with uninitialized secdata_kernel; |
| 224 | Deprecated with chromium:972956. */ |
| 225 | VB2_ERROR_DEPRECATED_SECDATA_KERNEL_GET_UNINITIALIZED, |
Randall Spangler | bf9c276 | 2015-05-12 13:44:30 -0700 | [diff] [blame] | 226 | |
Joel Kitching | 2abf0e7 | 2019-10-02 00:06:29 +0800 | [diff] [blame] | 227 | /* Called vb2_secdata_kernel_set() with uninitialized secdata_kernel; |
| 228 | Deprecated with chromium:972956. */ |
| 229 | VB2_ERROR_DEPRECATED_SECDATA_KERNEL_SET_UNINITIALIZED, |
Randall Spangler | bf9c276 | 2015-05-12 13:44:30 -0700 | [diff] [blame] | 230 | |
Joel Kitching | 967ba85 | 2019-08-28 17:45:05 +0800 | [diff] [blame] | 231 | /* Bad size in vb2api_secdata_fwmp_check() */ |
| 232 | VB2_ERROR_SECDATA_FWMP_SIZE, |
| 233 | |
| 234 | /* Incomplete structure in vb2api_secdata_fwmp_check() */ |
| 235 | VB2_ERROR_SECDATA_FWMP_INCOMPLETE, |
| 236 | |
| 237 | /* Bad CRC in vb2api_secdata_fwmp_check() */ |
| 238 | VB2_ERROR_SECDATA_FWMP_CRC, |
| 239 | |
| 240 | /* Bad struct version in vb2_secdata_fwmp_check() */ |
| 241 | VB2_ERROR_SECDATA_FWMP_VERSION, |
| 242 | |
Joel Kitching | adb4183 | 2019-09-23 22:53:49 +0800 | [diff] [blame] | 243 | /* Error reading secdata_firmware from storage backend */ |
| 244 | VB2_ERROR_SECDATA_FIRMWARE_READ, |
| 245 | |
| 246 | /* Error writing secdata_firmware to storage backend */ |
| 247 | VB2_ERROR_SECDATA_FIRMWARE_WRITE, |
| 248 | |
| 249 | /* Error locking secdata_firmware in storage backend */ |
| 250 | VB2_ERROR_SECDATA_FIRMWARE_LOCK, |
| 251 | |
| 252 | /* Error reading secdata_kernel from storage backend */ |
| 253 | VB2_ERROR_SECDATA_KERNEL_READ, |
| 254 | |
| 255 | /* Error writing secdata_kernel to storage backend */ |
| 256 | VB2_ERROR_SECDATA_KERNEL_WRITE, |
| 257 | |
| 258 | /* Error locking secdata_kernel in storage backend */ |
| 259 | VB2_ERROR_SECDATA_KERNEL_LOCK, |
| 260 | |
| 261 | /* Error reading secdata_fwmp from storage backend */ |
| 262 | VB2_ERROR_SECDATA_FWMP_READ, |
| 263 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 264 | /********************************************************************** |
Randall Spangler | 2145721 | 2014-06-06 09:30:14 -0700 | [diff] [blame] | 265 | * Common code errors |
| 266 | */ |
| 267 | VB2_ERROR_COMMON = VB2_ERROR_BASE + 0x050000, |
| 268 | |
| 269 | /* Buffer is smaller than alignment offset in vb2_align() */ |
| 270 | VB2_ERROR_ALIGN_BIGGER_THAN_SIZE, |
| 271 | |
| 272 | /* Buffer is smaller than request in vb2_align() */ |
| 273 | VB2_ERROR_ALIGN_SIZE, |
| 274 | |
| 275 | /* Parent wraps around in vb2_verify_member_inside() */ |
| 276 | VB2_ERROR_INSIDE_PARENT_WRAPS, |
| 277 | |
| 278 | /* Member wraps around in vb2_verify_member_inside() */ |
| 279 | VB2_ERROR_INSIDE_MEMBER_WRAPS, |
| 280 | |
| 281 | /* Member outside parent in vb2_verify_member_inside() */ |
| 282 | VB2_ERROR_INSIDE_MEMBER_OUTSIDE, |
| 283 | |
| 284 | /* Member data wraps around in vb2_verify_member_inside() */ |
| 285 | VB2_ERROR_INSIDE_DATA_WRAPS, |
| 286 | |
| 287 | /* Member data outside parent in vb2_verify_member_inside() */ |
| 288 | VB2_ERROR_INSIDE_DATA_OUTSIDE, |
| 289 | |
Randall Spangler | 6e3931d | 2016-10-18 15:09:21 -0700 | [diff] [blame] | 290 | /* Unsupported signature algorithm in vb2_unpack_key_buffer() */ |
Randall Spangler | 6b5b8f6 | 2014-10-31 15:18:48 -0700 | [diff] [blame] | 291 | VB2_ERROR_UNPACK_KEY_SIG_ALGORITHM, /* 0x150008 */ |
Randall Spangler | 224f5ac | 2014-06-06 09:42:30 -0700 | [diff] [blame] | 292 | |
Randall Spangler | 6e3931d | 2016-10-18 15:09:21 -0700 | [diff] [blame] | 293 | /* Bad key size in vb2_unpack_key_buffer() */ |
Randall Spangler | 224f5ac | 2014-06-06 09:42:30 -0700 | [diff] [blame] | 294 | VB2_ERROR_UNPACK_KEY_SIZE, |
| 295 | |
Randall Spangler | 6e3931d | 2016-10-18 15:09:21 -0700 | [diff] [blame] | 296 | /* Bad key alignment in vb2_unpack_key_buffer() */ |
Randall Spangler | 224f5ac | 2014-06-06 09:42:30 -0700 | [diff] [blame] | 297 | VB2_ERROR_UNPACK_KEY_ALIGN, |
| 298 | |
Randall Spangler | 6e3931d | 2016-10-18 15:09:21 -0700 | [diff] [blame] | 299 | /* Bad key array size in vb2_unpack_key_buffer() */ |
Randall Spangler | 224f5ac | 2014-06-06 09:42:30 -0700 | [diff] [blame] | 300 | VB2_ERROR_UNPACK_KEY_ARRAY_SIZE, |
| 301 | |
| 302 | /* Bad algorithm in vb2_verify_data() */ |
| 303 | VB2_ERROR_VDATA_ALGORITHM, |
| 304 | |
| 305 | /* Incorrect signature size for algorithm in vb2_verify_data() */ |
| 306 | VB2_ERROR_VDATA_SIG_SIZE, |
| 307 | |
| 308 | /* Data smaller than length of signed data in vb2_verify_data() */ |
| 309 | VB2_ERROR_VDATA_NOT_ENOUGH_DATA, |
| 310 | |
| 311 | /* Not enough work buffer for digest in vb2_verify_data() */ |
| 312 | VB2_ERROR_VDATA_WORKBUF_DIGEST, |
| 313 | |
| 314 | /* Not enough work buffer for hash temp data in vb2_verify_data() */ |
Randall Spangler | 6b5b8f6 | 2014-10-31 15:18:48 -0700 | [diff] [blame] | 315 | VB2_ERROR_VDATA_WORKBUF_HASHING, /* 0x150010 */ |
Randall Spangler | 224f5ac | 2014-06-06 09:42:30 -0700 | [diff] [blame] | 316 | |
Randall Spangler | 9504754 | 2014-10-17 16:41:46 -0700 | [diff] [blame] | 317 | /* |
| 318 | * Bad digest size in vb2_verify_data() - probably because algorithm |
| 319 | * is bad. |
| 320 | */ |
| 321 | VB2_ERROR_VDATA_DIGEST_SIZE, |
| 322 | |
Randall Spangler | 6e3931d | 2016-10-18 15:09:21 -0700 | [diff] [blame] | 323 | /* Unsupported hash algorithm in vb2_unpack_key_buffer() */ |
Randall Spangler | 4eef812 | 2014-10-23 10:07:54 -0700 | [diff] [blame] | 324 | VB2_ERROR_UNPACK_KEY_HASH_ALGORITHM, |
| 325 | |
Randall Spangler | f6cfb97 | 2014-10-23 17:04:03 -0700 | [diff] [blame] | 326 | /* Member data overlaps member header */ |
| 327 | VB2_ERROR_INSIDE_DATA_OVERLAP, |
| 328 | |
Randall Spangler | d274a2e | 2014-10-23 17:38:18 -0700 | [diff] [blame] | 329 | /* Unsupported packed key struct version */ |
| 330 | VB2_ERROR_UNPACK_KEY_STRUCT_VERSION, |
| 331 | |
Randall Spangler | 6b5b8f6 | 2014-10-31 15:18:48 -0700 | [diff] [blame] | 332 | /* |
| 333 | * Buffer too small for total, fixed size, or description reported in |
| 334 | * common header, or member data checked via |
Randall Spangler | ca72512 | 2016-05-25 16:42:44 -0700 | [diff] [blame] | 335 | * vb21_verify_common_member(). |
Randall Spangler | 6b5b8f6 | 2014-10-31 15:18:48 -0700 | [diff] [blame] | 336 | */ |
| 337 | VB2_ERROR_COMMON_TOTAL_SIZE, |
| 338 | VB2_ERROR_COMMON_FIXED_SIZE, |
| 339 | VB2_ERROR_COMMON_DESC_SIZE, |
| 340 | VB2_ERROR_COMMON_MEMBER_SIZE, /* 0x150018 */ |
| 341 | |
| 342 | /* |
| 343 | * Total, fixed, description, or member offset/size not a multiple of |
| 344 | * 32 bits. |
| 345 | */ |
| 346 | VB2_ERROR_COMMON_TOTAL_UNALIGNED, |
| 347 | VB2_ERROR_COMMON_FIXED_UNALIGNED, |
| 348 | VB2_ERROR_COMMON_DESC_UNALIGNED, |
| 349 | VB2_ERROR_COMMON_MEMBER_UNALIGNED, |
| 350 | |
| 351 | /* Common struct description or member data wraps address space */ |
| 352 | VB2_ERROR_COMMON_DESC_WRAPS, |
| 353 | VB2_ERROR_COMMON_MEMBER_WRAPS, |
| 354 | |
| 355 | /* Common struct description is not null-terminated */ |
| 356 | VB2_ERROR_COMMON_DESC_TERMINATOR, |
| 357 | |
| 358 | /* Member data overlaps previous data */ |
| 359 | VB2_ERROR_COMMON_MEMBER_OVERLAP, /* 0x150020 */ |
| 360 | |
| 361 | /* Signature bad magic number */ |
| 362 | VB2_ERROR_SIG_MAGIC, |
| 363 | |
| 364 | /* Signature incompatible version */ |
| 365 | VB2_ERROR_SIG_VERSION, |
| 366 | |
| 367 | /* Signature header doesn't fit */ |
| 368 | VB2_ERROR_SIG_HEADER_SIZE, |
| 369 | |
Randall Spangler | c0ce70b | 2014-10-31 11:19:14 -0700 | [diff] [blame] | 370 | /* Signature unsupported algorithm */ |
| 371 | VB2_ERROR_SIG_ALGORITHM, |
| 372 | |
| 373 | /* Signature bad size for algorithm */ |
| 374 | VB2_ERROR_SIG_SIZE, |
| 375 | |
Randall Spangler | 6b5b8f6 | 2014-10-31 15:18:48 -0700 | [diff] [blame] | 376 | /* Wrong amount of data signed */ |
| 377 | VB2_ERROR_VDATA_SIZE, |
| 378 | |
| 379 | /* Digest mismatch */ |
| 380 | VB2_ERROR_VDATA_VERIFY_DIGEST, |
| 381 | |
| 382 | /* Key algorithm doesn't match signature algorithm */ |
| 383 | VB2_ERROR_VDATA_ALGORITHM_MISMATCH, |
| 384 | |
Randall Spangler | 6e3931d | 2016-10-18 15:09:21 -0700 | [diff] [blame] | 385 | /* Bad magic number in vb2_unpack_key_buffer() */ |
ChromeOS Developer | 7aef90c | 2014-12-03 12:19:22 -0800 | [diff] [blame] | 386 | VB2_ERROR_UNPACK_KEY_MAGIC, |
| 387 | |
Randall Spangler | 6e3931d | 2016-10-18 15:09:21 -0700 | [diff] [blame] | 388 | /* Null public key buffer passed to vb2_unpack_key_buffer() */ |
| 389 | VB2_ERROR_UNPACK_KEY_BUFFER, |
| 390 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 391 | /********************************************************************** |
Randall Spangler | 224f5ac | 2014-06-06 09:42:30 -0700 | [diff] [blame] | 392 | * Keyblock verification errors (all in vb2_verify_keyblock()) |
| 393 | */ |
| 394 | VB2_ERROR_KEYBLOCK = VB2_ERROR_BASE + 0x060000, |
| 395 | |
| 396 | /* Data buffer too small for header */ |
| 397 | VB2_ERROR_KEYBLOCK_TOO_SMALL_FOR_HEADER, |
| 398 | |
| 399 | /* Magic number not present */ |
| 400 | VB2_ERROR_KEYBLOCK_MAGIC, |
| 401 | |
| 402 | /* Header version incompatible */ |
| 403 | VB2_ERROR_KEYBLOCK_HEADER_VERSION, |
| 404 | |
| 405 | /* Data buffer too small for keyblock */ |
| 406 | VB2_ERROR_KEYBLOCK_SIZE, |
| 407 | |
| 408 | /* Signature data offset outside keyblock */ |
| 409 | VB2_ERROR_KEYBLOCK_SIG_OUTSIDE, |
| 410 | |
| 411 | /* Signature signed more data than size of keyblock */ |
| 412 | VB2_ERROR_KEYBLOCK_SIGNED_TOO_MUCH, |
| 413 | |
| 414 | /* Signature signed less data than size of keyblock header */ |
| 415 | VB2_ERROR_KEYBLOCK_SIGNED_TOO_LITTLE, |
| 416 | |
| 417 | /* Signature invalid */ |
| 418 | VB2_ERROR_KEYBLOCK_SIG_INVALID, |
| 419 | |
| 420 | /* Data key outside keyblock */ |
| 421 | VB2_ERROR_KEYBLOCK_DATA_KEY_OUTSIDE, |
| 422 | |
| 423 | /* Data key outside signed part of keyblock */ |
| 424 | VB2_ERROR_KEYBLOCK_DATA_KEY_UNSIGNED, |
| 425 | |
Randall Spangler | 6b5b8f6 | 2014-10-31 15:18:48 -0700 | [diff] [blame] | 426 | /* Signature signed wrong amount of data */ |
| 427 | VB2_ERROR_KEYBLOCK_SIGNED_SIZE, |
| 428 | |
Bill Richardson | 36bc591 | 2015-03-04 16:13:45 -0800 | [diff] [blame] | 429 | /* No signature matching key ID */ |
| 430 | VB2_ERROR_KEYBLOCK_SIG_ID, |
Randall Spangler | 6b5b8f6 | 2014-10-31 15:18:48 -0700 | [diff] [blame] | 431 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 432 | /********************************************************************** |
Randall Spangler | 224f5ac | 2014-06-06 09:42:30 -0700 | [diff] [blame] | 433 | * Preamble verification errors (all in vb2_verify_preamble()) |
| 434 | */ |
| 435 | VB2_ERROR_PREAMBLE = VB2_ERROR_BASE + 0x070000, |
| 436 | |
| 437 | /* Preamble data too small to contain header */ |
| 438 | VB2_ERROR_PREAMBLE_TOO_SMALL_FOR_HEADER, |
| 439 | |
| 440 | /* Header version incompatible */ |
| 441 | VB2_ERROR_PREAMBLE_HEADER_VERSION, |
| 442 | |
| 443 | /* Header version too old */ |
| 444 | VB2_ERROR_PREAMBLE_HEADER_OLD, |
| 445 | |
| 446 | /* Data buffer too small for preamble */ |
| 447 | VB2_ERROR_PREAMBLE_SIZE, |
| 448 | |
| 449 | /* Signature data offset outside preamble */ |
| 450 | VB2_ERROR_PREAMBLE_SIG_OUTSIDE, |
| 451 | |
| 452 | /* Signature signed more data than size of preamble */ |
| 453 | VB2_ERROR_PREAMBLE_SIGNED_TOO_MUCH, |
| 454 | |
| 455 | /* Signature signed less data than size of preamble header */ |
| 456 | VB2_ERROR_PREAMBLE_SIGNED_TOO_LITTLE, |
| 457 | |
| 458 | /* Signature invalid */ |
| 459 | VB2_ERROR_PREAMBLE_SIG_INVALID, |
| 460 | |
| 461 | /* Body signature outside preamble */ |
| 462 | VB2_ERROR_PREAMBLE_BODY_SIG_OUTSIDE, |
| 463 | |
| 464 | /* Kernel subkey outside preamble */ |
| 465 | VB2_ERROR_PREAMBLE_KERNEL_SUBKEY_OUTSIDE, |
| 466 | |
Randall Spangler | 43e0a9e | 2014-11-04 17:50:32 -0800 | [diff] [blame] | 467 | /* Bad magic number */ |
| 468 | VB2_ERROR_PREAMBLE_MAGIC, |
| 469 | |
| 470 | /* Hash is signed */ |
| 471 | VB2_ERROR_PREAMBLE_HASH_SIGNED, |
| 472 | |
Randall Spangler | 2d25e83 | 2015-05-12 16:39:01 -0700 | [diff] [blame] | 473 | /* Bootloader outside signed portion of body */ |
| 474 | VB2_ERROR_PREAMBLE_BOOTLOADER_OUTSIDE, |
| 475 | |
| 476 | /* Vmlinuz header outside signed portion of body */ |
| 477 | VB2_ERROR_PREAMBLE_VMLINUZ_HEADER_OUTSIDE, |
| 478 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 479 | /********************************************************************** |
Randall Spangler | 224f5ac | 2014-06-06 09:42:30 -0700 | [diff] [blame] | 480 | * Misc higher-level code errors |
| 481 | */ |
| 482 | VB2_ERROR_MISC = VB2_ERROR_BASE + 0x080000, |
| 483 | |
Joel Kitching | ecdca93 | 2019-07-25 18:26:18 +0800 | [diff] [blame] | 484 | /* Work buffer too small (see vb2api_init and vb2api_reinit) */ |
| 485 | VB2_ERROR_WORKBUF_SMALL, |
Randall Spangler | 224f5ac | 2014-06-06 09:42:30 -0700 | [diff] [blame] | 486 | |
Joel Kitching | ecdca93 | 2019-07-25 18:26:18 +0800 | [diff] [blame] | 487 | /* Work buffer unaligned (see vb2api_init and vb2api_reinit) */ |
| 488 | VB2_ERROR_WORKBUF_ALIGN, |
Randall Spangler | 224f5ac | 2014-06-06 09:42:30 -0700 | [diff] [blame] | 489 | |
Joel Kitching | 3eb00ef | 2019-05-23 15:33:54 +0800 | [diff] [blame] | 490 | /* Work buffer too small in GBB-related function */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 491 | VB2_ERROR_GBB_WORKBUF, |
| 492 | |
| 493 | /* Bad magic number in vb2_read_gbb_header() */ |
| 494 | VB2_ERROR_GBB_MAGIC, |
| 495 | |
| 496 | /* Incompatible version in vb2_read_gbb_header() */ |
| 497 | VB2_ERROR_GBB_VERSION, |
| 498 | |
| 499 | /* Old version in vb2_read_gbb_header() */ |
| 500 | VB2_ERROR_GBB_TOO_OLD, |
| 501 | |
| 502 | /* Header size too small in vb2_read_gbb_header() */ |
| 503 | VB2_ERROR_GBB_HEADER_SIZE, |
| 504 | |
Randall Spangler | f18038b | 2014-10-23 15:55:21 -0700 | [diff] [blame] | 505 | /* Work buffer too small for root key in vb2_load_fw_keyblock() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 506 | VB2_ERROR_FW_KEYBLOCK_WORKBUF_ROOT_KEY, |
| 507 | |
Randall Spangler | f18038b | 2014-10-23 15:55:21 -0700 | [diff] [blame] | 508 | /* Work buffer too small for header in vb2_load_fw_keyblock() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 509 | VB2_ERROR_FW_KEYBLOCK_WORKBUF_HEADER, |
| 510 | |
Randall Spangler | f18038b | 2014-10-23 15:55:21 -0700 | [diff] [blame] | 511 | /* Work buffer too small for keyblock in vb2_load_fw_keyblock() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 512 | VB2_ERROR_FW_KEYBLOCK_WORKBUF, |
| 513 | |
Randall Spangler | f18038b | 2014-10-23 15:55:21 -0700 | [diff] [blame] | 514 | /* Keyblock version out of range in vb2_load_fw_keyblock() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 515 | VB2_ERROR_FW_KEYBLOCK_VERSION_RANGE, |
| 516 | |
Randall Spangler | f18038b | 2014-10-23 15:55:21 -0700 | [diff] [blame] | 517 | /* Keyblock version rollback in vb2_load_fw_keyblock() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 518 | VB2_ERROR_FW_KEYBLOCK_VERSION_ROLLBACK, |
| 519 | |
Randall Spangler | f18038b | 2014-10-23 15:55:21 -0700 | [diff] [blame] | 520 | /* Missing firmware data key in vb2_load_fw_preamble() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 521 | VB2_ERROR_FW_PREAMBLE2_DATA_KEY, |
| 522 | |
Randall Spangler | f18038b | 2014-10-23 15:55:21 -0700 | [diff] [blame] | 523 | /* Work buffer too small for header in vb2_load_fw_preamble() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 524 | VB2_ERROR_FW_PREAMBLE2_WORKBUF_HEADER, |
| 525 | |
Randall Spangler | f18038b | 2014-10-23 15:55:21 -0700 | [diff] [blame] | 526 | /* Work buffer too small for preamble in vb2_load_fw_preamble() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 527 | VB2_ERROR_FW_PREAMBLE2_WORKBUF, |
| 528 | |
Randall Spangler | f18038b | 2014-10-23 15:55:21 -0700 | [diff] [blame] | 529 | /* Firmware version out of range in vb2_load_fw_preamble() */ |
Randall Spangler | 308d254 | 2014-12-04 09:54:37 -0800 | [diff] [blame] | 530 | VB2_ERROR_FW_PREAMBLE_VERSION_RANGE, |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 531 | |
Randall Spangler | f18038b | 2014-10-23 15:55:21 -0700 | [diff] [blame] | 532 | /* Firmware version rollback in vb2_load_fw_preamble() */ |
Randall Spangler | 308d254 | 2014-12-04 09:54:37 -0800 | [diff] [blame] | 533 | VB2_ERROR_FW_PREAMBLE_VERSION_ROLLBACK, |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 534 | |
Randall Spangler | 837b408 | 2014-11-10 13:40:52 -0800 | [diff] [blame] | 535 | /* Not enough space in work buffer for resource object */ |
| 536 | VB2_ERROR_READ_RESOURCE_OBJECT_BUF, |
| 537 | |
Randall Spangler | 3d5cd88 | 2015-05-20 17:22:17 -0700 | [diff] [blame] | 538 | /* Work buffer too small for header in vb2_load_kernel_keyblock() */ |
| 539 | VB2_ERROR_KERNEL_KEYBLOCK_WORKBUF_HEADER, |
| 540 | |
| 541 | /* Work buffer too small for keyblock in vb2_load_kernel_keyblock() */ |
| 542 | VB2_ERROR_KERNEL_KEYBLOCK_WORKBUF, |
| 543 | |
| 544 | /* Keyblock version out of range in vb2_load_kernel_keyblock() */ |
| 545 | VB2_ERROR_KERNEL_KEYBLOCK_VERSION_RANGE, |
| 546 | |
| 547 | /* Keyblock version rollback in vb2_load_kernel_keyblock() */ |
| 548 | VB2_ERROR_KERNEL_KEYBLOCK_VERSION_ROLLBACK, |
| 549 | |
| 550 | /* |
| 551 | * Keyblock flags don't match current mode in |
| 552 | * vb2_load_kernel_keyblock(). |
| 553 | */ |
| 554 | VB2_ERROR_KERNEL_KEYBLOCK_DEV_FLAG, |
| 555 | VB2_ERROR_KERNEL_KEYBLOCK_REC_FLAG, |
| 556 | |
Randall Spangler | 22da78c | 2015-05-29 10:53:11 -0700 | [diff] [blame] | 557 | /* Missing firmware data key in vb2_load_kernel_preamble() */ |
| 558 | VB2_ERROR_KERNEL_PREAMBLE2_DATA_KEY, |
Randall Spangler | 3d5cd88 | 2015-05-20 17:22:17 -0700 | [diff] [blame] | 559 | |
Randall Spangler | 22da78c | 2015-05-29 10:53:11 -0700 | [diff] [blame] | 560 | /* Work buffer too small for header in vb2_load_kernel_preamble() */ |
| 561 | VB2_ERROR_KERNEL_PREAMBLE2_WORKBUF_HEADER, |
| 562 | |
| 563 | /* Work buffer too small for preamble in vb2_load_kernel_preamble() */ |
| 564 | VB2_ERROR_KERNEL_PREAMBLE2_WORKBUF, |
| 565 | |
| 566 | /* Kernel version out of range in vb2_load_kernel_preamble() */ |
| 567 | VB2_ERROR_KERNEL_PREAMBLE_VERSION_RANGE, |
| 568 | |
| 569 | /* Kernel version rollback in vb2_load_kernel_preamble() */ |
| 570 | VB2_ERROR_KERNEL_PREAMBLE_VERSION_ROLLBACK, |
| 571 | |
| 572 | /* Kernel preamble not loaded before calling vb2api_get_kernel_size() */ |
| 573 | VB2_ERROR_API_GET_KERNEL_SIZE_PREAMBLE, |
Randall Spangler | 3d5cd88 | 2015-05-20 17:22:17 -0700 | [diff] [blame] | 574 | |
Randall Spangler | f182401 | 2016-10-25 10:00:27 -0700 | [diff] [blame] | 575 | /* Unable to unpack kernel subkey in vb2_verify_vblock() */ |
| 576 | VB2_ERROR_VBLOCK_KERNEL_SUBKEY, |
| 577 | |
| 578 | /* |
| 579 | * Got a self-signed kernel in vb2_verify_vblock(), but need an |
| 580 | * officially signed one. |
| 581 | */ |
| 582 | VB2_ERROR_VBLOCK_SELF_SIGNED, |
| 583 | |
| 584 | /* Invalid keyblock hash in vb2_verify_vblock() */ |
| 585 | VB2_ERROR_VBLOCK_KEYBLOCK_HASH, |
| 586 | |
| 587 | /* Invalid keyblock in vb2_verify_vblock() */ |
| 588 | VB2_ERROR_VBLOCK_KEYBLOCK, |
| 589 | |
| 590 | /* Wrong developer key hash in vb2_verify_vblock() */ |
| 591 | VB2_ERROR_VBLOCK_DEV_KEY_HASH, |
| 592 | |
| 593 | /* Work buffer too small in vb2_load_partition() */ |
| 594 | VB2_ERROR_LOAD_PARTITION_WORKBUF, |
| 595 | |
| 596 | /* Unable to read vblock in vb2_load_partition() */ |
| 597 | VB2_ERROR_LOAD_PARTITION_READ_VBLOCK, |
| 598 | |
| 599 | /* Unable to verify vblock in vb2_load_partition() */ |
| 600 | VB2_ERROR_LOAD_PARTITION_VERIFY_VBLOCK, |
| 601 | |
| 602 | /* Kernel body offset too large in vb2_load_partition() */ |
| 603 | VB2_ERROR_LOAD_PARTITION_BODY_OFFSET, |
| 604 | |
| 605 | /* Kernel body too big in vb2_load_partition() */ |
| 606 | VB2_ERROR_LOAD_PARTITION_BODY_SIZE, |
| 607 | |
| 608 | /* Unable to read kernel body in vb2_load_partition() */ |
| 609 | VB2_ERROR_LOAD_PARTITION_READ_BODY, |
| 610 | |
| 611 | /* Unable to unpack data key in vb2_load_partition() */ |
| 612 | VB2_ERROR_LOAD_PARTITION_DATA_KEY, |
| 613 | |
| 614 | /* Unable to verify body in vb2_load_partition() */ |
| 615 | VB2_ERROR_LOAD_PARTITION_VERIFY_BODY, |
| 616 | |
ChromeOS Developer | 284bf55 | 2016-10-31 16:19:20 -0700 | [diff] [blame] | 617 | /* Unable to get EC image hash in ec_sync_phase1() */ |
| 618 | VB2_ERROR_EC_HASH_IMAGE, |
| 619 | |
| 620 | /* Unable to get expected EC image hash in ec_sync_phase1() */ |
| 621 | VB2_ERROR_EC_HASH_EXPECTED, |
| 622 | |
| 623 | /* Expected and image hashes are different size in ec_sync_phase1() */ |
| 624 | VB2_ERROR_EC_HASH_SIZE, |
| 625 | |
Joel Kitching | dccea9a | 2019-01-11 19:16:18 +0800 | [diff] [blame] | 626 | /* Incompatible version for vb2_shared_data structure being loaded */ |
| 627 | VB2_ERROR_SHARED_DATA_VERSION, |
| 628 | |
| 629 | /* Bad magic number in vb2_shared_data structure */ |
| 630 | VB2_ERROR_SHARED_DATA_MAGIC, |
| 631 | |
Joel Kitching | 3eb00ef | 2019-05-23 15:33:54 +0800 | [diff] [blame] | 632 | /* Some part of GBB data is invalid */ |
| 633 | VB2_ERROR_GBB_INVALID, |
| 634 | |
| 635 | /* Invalid parameter */ |
| 636 | VB2_ERROR_INVALID_PARAMETER, |
| 637 | |
Joel Kitching | ecdca93 | 2019-07-25 18:26:18 +0800 | [diff] [blame] | 638 | /* Problem with workbuf validity (see vb2api_init and vb2api_reinit) */ |
| 639 | VB2_ERROR_WORKBUF_INVALID, |
| 640 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 641 | /********************************************************************** |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 642 | * API-level errors |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 643 | */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 644 | VB2_ERROR_API = VB2_ERROR_BASE + 0x090000, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 645 | |
Bill Richardson | 9c647ef | 2015-03-03 10:39:08 -0800 | [diff] [blame] | 646 | /* Bad tag in vb2api_init_hash() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 647 | VB2_ERROR_API_INIT_HASH_TAG, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 648 | |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 649 | /* Preamble not present in vb2api_init_hash() */ |
| 650 | VB2_ERROR_API_INIT_HASH_PREAMBLE, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 651 | |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 652 | /* Work buffer too small in vb2api_init_hash() */ |
| 653 | VB2_ERROR_API_INIT_HASH_WORKBUF, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 654 | |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 655 | /* Missing firmware data key in vb2api_init_hash() */ |
| 656 | VB2_ERROR_API_INIT_HASH_DATA_KEY, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 657 | |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 658 | /* Uninitialized work area in vb2api_extend_hash() */ |
| 659 | VB2_ERROR_API_EXTEND_HASH_WORKBUF, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 660 | |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 661 | /* Too much data hashed in vb2api_extend_hash() */ |
| 662 | VB2_ERROR_API_EXTEND_HASH_SIZE, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 663 | |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 664 | /* Preamble not present in vb2api_check_hash() */ |
| 665 | VB2_ERROR_API_CHECK_HASH_PREAMBLE, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 666 | |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 667 | /* Uninitialized work area in vb2api_check_hash() */ |
| 668 | VB2_ERROR_API_CHECK_HASH_WORKBUF, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 669 | |
Randall Spangler | a7ab8b5 | 2014-06-10 17:05:08 -0700 | [diff] [blame] | 670 | /* Wrong amount of data hashed in vb2api_check_hash() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 671 | VB2_ERROR_API_CHECK_HASH_SIZE, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 672 | |
Randall Spangler | a7ab8b5 | 2014-06-10 17:05:08 -0700 | [diff] [blame] | 673 | /* Work buffer too small in vb2api_check_hash() */ |
| 674 | VB2_ERROR_API_CHECK_HASH_WORKBUF_DIGEST, |
| 675 | |
Bill Richardson | 9c647ef | 2015-03-03 10:39:08 -0800 | [diff] [blame] | 676 | /* Bad tag in vb2api_check_hash() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 677 | VB2_ERROR_API_CHECK_HASH_TAG, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 678 | |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 679 | /* Missing firmware data key in vb2api_check_hash() */ |
| 680 | VB2_ERROR_API_CHECK_HASH_DATA_KEY, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 681 | |
Bill Richardson | 9c647ef | 2015-03-03 10:39:08 -0800 | [diff] [blame] | 682 | /* Signature size mismatch in vb2api_check_hash() */ |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 683 | VB2_ERROR_API_CHECK_HASH_SIG_SIZE, |
| 684 | |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 685 | /* Phase one needs recovery mode */ |
| 686 | VB2_ERROR_API_PHASE1_RECOVERY, |
| 687 | |
Bill Richardson | 9c647ef | 2015-03-03 10:39:08 -0800 | [diff] [blame] | 688 | /* Bad tag in vb2api_check_hash() */ |
Bill Richardson | 36bc591 | 2015-03-04 16:13:45 -0800 | [diff] [blame] | 689 | VB2_ERROR_API_INIT_HASH_ID, |
Randall Spangler | efa37b8 | 2014-11-12 16:20:50 -0800 | [diff] [blame] | 690 | |
Bill Richardson | 9c647ef | 2015-03-03 10:39:08 -0800 | [diff] [blame] | 691 | /* Signature mismatch in vb2api_check_hash() */ |
Randall Spangler | efa37b8 | 2014-11-12 16:20:50 -0800 | [diff] [blame] | 692 | VB2_ERROR_API_CHECK_HASH_SIG, |
| 693 | |
Daisuke Nojiri | 62d482e | 2015-01-29 14:37:25 -0800 | [diff] [blame] | 694 | /* Invalid enum vb2_pcr_digest requested to vb2api_get_pcr_digest */ |
| 695 | VB2_ERROR_API_PCR_DIGEST, |
| 696 | |
| 697 | /* Buffer size for the digest is too small for vb2api_get_pcr_digest */ |
| 698 | VB2_ERROR_API_PCR_DIGEST_BUF, |
| 699 | |
Randall Spangler | d7f0f93 | 2015-05-19 13:41:09 -0700 | [diff] [blame] | 700 | /* Work buffer too small for recovery key in vb2api_kernel_phase1() */ |
| 701 | VB2_ERROR_API_KPHASE1_WORKBUF_REC_KEY, |
| 702 | |
| 703 | /* Firmware preamble not present for vb2api_kernel_phase1() */ |
| 704 | VB2_ERROR_API_KPHASE1_PREAMBLE, |
| 705 | |
| 706 | /* Wrong amount of kernel data in vb2api_verify_kernel_data() */ |
| 707 | VB2_ERROR_API_VERIFY_KDATA_SIZE, |
| 708 | |
| 709 | /* Kernel preamble not present for vb2api_verify_kernel_data() */ |
| 710 | VB2_ERROR_API_VERIFY_KDATA_PREAMBLE, |
| 711 | |
| 712 | /* Insufficient workbuf for hashing in vb2api_verify_kernel_data() */ |
| 713 | VB2_ERROR_API_VERIFY_KDATA_WORKBUF, |
| 714 | |
| 715 | /* Bad data key in vb2api_verify_kernel_data() */ |
| 716 | VB2_ERROR_API_VERIFY_KDATA_KEY, |
| 717 | |
Randall Spangler | c8e4854 | 2015-09-17 12:54:51 -0700 | [diff] [blame] | 718 | /* Phase one passing through secdata's request to reboot */ |
| 719 | VB2_ERROR_API_PHASE1_SECDATA_REBOOT, |
| 720 | |
Aaron Durbin | 7cbd1ce | 2016-01-22 15:06:05 -0600 | [diff] [blame] | 721 | /* Digest buffer passed into vb2api_check_hash incorrect. */ |
| 722 | VB2_ERROR_API_CHECK_DIGEST_SIZE, |
| 723 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 724 | /********************************************************************** |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 725 | * Errors which may be generated by implementations of vb2ex functions. |
| 726 | * Implementation may also return its own specific errors, which should |
| 727 | * NOT be in the range VB2_ERROR_BASE...VB2_ERROR_MAX to avoid |
| 728 | * conflicting with future vboot2 error codes. |
| 729 | */ |
| 730 | VB2_ERROR_EX = VB2_ERROR_BASE + 0x0a0000, |
| 731 | |
Joel Kitching | a1df89d | 2018-12-03 14:39:57 +0800 | [diff] [blame] | 732 | /* Read resource not implemented |
| 733 | * Deprecated: use VB2_ERROR_EX_UNIMPLEMENTED (chromium:944804) */ |
| 734 | VB2_ERROR_EX_DEPRECATED_READ_RESOURCE_UNIMPLEMENTED, |
Randall Spangler | 25c95d0 | 2014-06-20 13:57:12 -0700 | [diff] [blame] | 735 | |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 736 | /* Resource index not found */ |
| 737 | VB2_ERROR_EX_READ_RESOURCE_INDEX, |
| 738 | |
| 739 | /* Size of resource not big enough for requested offset and/or size */ |
| 740 | VB2_ERROR_EX_READ_RESOURCE_SIZE, |
| 741 | |
| 742 | /* TPM clear owner failed */ |
| 743 | VB2_ERROR_EX_TPM_CLEAR_OWNER, |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 744 | |
Joel Kitching | a1df89d | 2018-12-03 14:39:57 +0800 | [diff] [blame] | 745 | /* TPM clear owner not implemented |
| 746 | * Deprecated: use VB2_ERROR_EX_UNIMPLEMENTED (chromium:944804) */ |
| 747 | VB2_ERROR_DEPRECATED_EX_TPM_CLEAR_OWNER_UNIMPLEMENTED, |
Randall Spangler | 25c95d0 | 2014-06-20 13:57:12 -0700 | [diff] [blame] | 748 | |
Julius Werner | f10e909 | 2014-12-16 19:24:54 -0800 | [diff] [blame] | 749 | /* Hardware crypto engine doesn't support this algorithm (non-fatal) */ |
| 750 | VB2_ERROR_EX_HWCRYPTO_UNSUPPORTED, |
| 751 | |
Matt Delco | 08bf680 | 2019-02-13 15:54:24 -0800 | [diff] [blame] | 752 | /* TPM does not understand this command */ |
| 753 | VB2_ERROR_EX_TPM_NO_SUCH_COMMAND, |
Randall Spangler | 02e11b3 | 2014-11-19 12:48:36 -0800 | [diff] [blame] | 754 | |
Joel Kitching | a1df89d | 2018-12-03 14:39:57 +0800 | [diff] [blame] | 755 | /* vb2ex function is unimplemented (stubbed in 2lib/2stub.c) */ |
| 756 | VB2_ERROR_EX_UNIMPLEMENTED, |
| 757 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 758 | /********************************************************************** |
Randall Spangler | 02e11b3 | 2014-11-19 12:48:36 -0800 | [diff] [blame] | 759 | * Errors generated by host library (non-firmware) start here. |
| 760 | */ |
| 761 | VB2_ERROR_HOST_BASE = 0x20000000, |
| 762 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 763 | /********************************************************************** |
Randall Spangler | 02e11b3 | 2014-11-19 12:48:36 -0800 | [diff] [blame] | 764 | * Errors generated by host library misc functions |
| 765 | */ |
| 766 | VB2_ERROR_HOST_MISC = VB2_ERROR_HOST_BASE + 0x010000, |
| 767 | |
| 768 | /* Unable to open file in read_file() */ |
| 769 | VB2_ERROR_READ_FILE_OPEN, |
| 770 | |
| 771 | /* Bad size in read_file() */ |
| 772 | VB2_ERROR_READ_FILE_SIZE, |
| 773 | |
| 774 | /* Unable to allocate buffer in read_file() */ |
| 775 | VB2_ERROR_READ_FILE_ALLOC, |
| 776 | |
| 777 | /* Unable to read data in read_file() */ |
| 778 | VB2_ERROR_READ_FILE_DATA, |
| 779 | |
| 780 | /* Unable to open file in write_file() */ |
| 781 | VB2_ERROR_WRITE_FILE_OPEN, |
| 782 | |
| 783 | /* Unable to write data in write_file() */ |
| 784 | VB2_ERROR_WRITE_FILE_DATA, |
| 785 | |
Bill Richardson | 36bc591 | 2015-03-04 16:13:45 -0800 | [diff] [blame] | 786 | /* Unable to convert string to struct vb_id */ |
| 787 | VB2_ERROR_STR_TO_ID, |
Bill Richardson | 4e4c196 | 2015-02-03 17:07:15 -0800 | [diff] [blame] | 788 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 789 | /********************************************************************** |
Randall Spangler | 59c2920 | 2014-11-17 14:24:59 -0800 | [diff] [blame] | 790 | * Errors generated by host library key functions |
| 791 | */ |
| 792 | VB2_ERROR_HOST_KEY = VB2_ERROR_HOST_BASE + 0x020000, |
| 793 | |
| 794 | /* Unable to allocate key in vb2_private_key_read_pem() */ |
| 795 | VB2_ERROR_READ_PEM_ALLOC, |
| 796 | |
| 797 | /* Unable to open .pem file in vb2_private_key_read_pem() */ |
| 798 | VB2_ERROR_READ_PEM_FILE_OPEN, |
| 799 | |
| 800 | /* Bad RSA data from .pem file in vb2_private_key_read_pem() */ |
| 801 | VB2_ERROR_READ_PEM_RSA, |
| 802 | |
| 803 | /* Unable to set private key description */ |
| 804 | VB2_ERROR_PRIVATE_KEY_SET_DESC, |
| 805 | |
| 806 | /* Bad magic number in vb2_private_key_unpack() */ |
| 807 | VB2_ERROR_UNPACK_PRIVATE_KEY_MAGIC, |
| 808 | |
| 809 | /* Bad common header in vb2_private_key_unpack() */ |
| 810 | VB2_ERROR_UNPACK_PRIVATE_KEY_HEADER, |
| 811 | |
| 812 | /* Bad key data in vb2_private_key_unpack() */ |
| 813 | VB2_ERROR_UNPACK_PRIVATE_KEY_DATA, |
| 814 | |
| 815 | /* Bad struct version in vb2_private_key_unpack() */ |
| 816 | VB2_ERROR_UNPACK_PRIVATE_KEY_STRUCT_VERSION, |
| 817 | |
| 818 | /* Unable to allocate buffer in vb2_private_key_unpack() */ |
| 819 | VB2_ERROR_UNPACK_PRIVATE_KEY_ALLOC, |
| 820 | |
| 821 | /* Unable to unpack RSA key in vb2_private_key_unpack() */ |
| 822 | VB2_ERROR_UNPACK_PRIVATE_KEY_RSA, |
| 823 | |
| 824 | /* Unable to set description in vb2_private_key_unpack() */ |
| 825 | VB2_ERROR_UNPACK_PRIVATE_KEY_DESC, |
| 826 | |
Randall Spangler | fb9a216 | 2014-11-20 11:27:38 -0800 | [diff] [blame] | 827 | /* Bad bare hash key in vb2_private_key_unpack() */ |
| 828 | VB2_ERROR_UNPACK_PRIVATE_KEY_HASH, |
| 829 | |
Randall Spangler | 59c2920 | 2014-11-17 14:24:59 -0800 | [diff] [blame] | 830 | /* Unable to create RSA data in vb2_private_key_write() */ |
| 831 | VB2_ERROR_PRIVATE_KEY_WRITE_RSA, |
| 832 | |
| 833 | /* Unable to allocate packed key buffer in vb2_private_key_write() */ |
| 834 | VB2_ERROR_PRIVATE_KEY_WRITE_ALLOC, |
| 835 | |
| 836 | /* Unable to write file in vb2_private_key_write() */ |
| 837 | VB2_ERROR_PRIVATE_KEY_WRITE_FILE, |
| 838 | |
Randall Spangler | fb9a216 | 2014-11-20 11:27:38 -0800 | [diff] [blame] | 839 | /* Bad algorithm in vb2_private_key_hash() */ |
| 840 | VB2_ERROR_PRIVATE_KEY_HASH, |
| 841 | |
Randall Spangler | 59c2920 | 2014-11-17 14:24:59 -0800 | [diff] [blame] | 842 | /* Unable to determine key size in vb2_public_key_alloc() */ |
| 843 | VB2_ERROR_PUBLIC_KEY_ALLOC_SIZE, |
| 844 | |
| 845 | /* Unable to allocate buffer in vb2_public_key_alloc() */ |
| 846 | VB2_ERROR_PUBLIC_KEY_ALLOC, |
| 847 | |
| 848 | /* Unable to set public key description */ |
| 849 | VB2_ERROR_PUBLIC_KEY_SET_DESC, |
| 850 | |
| 851 | /* Unable to read key data in vb2_public_key_read_keyb() */ |
| 852 | VB2_ERROR_READ_KEYB_DATA, |
| 853 | |
| 854 | /* Wrong amount of data read in vb2_public_key_read_keyb() */ |
| 855 | VB2_ERROR_READ_KEYB_SIZE, |
| 856 | |
| 857 | /* Unable to allocate key buffer in vb2_public_key_read_keyb() */ |
| 858 | VB2_ERROR_READ_KEYB_ALLOC, |
| 859 | |
| 860 | /* Error unpacking RSA arrays in vb2_public_key_read_keyb() */ |
| 861 | VB2_ERROR_READ_KEYB_UNPACK, |
| 862 | |
| 863 | /* Unable to read key data in vb2_packed_key_read() */ |
| 864 | VB2_ERROR_READ_PACKED_KEY_DATA, |
| 865 | |
| 866 | /* Bad key data in vb2_packed_key_read() */ |
| 867 | VB2_ERROR_READ_PACKED_KEY, |
| 868 | |
| 869 | /* Unable to determine key size in vb2_public_key_pack() */ |
| 870 | VB2_ERROR_PUBLIC_KEY_PACK_SIZE, |
| 871 | |
Bill Richardson | 4e4c196 | 2015-02-03 17:07:15 -0800 | [diff] [blame] | 872 | /* Bad hash algorithm in vb2_public_key_hash() */ |
Randall Spangler | fb9a216 | 2014-11-20 11:27:38 -0800 | [diff] [blame] | 873 | VB2_ERROR_PUBLIC_KEY_HASH, |
| 874 | |
Randall Spangler | 939cc3a | 2016-06-21 15:23:32 -0700 | [diff] [blame] | 875 | /* Bad key size in vb2_copy_packed_key() */ |
| 876 | VB2_ERROR_COPY_KEY_SIZE, |
| 877 | |
Randall Spangler | d46461c | 2016-06-22 16:46:23 -0700 | [diff] [blame] | 878 | /* Unable to convert back to vb1 crypto algorithm */ |
| 879 | VB2_ERROR_VB1_CRYPTO_ALGORITHM, |
| 880 | |
Randall Spangler | f7559e4 | 2016-06-23 13:45:59 -0700 | [diff] [blame] | 881 | /* Unable to allocate packed key */ |
| 882 | VB2_ERROR_PACKED_KEY_ALLOC, |
| 883 | |
| 884 | /* Unable to copy packed key */ |
| 885 | VB2_ERROR_PACKED_KEY_COPY, |
| 886 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 887 | /********************************************************************** |
Randall Spangler | c644a8c | 2014-11-21 11:04:36 -0800 | [diff] [blame] | 888 | * Errors generated by host library signature functions |
| 889 | */ |
| 890 | VB2_ERROR_HOST_SIG = VB2_ERROR_HOST_BASE + 0x030000, |
| 891 | |
| 892 | /* Bad hash algorithm in vb2_digest_info() */ |
| 893 | VB2_ERROR_DIGEST_INFO, |
| 894 | |
| 895 | /* |
| 896 | * Unable to determine signature size for key algorithm in |
| 897 | * vb2_sig_size_for_key(). |
| 898 | */ |
| 899 | VB2_ERROR_SIG_SIZE_FOR_KEY, |
| 900 | |
| 901 | /* Bad signature size in vb2_sign_data() */ |
| 902 | VB2_SIGN_DATA_SIG_SIZE, |
| 903 | |
| 904 | /* Unable to get digest info in vb2_sign_data() */ |
| 905 | VB2_SIGN_DATA_DIGEST_INFO, |
| 906 | |
| 907 | /* Unable to get digest size in vb2_sign_data() */ |
| 908 | VB2_SIGN_DATA_DIGEST_SIZE, |
| 909 | |
| 910 | /* Unable to allocate digest buffer in vb2_sign_data() */ |
| 911 | VB2_SIGN_DATA_DIGEST_ALLOC, |
| 912 | |
| 913 | /* Unable to initialize digest in vb2_sign_data() */ |
| 914 | VB2_SIGN_DATA_DIGEST_INIT, |
| 915 | |
| 916 | /* Unable to extend digest in vb2_sign_data() */ |
| 917 | VB2_SIGN_DATA_DIGEST_EXTEND, |
| 918 | |
| 919 | /* Unable to finalize digest in vb2_sign_data() */ |
| 920 | VB2_SIGN_DATA_DIGEST_FINALIZE, |
| 921 | |
| 922 | /* RSA encrypt failed in vb2_sign_data() */ |
| 923 | VB2_SIGN_DATA_RSA_ENCRYPT, |
| 924 | |
| 925 | /* Not enough buffer space to hold signature in vb2_sign_object() */ |
| 926 | VB2_SIGN_OBJECT_OVERFLOW, |
| 927 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 928 | /********************************************************************** |
Randall Spangler | 9328bbf | 2014-11-24 12:55:29 -0800 | [diff] [blame] | 929 | * Errors generated by host library keyblock functions |
| 930 | */ |
| 931 | VB2_ERROR_HOST_KEYBLOCK = VB2_ERROR_HOST_BASE + 0x040000, |
| 932 | |
| 933 | /* Unable to determine signature sizes for vb2_create_keyblock() */ |
| 934 | VB2_KEYBLOCK_CREATE_SIG_SIZE, |
| 935 | |
| 936 | /* Unable to pack data key for vb2_create_keyblock() */ |
| 937 | VB2_KEYBLOCK_CREATE_DATA_KEY, |
| 938 | |
| 939 | /* Unable to allocate buffer in vb2_create_keyblock() */ |
| 940 | VB2_KEYBLOCK_CREATE_ALLOC, |
| 941 | |
| 942 | /* Unable to sign keyblock in vb2_create_keyblock() */ |
| 943 | VB2_KEYBLOCK_CREATE_SIGN, |
| 944 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 945 | /********************************************************************** |
Randall Spangler | 42a8500 | 2014-11-25 10:52:59 -0800 | [diff] [blame] | 946 | * Errors generated by host library firmware preamble functions |
| 947 | */ |
| 948 | VB2_ERROR_HOST_FW_PREAMBLE = VB2_ERROR_HOST_BASE + 0x050000, |
| 949 | |
| 950 | /* Unable to determine signature sizes for vb2_create_fw_preamble() */ |
| 951 | VB2_FW_PREAMBLE_CREATE_SIG_SIZE, |
| 952 | |
| 953 | /* Unable to allocate buffer in vb2_create_fw_preamble() */ |
| 954 | VB2_FW_PREAMBLE_CREATE_ALLOC, |
| 955 | |
| 956 | /* Unable to sign preamble in vb2_create_fw_preamble() */ |
| 957 | VB2_FW_PREAMBLE_CREATE_SIGN, |
| 958 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 959 | /********************************************************************** |
Randall Spangler | f87aa72 | 2016-09-09 10:49:37 -0700 | [diff] [blame] | 960 | * Errors generated by unit test functions |
| 961 | */ |
| 962 | VB2_ERROR_UNIT_TEST = VB2_ERROR_HOST_BASE + 0x060000, |
| 963 | |
| 964 | /* Unable to open an input file needed for a unit test */ |
| 965 | VB2_ERROR_TEST_INPUT_FILE, |
| 966 | |
Joel Kitching | 9ad8a41 | 2018-08-02 16:21:17 +0800 | [diff] [blame] | 967 | /********************************************************************** |
Randall Spangler | b9be536 | 2014-06-05 13:32:11 -0700 | [diff] [blame] | 968 | * Highest non-zero error generated inside vboot library. Note that |
| 969 | * error codes passed through vboot when it calls external APIs may |
| 970 | * still be outside this range. |
| 971 | */ |
Randall Spangler | 02e11b3 | 2014-11-19 12:48:36 -0800 | [diff] [blame] | 972 | VB2_ERROR_MAX = VB2_ERROR_BASE + 0x1fffffff, |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 973 | }; |
| 974 | |
Joel Kitching | 9adf2aa | 2019-08-20 17:43:50 +0800 | [diff] [blame] | 975 | #endif /* VBOOT_REFERENCE_2RETURN_CODES_H_ */ |