1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _BOOT_IMAGES_VERIFIER_ERROR_H
8 #define _BOOT_IMAGES_VERIFIER_ERROR_H
9 
10 #ifdef __cplusplus
11 extern "C"
12 {
13 #endif
14 
15 #include "secureboot_error.h"
16 
17 /*! @file
18 @brief This file contains error code definitions used for the Secure Boot and Secure Debug APIs.
19 */
20 
21 /*! Defines error code for invalid input parameters. */
22 #define CC_BOOT_IMG_VERIFIER_INV_INPUT_PARAM                            (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000001)
23 /*! Defines error code for invalid OTP version. */
24 #define CC_BOOT_IMG_VERIFIER_OTP_VERSION_FAILURE                        (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000002)
25 /*! Defines error code for illegal certificate's magic number. */
26 #define CC_BOOT_IMG_VERIFIER_CERT_MAGIC_NUM_INCORRECT                   (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000003)
27 /*! Defines error code for illegal certificate version. */
28 #define CC_BOOT_IMG_VERIFIER_CERT_VERSION_NUM_INCORRECT                 (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000004)
29 /*! Defines error code for illegal certificate SW version, that is smaller than the version stored in the OTP. */
30 #define CC_BOOT_IMG_VERIFIER_SW_VER_SMALLER_THAN_MIN_VER                (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000005)
31 /*! Defines error code for public key verification compared to the OTP value failed. */
32 #define CC_BOOT_IMG_VERIFIER_PUB_KEY_HASH_VALIDATION_FAILURE            (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000006)
33 /*! Defines error code for certificate's RSA signature verification failure. */
34 #define CC_BOOT_IMG_VERIFIER_RSA_SIG_VERIFICATION_FAILED                (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000007)
35 /*! Defines error code for workspace buffer given to the API is too small. */
36 #define CC_BOOT_IMG_VERIFIER_WORKSPACE_SIZE_TOO_SMALL                   (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000008)
37 /*! Defines error code for SW image hash verification failure. */
38 #define CC_BOOT_IMG_VERIFIER_SW_COMP_FAILED_VERIFICATION                (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000009)
39 /*! Defines error code for illegal SW version or ID of SW version. */
40 #define CC_BOOT_IMG_VERIFIER_CERT_SW_VER_ILLEGAL                (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x0000000D)
41 /*! Defines error code for illegal number of SW components (zero). */
42 #define CC_BOOT_IMG_VERIFIER_SW_COMP_SIZE_IS_NULL                       (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000011)
43 /*! Defines error code for hash of public key is not burned yet. */
44 #define CC_BOOT_IMG_VERIFIER_PUBLIC_KEY_HASH_EMPTY                      (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000014)
45 /*! Defines error code for illegal lifecycle state (LCS) for operation.*/
46 #define CC_BOOT_IMG_VERIFIER_ILLEGAL_LCS_FOR_OPERATION_ERR          (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000015)
47 /*! Defines error code for hash of public key is already programmed.*/
48 #define CC_BOOT_IMG_VERIFIER_PUB_KEY_ALREADY_PROGRAMMED_ERR     (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000016)
49 /*! Defines error code for OTP write failure.*/
50 #define CC_BOOT_IMG_VERIFIER_OTP_WRITE_FAIL_ERR             (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000017)
51 /*! Defines error code for incorrect certificate type.*/
52 #define CC_BOOT_IMG_VERIFIER_INCORRECT_CERT_TYPE            (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000018)
53 /*! Defines error code for illegal Hash boot key index.*/
54 #define CC_BOOT_IMG_VERIFIER_ILLEGAL_HBK_IDX                (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000019)
55 /*! Defines error code for hash boot key of ICV is not programmed.*/
56 #define CC_BOOT_IMG_VERIFIER_PUB_KEY1_NOT_PROGRAMMED_ERR        (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x0000001A)
57 /*! Defines error code for illegal certificate version value.*/
58 #define CC_BOOT_IMG_VERIFIER_CERT_VER_VAL_ILLEGAL               (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x0000001C)
59 /*! Defines error code for illegal certificate decoding value.*/
60 #define CC_BOOT_IMG_VERIFIER_CERT_DECODING_ILLEGAL              (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x0000001D)
61 /*! Defines error code for illegal Kce in RMA LCS.*/
62 #define CC_BOOT_IMG_VERIFIER_ILLEGAL_KCE_IN_RMA_STATE               (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x0000001E)
63 /*! Defines error code for illegal SOC ID value.*/
64 #define CC_BOOT_IMG_VERIFIER_ILLEGAL_SOC_ID_VALUE               (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x0000001F)
65 /*! Defines error code for illegal number of SW images per content certificate. */
66 #define CC_BOOT_IMG_VERIFIER_ILLEGAL_NUM_OF_IMAGES              (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000020)
67 /*! Defines error code for no need to verify hashed public key. */
68 #define CC_BOOT_IMG_VERIFIER_SKIP_PUBLIC_KEY_VERIFY                      (CC_BOOT_IMG_VERIFIER_BASE_ERROR + 0x00000014)
69 
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif
76 
77 
78