rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | |
| 2 | #ifndef CUSTOM_SEC_KEY_H |
| 3 | #define CUSTOM_SEC_KEY_H |
| 4 | |
| 5 | |
| 6 | #include "kal_general_types.h" |
| 7 | #include "cust_chl_interface.h" |
| 8 | |
| 9 | #define CUST_SEC_KEY_STRUCT_VER 1 |
| 10 | #define CUST_SEC_KEY_STRUCT_MAGIC "CUS_KEY" |
| 11 | #define CUST_SEC_MAX_PUB_KEY_LEN 15 |
| 12 | |
| 13 | typedef struct |
| 14 | { |
| 15 | /* a unique magic pattern to identify SEC_KEY_ST structure */ |
| 16 | kal_char m_magic[8]; |
| 17 | |
| 18 | /* version of SEC_KEY_ST structure */ |
| 19 | kal_uint32 m_sec_key_st_ver; |
| 20 | |
| 21 | t_cust_chl_asym_key m_key[CUST_SEC_MAX_PUB_KEY_LEN]; |
| 22 | |
| 23 | } CUST_SEC_KEY_ST; |
| 24 | |
| 25 | /* MTK internal-use key array index */ |
| 26 | typedef enum |
| 27 | { |
| 28 | TM_PUBK_KEY0 = 0, |
| 29 | XM_PUBK_KEY1 = 1, |
| 30 | SP_PUBK_KEY2 = 2, |
| 31 | META_SLA_PUBK_KEY3 = 3, |
| 32 | AT_SLA_PUBK_KEY = 4, |
| 33 | VZ_PUBK_KEY = 5, |
| 34 | KDDI_PUBK_KEY = 6, |
| 35 | ATT_PUBK_KEY = 7, |
| 36 | CRK_PUBK_KEY = 8, |
| 37 | TM_PUBK_KEY1 = 9, |
| 38 | MCF_PUBK_KEY1 = 10, |
| 39 | MCF_PUBK_KEY2 = 11, |
| 40 | MIPC_SLA_PUBK_KEY1 = 12, |
| 41 | MIPC_SLA_PUBK_KEY2 = 13, |
| 42 | MIPC_SLA_PUBK_KEY3 = 14 |
| 43 | }CUST_SEC_ASYM_KEY_E; |
| 44 | |
| 45 | #define CUST_SEC_ROOT_CERT_STRUCT_VER 1 |
| 46 | #define CUST_SEC_ROOT_CERT_STRUCT_MAGIC "CUS_RCT" |
| 47 | #define CUST_SEC_MAX_ROOT_CERT_LEN 1 |
| 48 | |
| 49 | typedef struct |
| 50 | { |
| 51 | /* a unique magic pattern to identify SEC_CERT_ST structure */ |
| 52 | kal_char m_magic[8]; |
| 53 | |
| 54 | /* version of SEC_CERT_ST structure */ |
| 55 | kal_uint32 m_sec_cert_st_ver; |
| 56 | |
| 57 | /* root cert, maximum size: 2048 byte */ |
| 58 | unsigned char root_cert[CUST_SEC_MAX_ROOT_CERT_LEN][2048]; |
| 59 | |
| 60 | }CUST_SEC_CERT_ST; |
| 61 | |
| 62 | extern kal_uint32 cust_sec_get_asym_key(kal_uint32 key_index, t_cust_chl_asym_key * key); |
| 63 | extern kal_uint32 cust_ext_get_asym_key(kal_uint32 key_index, t_cust_chl_asym_key * key); |
| 64 | #endif /* CUSTOM_SEC_KEY_H */ |