26 // INCLUDES |
26 // INCLUDES |
27 |
27 |
28 #include <EapType.h> |
28 #include <EapType.h> |
29 #include "eap_tools.h" |
29 #include "eap_tools.h" |
30 #include "eap_am_export.h" |
30 #include "eap_am_export.h" |
|
31 // Start: added by script change_export_macros.sh. |
|
32 #if defined(EAP_NO_EXPORT_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H) |
|
33 #define EAP_CLASS_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H EAP_NONSHARABLE |
|
34 #define EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H |
|
35 #define EAP_C_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H |
|
36 #define EAP_FUNC_EXPORT_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H |
|
37 #define EAP_C_FUNC_EXPORT_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H |
|
38 #elif defined(EAP_EXPORT_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H) |
|
39 #define EAP_CLASS_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H EAP_EXPORT |
|
40 #define EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H EAP_FUNC_EXPORT |
|
41 #define EAP_C_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H EAP_C_FUNC_EXPORT |
|
42 #define EAP_FUNC_EXPORT_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H EAP_FUNC_EXPORT |
|
43 #define EAP_C_FUNC_EXPORT_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H EAP_C_FUNC_EXPORT |
|
44 #else |
|
45 #define EAP_CLASS_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H EAP_IMPORT |
|
46 #define EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H EAP_FUNC_IMPORT |
|
47 #define EAP_C_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H EAP_C_FUNC_IMPORT |
|
48 #define EAP_FUNC_EXPORT_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H |
|
49 #define EAP_C_FUNC_EXPORT_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H |
|
50 #endif |
|
51 // End: added by script change_export_macros.sh. |
31 #include "abs_eap_base_type.h" |
52 #include "abs_eap_base_type.h" |
32 |
53 |
33 #include "abs_eap_am_type_simple_config.h" |
54 #include "abs_eap_am_type_simple_config.h" |
34 #include "eap_am_type_simple_config.h" |
55 #include "eap_am_type_simple_config.h" |
35 |
56 |
36 #include <ssl.h> |
57 #include <ssl.h> |
37 #include "simple_config_payloads.h" |
58 #include "simple_config_payloads.h" |
38 #include "eapol_key_types.h" |
59 #include "eapol_key_types.h" |
39 #include "eapol_rsna_key_header.h" |
60 #include "eapol_rsna_key_header.h" |
|
61 #include "eap_config.h" |
|
62 #include "eap_variable_data.h" |
40 |
63 |
41 #include "EapProtectedSetupInterface.h" |
64 #include "EapProtectedSetupInterface.h" |
42 #include <etelmm.h> |
65 #include <etelmm.h> |
43 |
66 |
44 // FORWARD DECLARATIONS |
67 // FORWARD DECLARATIONS |
50 * Class that implements the operating system dependent portion of |
73 * Class that implements the operating system dependent portion of |
51 * EAP Protected setup protocol for Symbian OS. |
74 * EAP Protected setup protocol for Symbian OS. |
52 */ |
75 */ |
53 |
76 |
54 |
77 |
55 class EAP_EXPORT CEapAmProtectedSetupSymbian |
78 class EAP_CLASS_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H CEapAmProtectedSetupSymbian |
56 : public CBase |
79 : public CBase |
57 , public eap_am_type_simple_config_c |
80 , public eap_am_type_simple_config_c |
58 { |
81 { |
59 public: |
82 public: |
60 |
83 |
61 //-------------------------------------------------- |
84 //-------------------------------------------------- |
62 |
85 |
63 EAP_FUNC_IMPORT static CEapAmProtectedSetupSymbian* NewL( |
86 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H static CEapAmProtectedSetupSymbian* NewL( |
64 abs_eap_am_tools_c * const tools, |
87 abs_eap_am_tools_c * const tools, |
65 abs_eap_base_type_c * const partner, |
88 abs_eap_base_type_c * const partner, |
66 const TIndexType aIndexType, |
89 const TIndexType aIndexType, |
67 const TInt aIndex, |
90 const TInt aIndex, |
68 const eap_type_value_e aTunnelingType, |
91 const eap_type_value_e aTunnelingType, |
70 const bool is_client_when_true, |
93 const bool is_client_when_true, |
71 const eap_am_network_id_c * const receive_network_id, |
94 const eap_am_network_id_c * const receive_network_id, |
72 abs_eap_configuration_if_c * const configuration_if); |
95 abs_eap_configuration_if_c * const configuration_if); |
73 |
96 |
74 // |
97 // |
75 EAP_FUNC_IMPORT virtual ~CEapAmProtectedSetupSymbian(); |
98 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H virtual ~CEapAmProtectedSetupSymbian(); |
76 |
99 |
77 EAP_FUNC_IMPORT void set_is_valid(); |
100 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H void set_is_valid(); |
78 |
101 |
79 /** From the parent eap_am_type_simple_config_c **/ |
102 /** From the parent eap_am_type_simple_config_c **/ |
80 |
103 |
81 /** Function sets partner object of adaptation module of EAP-SIMPLE_CONFIG. |
104 /** Function sets partner object of adaptation module of EAP-SIMPLE_CONFIG. |
82 * Partner object is the EAP-SIMPLE_CONFIG object. |
105 * Partner object is the EAP-SIMPLE_CONFIG object. |
83 */ |
106 */ |
84 EAP_FUNC_IMPORT void set_am_partner(abs_eap_am_type_simple_config_c * const partner); |
107 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H void set_am_partner(abs_eap_am_type_simple_config_c * const partner); |
85 |
108 |
86 EAP_FUNC_IMPORT eap_status_e configure(); |
109 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e configure(); |
87 |
110 |
88 /** |
111 /** |
89 * The shutdown() function is called before the destructor of the |
112 * The shutdown() function is called before the destructor of the |
90 * object is executed. During the function call the object |
113 * object is executed. During the function call the object |
91 * could shutdown the operations, for example cancel timers. |
114 * could shutdown the operations, for example cancel timers. |
92 * Each derived class must define this function. |
115 * Each derived class must define this function. |
93 */ |
116 */ |
94 EAP_FUNC_IMPORT eap_status_e shutdown(); |
117 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e shutdown(); |
95 |
118 |
96 EAP_FUNC_IMPORT bool get_is_valid(); |
119 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H bool get_is_valid(); |
97 |
120 |
98 /** Client calls this function. |
121 /** Client calls this function. |
99 * EAP-SIMPLE_CONFIG AM could do finishing operations to databases etc. based on authentication status and type. |
122 * EAP-SIMPLE_CONFIG AM could do finishing operations to databases etc. based on authentication status and type. |
100 */ |
123 */ |
101 EAP_FUNC_IMPORT eap_status_e reset(); |
124 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e reset(); |
102 |
125 |
103 /** Client calls this function. |
126 /** Client calls this function. |
104 * EAP-SIMPLE_CONFIG AM could make some fast operations here, heavy operations should be done in the reset() function. |
127 * EAP-SIMPLE_CONFIG AM could make some fast operations here, heavy operations should be done in the reset() function. |
105 */ |
128 */ |
106 EAP_FUNC_IMPORT eap_status_e authentication_finished( |
129 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e authentication_finished( |
107 const bool true_when_successfull, |
130 const bool true_when_successfull, |
108 const bool true_when_session_resumed); |
131 const bool true_when_session_resumed); |
109 |
132 |
110 /** Client calls this function. |
133 /** Client calls this function. |
111 * AM must copy identity to output parameters if call is syncronous. |
134 * AM must copy identity to output parameters if call is syncronous. |
112 * This function could be completed asyncronously with abs_eap_am_type_simple_config_c::complete_query_eap_identity_query() function call. |
135 * This function could be completed asyncronously with abs_eap_am_type_simple_config_c::complete_query_eap_identity_query() function call. |
113 */ |
136 */ |
114 EAP_FUNC_IMPORT eap_status_e query_eap_identity( |
137 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e query_eap_identity( |
115 const eap_am_network_id_c * const receive_network_id, |
138 const eap_am_network_id_c * const receive_network_id, |
116 const u8_t eap_identifier, |
139 const u8_t eap_identifier, |
117 bool * const use_manual_username, |
140 bool * const use_manual_username, |
118 eap_variable_data_c * const manual_username, |
141 eap_variable_data_c * const manual_username, |
119 bool *const use_manual_realm, |
142 bool *const use_manual_realm, |
121 ); |
144 ); |
122 |
145 |
123 /** |
146 /** |
124 * Cancels the outstanding indentity query. |
147 * Cancels the outstanding indentity query. |
125 */ |
148 */ |
126 EAP_FUNC_IMPORT eap_status_e cancel_identity_query(); |
149 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e cancel_identity_query(); |
127 |
150 |
128 /** |
151 /** |
129 * The type_configure_read() function reads the configuration data identified |
152 * The type_configure_read() function reads the configuration data identified |
130 * by the field string of field_length bytes length. Adaptation module must direct |
153 * by the field string of field_length bytes length. Adaptation module must direct |
131 * the query to some persistent store. |
154 * the query to some persistent store. |
132 * @param field is generic configure string idenfying the required configure data. |
155 * @param field is generic configure string idenfying the required configure data. |
133 * @param field_length is length of the field string. |
156 * @param field_length is length of the field string. |
134 * @param data is pointer to existing eap_variable_data object. |
157 * @param data is pointer to existing eap_variable_data object. |
135 */ |
158 */ |
136 EAP_FUNC_IMPORT eap_status_e type_configure_read( |
159 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e type_configure_read( |
137 const eap_configuration_field_c * const field, |
160 const eap_configuration_field_c * const field, |
138 eap_variable_data_c * const data); |
161 eap_variable_data_c * const data); |
139 |
162 |
140 /** |
163 /** |
141 * The type_configure_write() function writes the configuration data identified |
164 * The type_configure_write() function writes the configuration data identified |
143 * the action to some persistent store. |
166 * the action to some persistent store. |
144 * @param field is generic configure string idenfying the required configure data. |
167 * @param field is generic configure string idenfying the required configure data. |
145 * @param field_length is length of the field string. |
168 * @param field_length is length of the field string. |
146 * @param data is pointer to existing eap_variable_data object. |
169 * @param data is pointer to existing eap_variable_data object. |
147 */ |
170 */ |
148 EAP_FUNC_IMPORT eap_status_e type_configure_write( |
171 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e type_configure_write( |
149 const eap_configuration_field_c * const field, |
172 const eap_configuration_field_c * const field, |
150 eap_variable_data_c * const data); |
173 eap_variable_data_c * const data); |
151 |
174 |
152 /** |
175 /** |
153 * The load_module() function function indicates the lower level to |
176 * The load_module() function function indicates the lower level to |
159 * Adaptation module sets eap_type pointer to created EAP-type object. |
182 * Adaptation module sets eap_type pointer to created EAP-type object. |
160 * @param is_client_when_true parameter indicates whether the network entity should |
183 * @param is_client_when_true parameter indicates whether the network entity should |
161 * act as a client (true) or server (false), in terms of EAP-protocol whether |
184 * act as a client (true) or server (false), in terms of EAP-protocol whether |
162 * this network entity is EAP-supplicant (true) or EAP-authenticator (false). |
185 * this network entity is EAP-supplicant (true) or EAP-authenticator (false). |
163 */ |
186 */ |
164 EAP_FUNC_IMPORT eap_status_e load_module( |
187 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e load_module( |
165 const eap_type_value_e type, |
188 const eap_type_value_e type, |
166 const eap_type_value_e /* tunneling_type */, |
189 const eap_type_value_e /* tunneling_type */, |
167 abs_eap_base_type_c * const partner, |
190 abs_eap_base_type_c * const partner, |
168 eap_base_type_c ** const eap_type, |
191 eap_base_type_c ** const eap_type, |
169 const bool is_client_when_true, |
192 const bool is_client_when_true, |
172 /** |
195 /** |
173 * This is needed by PEAP type. |
196 * This is needed by PEAP type. |
174 * This function queries the validity of EAP-type. |
197 * This function queries the validity of EAP-type. |
175 * Lower layer should return eap_status_ok if this EAP-type is supported. |
198 * Lower layer should return eap_status_ok if this EAP-type is supported. |
176 */ |
199 */ |
177 EAP_FUNC_IMPORT eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type); |
200 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type); |
178 |
201 |
179 /** |
202 /** |
180 * This function queries the list of supported EAP-types. |
203 * This function queries the list of supported EAP-types. |
181 * Lower layer should return eap_status_ok if this call succeeds. |
204 * Lower layer should return eap_status_ok if this call succeeds. |
182 * @param eap_type_list will include the list of supported EAP-types. Each value in list |
205 * @param eap_type_list will include the list of supported EAP-types. Each value in list |
183 * is type of u32_t and represent one supported EAP-type. List consists of subsequent u32_t type values. |
206 * is type of u32_t and represent one supported EAP-type. List consists of subsequent u32_t type values. |
184 */ |
207 */ |
185 EAP_FUNC_IMPORT eap_status_e get_eap_type_list( |
208 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e get_eap_type_list( |
186 eap_array_c<eap_type_value_e> * const eap_type_list); |
209 eap_array_c<eap_type_value_e> * const eap_type_list); |
187 |
210 |
188 /** |
211 /** |
189 * This is needed by PEAP type. |
212 * This is needed by PEAP type. |
190 * The unload_module() function unloads the module of a EAP-type. |
213 * The unload_module() function unloads the module of a EAP-type. |
191 * @param type is the requested EAP-type. |
214 * @param type is the requested EAP-type. |
192 */ |
215 */ |
193 EAP_FUNC_IMPORT eap_status_e unload_module(const eap_type_value_e type); |
216 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e unload_module(const eap_type_value_e type); |
194 |
217 |
195 |
218 |
196 /** From simple_config_am_services_c through the parent eap_am_type_simple_config_c **/ |
219 /** From simple_config_am_services_c through the parent eap_am_type_simple_config_c **/ |
197 |
220 |
198 /// This function sets pointer to adaptation module of SIMPLE_CONFIG. See abs_simple_config_am_services_c. |
221 /// This function sets pointer to adaptation module of SIMPLE_CONFIG. See abs_simple_config_am_services_c. |
199 EAP_FUNC_IMPORT void set_simple_config_am_partner(abs_simple_config_am_services_c * const simple_config_am_partner); |
222 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H void set_simple_config_am_partner(abs_simple_config_am_services_c * const simple_config_am_partner); |
200 |
223 |
201 /** |
224 /** |
202 * This function queries all network and device parameters. |
225 * This function queries all network and device parameters. |
203 * abs_simple_config_am_services_c::complete_query_network_and_device_parameters() completes this query. |
226 * abs_simple_config_am_services_c::complete_query_network_and_device_parameters() completes this query. |
204 */ |
227 */ |
205 EAP_FUNC_IMPORT eap_status_e query_network_and_device_parameters( |
228 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e query_network_and_device_parameters( |
206 const simple_config_state_e state); |
229 const simple_config_state_e state); |
207 |
230 |
208 /** |
231 /** |
209 * This function tells AM to save SIMPLE_CONFIG configuration parameters. |
232 * This function tells AM to save SIMPLE_CONFIG configuration parameters. |
210 * This is always syncronous call. |
233 * This is always syncronous call. |
211 */ |
234 */ |
212 EAP_FUNC_IMPORT eap_status_e save_simple_config_session( |
235 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e save_simple_config_session( |
213 const simple_config_state_e state, |
236 const simple_config_state_e state, |
214 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array, |
237 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array, |
215 const eap_variable_data_c * const new_password, |
238 const eap_variable_data_c * const new_password, |
216 const simple_config_Device_Password_ID_e Device_Password_ID, |
239 const simple_config_Device_Password_ID_e Device_Password_ID, |
217 const simple_config_payloads_c * const other_configuration |
240 const simple_config_payloads_c * const other_configuration |
220 /** |
243 /** |
221 * This function forwards all payloads received in M2D messages. |
244 * This function forwards all payloads received in M2D messages. |
222 * Adaptation layer could show this information to user. |
245 * Adaptation layer could show this information to user. |
223 * This is always syncronous call. |
246 * This is always syncronous call. |
224 */ |
247 */ |
225 EAP_FUNC_IMPORT eap_status_e received_registrar_information( |
248 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e received_registrar_information( |
226 EAP_TEMPLATE_CONST eap_array_c<simple_config_payloads_c> * const M2D_payloads); |
249 EAP_TEMPLATE_CONST eap_array_c<simple_config_payloads_c> * const M2D_payloads); |
227 |
250 |
228 /** |
251 /** |
229 * This function cancels query_network_and_device_parameters() query. |
252 * This function cancels query_network_and_device_parameters() query. |
230 * After this call AM MUST NOT complete related query. |
253 * After this call AM MUST NOT complete related query. |
231 */ |
254 */ |
232 EAP_FUNC_IMPORT eap_status_e cancel_query_network_and_device_parameters(); |
255 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e cancel_query_network_and_device_parameters(); |
233 |
256 |
234 |
257 |
235 /** Own Public functions **/ |
258 /** Own Public functions **/ |
236 |
259 |
237 EAP_FUNC_IMPORT eap_status_e complete_protected_setup_device_paramsL( |
260 EAP_FUNC_VISIBILITY_EAP_AM_TYPE_PROTECTED_SETUP_SYMBIAN_H eap_status_e complete_protected_setup_device_paramsL( |
238 const RMobilePhone::TMobilePhoneIdentityV1 &phone_identity, |
261 const RMobilePhone::TMobilePhoneIdentityV1 &phone_identity, |
239 const eap_status_e completion_status); |
262 const eap_status_e completion_status); |
240 |
263 |
241 //-------------------------------------------------- |
264 //-------------------------------------------------- |
242 |
265 |
264 abs_simple_config_am_services_c * get_simple_config_am_partner(); |
287 abs_simple_config_am_services_c * get_simple_config_am_partner(); |
265 |
288 |
266 abs_eap_am_type_simple_config_c * get_am_partner(); |
289 abs_eap_am_type_simple_config_c * get_am_partner(); |
267 |
290 |
268 void send_error_notification(const eap_status_e error); |
291 void send_error_notification(const eap_status_e error); |
269 |
292 |
270 void read_device_passwordL( |
293 eap_status_e read_memory_store( |
271 eap_config_string field, |
294 const eap_type_protected_setup_stored_e data_type, |
272 const u32_t field_length, |
295 eap_variable_data_c * const data); |
273 eap_variable_data_c * const data); |
|
274 |
296 |
275 void ConvertUnicodeToAsciiL(const TDesC16& aFromUnicode, TDes8& aToAscii); |
297 void ConvertUnicodeToAsciiL(const TDesC16& aFromUnicode, TDes8& aToAscii); |
276 |
298 |
277 //-------------------------------------------------- |
299 //-------------------------------------------------- |
278 |
300 |
279 private: |
301 private: |
280 |
302 |
281 //-------------------------------------------------- |
303 //-------------------------------------------------- |