|
1 /* |
|
2 * ============================================================================ |
|
3 * Name : ./accesssec/eapol/eapol_framework/wapi_common/include/ec_cs_types.h |
|
4 * Part of : WAPI / WAPI *** Info from the SWAD |
|
5 * Description : WAPI authentication |
|
6 * Version : %version: 27 % << Don't touch! Updated by Synergy at check-out. |
|
7 * |
|
8 * Copyright © 2001-2009 Nokia. All rights reserved. |
|
9 * This material, including documentation and any related computer |
|
10 * programs, is protected by copyright controlled by Nokia. All |
|
11 * rights are reserved. Copying, including reproducing, storing, |
|
12 * adapting or translating, any or all of this material requires the |
|
13 * prior written consent of Nokia. This material also contains |
|
14 * confidential information which may not be disclosed to others |
|
15 * without the prior written consent of Nokia. |
|
16 * ============================================================================ |
|
17 * Template version: 4.2 |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #if !defined(_EC_CS_TYPES_H_) |
|
23 #define _EC_CS_TYPES_H_ |
|
24 |
|
25 #if defined(USE_WAPI_CORE) |
|
26 |
|
27 #include "eap_am_export.h" |
|
28 #include "eap_tools.h" |
|
29 |
|
30 /** @file */ |
|
31 |
|
32 //---------------------------------------------------------------------------- |
|
33 |
|
34 const u8_t EC_CS_ENCRYPTION_KEY_LABEL[] = "CS Encryption Key"; |
|
35 const u32_t EC_CS_ENCRYPTION_KEY_LABEL_SIZE = sizeof(EC_CS_ENCRYPTION_KEY_LABEL)-1ul; |
|
36 |
|
37 const u8_t EC_CS_MAC_KEY_LABEL[] = "CS MAC Key"; |
|
38 const u32_t EC_CS_MAC_KEY_LABEL_SIZE = sizeof(EC_CS_MAC_KEY_LABEL)-1ul; |
|
39 |
|
40 const u8_t EC_CS_SEED_SEPARATOR[] = { 0x00 }; |
|
41 const u32_t EC_CS_SEED_SEPARATOR_SIZE = sizeof(EC_CS_SEED_SEPARATOR); |
|
42 |
|
43 const u8_t EC_CS_MASTER_KEY_SEED[] = "CS-Master-Key"; |
|
44 const u32_t EC_CS_MASTER_KEY_SEED_SIZE = sizeof(EC_CS_MASTER_KEY_SEED); |
|
45 |
|
46 const u8_t EC_CS_REFERENCE_COUNTER_SEED[] = "Reference counter"; |
|
47 const u32_t EC_CS_REFERENCE_COUNTER_SEED_SIZE = sizeof(EC_CS_REFERENCE_COUNTER_SEED); |
|
48 |
|
49 const u8_t EC_CS_CA_CERTIFICATE_DATA_DATA_SEED[] = "CA-Certificate-Data"; |
|
50 const u32_t EC_CS_CA_CERTIFICATE_DATA_DATA_SEED_SIZE = sizeof(EC_CS_CA_CERTIFICATE_DATA_DATA_SEED); |
|
51 |
|
52 const u8_t EC_CS_USER_CERTIFICATE_DATA_DATA_SEED[] = "User-Certificate-Data"; |
|
53 const u32_t EC_CS_USER_CERTIFICATE_DATA_DATA_SEED_SIZE = sizeof(EC_CS_USER_CERTIFICATE_DATA_DATA_SEED); |
|
54 |
|
55 const u8_t EC_CS_PRIVATE_KEY_DATA_SEED[] = "Private-Key-Data"; |
|
56 const u32_t EC_CS_PRIVATE_KEY_DATA_SEED_SIZE = sizeof(EC_CS_PRIVATE_KEY_DATA_SEED); |
|
57 |
|
58 const u8_t EC_CS_CA_ASU_ID_DATA_SEED[] = "CA-ASU-ID"; |
|
59 const u32_t EC_CS_CA_ASU_ID_DATA_SEED_SIZE = sizeof(EC_CS_CA_ASU_ID_DATA_SEED); |
|
60 |
|
61 const u8_t EC_CS_CLIENT_ASU_ID_DATA_SEED[] = "Client-ASU-ID"; |
|
62 const u32_t EC_CS_CLIENT_ASU_ID_DATA_SEED_SIZE = sizeof(EC_CS_CLIENT_ASU_ID_DATA_SEED); |
|
63 |
|
64 const u32_t EC_CS_MASTER_KEY_SIZE = 32ul; |
|
65 const u32_t EC_CS_ENCRYPTION_KEY_SIZE = 16ul; |
|
66 const u32_t EC_CS_MAC_KEY_SIZE = 32ul; |
|
67 |
|
68 const u8_t EC_CS_ZERO_REFERENCE[] = { 0x00, 0x00, 0x00, 0x00, }; |
|
69 |
|
70 const char WAPI_CS_MEMORY_STORE_KEY[] = "ec_certificate_store_c CS"; |
|
71 |
|
72 const u32_t EAP_FAST_PAC_STORE_DEFAULT_KEY_CACHE_TIMEOUT = 43200000u; // in milliseconds = 12 hours |
|
73 |
|
74 const u32_t EAP_FAST_PAC_STORE_MASTER_KEY_SIZE = 32ul; |
|
75 const u32_t EAP_FAST_PAC_STORE_ENCRYPTION_KEY_SIZE = 16ul; |
|
76 const u32_t EAP_FAST_PAC_STORE_MAC_KEY_SIZE = 32ul; |
|
77 |
|
78 //---------------------------------------------------------------------------- |
|
79 |
|
80 /// Enumeration describes the pending operation of Elliptic Curve Certificate Store. |
|
81 enum ec_cs_pending_operation_e |
|
82 { |
|
83 ec_cs_pending_operation_none, |
|
84 ec_cs_pending_operation_certificate_authentication, |
|
85 ec_cs_pending_operation_import_ca_certificate_file, |
|
86 ec_cs_pending_operation_import_client_certificate_file, |
|
87 ec_cs_pending_operation_select_client_certificate, |
|
88 ec_cs_pending_operation_query_certificate_list, |
|
89 ec_cs_pending_operation_verify_signature_with_public_key, |
|
90 }; |
|
91 |
|
92 /// Enumeration describes the valid types of ec_cs_data_type_e. |
|
93 enum ec_cs_data_type_e |
|
94 { |
|
95 ec_cs_data_type_none, |
|
96 ec_cs_data_type_master_key, |
|
97 ec_cs_data_type_password, |
|
98 ec_cs_data_type_device_seed, |
|
99 ec_cs_data_type_reference_counter, |
|
100 ec_cs_data_type_certificate_reference, |
|
101 ec_cs_data_type_certificate_file_password, |
|
102 ec_cs_data_type_ca_asu_id_list, // Read all ec_cs_data_type_ca_asu_id objects. |
|
103 ec_cs_data_type_ca_asu_id, |
|
104 ec_cs_data_type_client_asu_id_list, // Read all ec_cs_data_type_client_asu_id objects. |
|
105 ec_cs_data_type_client_asu_id, |
|
106 ec_cs_data_type_ca_certificate_data, |
|
107 ec_cs_data_type_client_certificate_data, |
|
108 ec_cs_data_type_private_key_data, |
|
109 ec_cs_data_type_selected_ca_id, |
|
110 ec_cs_data_type_selected_client_id, |
|
111 ec_cs_data_type_user_authorization_reference, // This is used in internal RAM memory store. |
|
112 ec_cs_data_type_user_authorization_data, // This is used in internal RAM memory store. |
|
113 }; |
|
114 |
|
115 /// Enumeration describes the change status of written ec_cs_data_c. |
|
116 /// This value tells during write_certificate_store_data() whether the status is modified, new or delete. |
|
117 enum ec_cs_data_change_status_e |
|
118 { |
|
119 ec_cs_data_change_status_none, |
|
120 ec_cs_data_change_status_modified, |
|
121 ec_cs_data_change_status_new, |
|
122 ec_cs_data_change_status_delete, |
|
123 }; |
|
124 |
|
125 /** |
|
126 * This is enumeration of Certificate Store Type-Length-Value (TLV) values. |
|
127 */ |
|
128 enum ec_cs_tlv_type_e |
|
129 { |
|
130 ec_cs_tlv_type_none, |
|
131 |
|
132 ec_cs_tlv_type_Import_File, |
|
133 ec_cs_tlv_type_Import_File_Password, |
|
134 |
|
135 ec_cs_tlv_type_CS_certificate_data, |
|
136 ec_cs_tlv_type_CS_private_key_data, |
|
137 |
|
138 ec_cs_tlv_type_CS_ASU_ID, |
|
139 ec_cs_tlv_type_CS_ID_reference, |
|
140 ec_cs_tlv_type_CS_certificate_reference, |
|
141 ec_cs_tlv_type_CS_encrypted_block, |
|
142 ec_cs_tlv_type_CS_encryption_IV, |
|
143 ec_cs_tlv_type_CS_encrypted_data, |
|
144 ec_cs_tlv_type_CS_padding, |
|
145 ec_cs_tlv_type_CS_MAC, |
|
146 ec_cs_tlv_type_CS_master_key, |
|
147 ec_cs_tlv_type_CS_reference_counter, |
|
148 |
|
149 ec_cs_tlv_type_first_known = ec_cs_tlv_type_Import_File, ///< First known TLV type. |
|
150 ec_cs_tlv_type_last_known = ec_cs_tlv_type_CS_reference_counter, ///< Last known TLV type. |
|
151 }; |
|
152 |
|
153 //---------------------------------------------------------------------------- |
|
154 |
|
155 #endif //#if defined(USE_WAPI_CORE) |
|
156 |
|
157 #endif //#if !defined(_EC_CS_TYPES_H_) |
|
158 |
|
159 |
|
160 // End. |