26
|
1 |
/*
|
|
2 |
* Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: EAP and WLAN authentication protocols.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
/*
|
|
19 |
* %version: %
|
|
20 |
*/
|
|
21 |
|
|
22 |
/**
|
|
23 |
* @mainpage EAP Core documentation.
|
|
24 |
*
|
|
25 |
* @section intro Introduction
|
|
26 |
* This is a EAP Core documentation generated by doxygen.
|
|
27 |
* First read <a href="../S60_3_1_EAP_Core.doc">S60_3_1_EAP_Core.doc</a>
|
|
28 |
* file from <a href="..">EAPOL/documentation</a> directory.
|
|
29 |
* Release notes are in file <a href="../../../../../wlan_linux/wlaneapol_linux/release_notes.txt">release_notes.txt</a>
|
|
30 |
*
|
|
31 |
* @section install Installation
|
|
32 |
* Installation instructions are in file <a href="../../../../../wlan_linux/wlaneapol_linux/readme.txt">EAPOL/readme.txt</a>.
|
|
33 |
*
|
|
34 |
* @section classes Most crucial classes
|
|
35 |
* The most crucial classes are dummy_eap_core_c, abs_eap_core_c,
|
|
36 |
* eap_base_type_c and abs_eap_base_type_c.
|
|
37 |
*
|
|
38 |
* Header files are stored to a directory <a href="../../../include">EAPOL/include</a>.
|
|
39 |
* Implementation of dummy_eap_core_c class is in a file <a href="../../../core/eap_core.cpp">
|
|
40 |
* EAPOL/core/eap_core.cpp</a>. Implementation of eap_base_type_c class is in a file
|
|
41 |
* <a href="../../../common/eap_base_type.cpp">EAPOL/common/eap_base_type.cpp</a>.
|
|
42 |
*
|
|
43 |
* @section eap_types Implemented EAP-types
|
|
44 |
*
|
|
45 |
* @subsection GSMSIM EAP/SIM
|
|
46 |
* EAP/SIM implementation is in a directory
|
|
47 |
* <a href="../../../type/gsmsim">EAPOL/type/gsmsim</a>.
|
|
48 |
* EAP/SIM is specified in draft-haverinen-pppext-eap-sim-xx.txt.
|
|
49 |
* The most current is
|
|
50 |
* <a href="../../type/gsmsim/doc/rfc4186.txt">
|
|
51 |
* RFC 4186</a>.
|
|
52 |
* IETF drafts and RFC are stored to a directory <a href="../../type/gsmsim/doc">
|
|
53 |
* EAPOL/type/gsmsim/documentation</a>.
|
|
54 |
* The document
|
|
55 |
* <a href="../../type/gsmsim/doc/GSMSIM.doc">GSMSIM.doc</a>
|
|
56 |
* includes implementation notes of GSMSIM.
|
|
57 |
*
|
|
58 |
* @subsection EAP_AKA EAP/AKA
|
|
59 |
* EAP/AKA implementation is in a directory
|
|
60 |
* <a href="../../../type/aka">EAPOL/type/aka</a>.
|
|
61 |
* EAP/AKA is specified in draft-arkko-pppext-eap-aka-xx.txt.
|
|
62 |
* The most current is
|
|
63 |
* <a href="../../type/aka/doc/rfc4187.txt">
|
|
64 |
* RFC 4187</a>.
|
|
65 |
* IETF drafts are stored to a directory <a href="../../type/aka/doc">
|
|
66 |
* EAPOL/type/aka/documentation</a>.
|
|
67 |
*
|
|
68 |
* @subsection EAP_TLS_PEAP EAP/TLS, PEAP and TTLS
|
|
69 |
* Implementation design and architecture of EAP/TLS, PEAP and TTLS is in
|
|
70 |
* <a href="../../type/tls_peap/doc/EAP_TLS_PEAP.doc">EAP_TLS_PEAP.doc</a>
|
|
71 |
* file in <a href="../../type/tls_peap/doc">EAPOL/type/tls_peap/documentation</a> directory.
|
|
72 |
* EAP/TLS and PEAP implementation will be in a directory
|
|
73 |
* <a href="../../../type/tls_peap">EAPOL/type/tls_peap</a>.
|
|
74 |
* TLS is specified in <a href="../../type/tls_peap/doc/rfc2246.txt">rfc2246.txt</a>.
|
|
75 |
* EAP/TLS is specified in <a href="../../type/tls_peap/doc/rfc2716.txt">rfc2716.txt</a>.
|
|
76 |
* PEAPv2 is specified in <a href="../../type/tls_peap/doc/draft-josefsson-pppext-eap-tls-eap-08.txt">draft-josefsson-pppext-eap-tls-eap-08.txt</a>.
|
|
77 |
* PEAPv1 is specified in <a href="../../type/tls_peap/doc/draft-josefsson-pppext-eap-tls-eap-05.txt">draft-josefsson-pppext-eap-tls-eap-05.txt</a>.
|
|
78 |
* Windows XP- PEAPv0 is specified in <a href="../../type/tls_peap/doc/draft-kamath-pppext-peapv0-00.txt">draft-kamath-pppext-peapv0-00.txt</a>.
|
|
79 |
* TTLS is specified in <a href="../../type/tls_peap/doc/draft-ietf-pppext-eap-ttls-04.txt">draft-ietf-pppext-eap-ttls-04.txt</a>.
|
|
80 |
*
|
|
81 |
* @subsection EAP_MsChapv2 EAP/MsChapv2
|
|
82 |
* EAP/MsChapv2 implementation is in a directory
|
|
83 |
* <a href="../../../type/mschapv2">EAPOL/type/mschapv2</a>.
|
|
84 |
* EAP/MsChapv2 is specified in draft-kamath-pppext-eap-mschapv2-XX.txt, rfc2433.txt and rfc2759.txt.
|
|
85 |
* The most current is
|
|
86 |
* <a href="../../type/mschapv2/doc/draft-kamath-pppext-eap-mschapv2-01.txt">
|
|
87 |
* EAP/MsChapv2 draft version 2</a>.
|
|
88 |
* See also <a href="../../type/mschapv2/doc/rfc2433.txt">rfc2433.txt</a>
|
|
89 |
* and <a href="../../type/mschapv2/doc/rfc2759.txt">rfc2759.txt</a>.
|
|
90 |
* IETF drafts are stored to a directory <a href="../../type/mschapv2/doc">
|
|
91 |
* EAPOL/type/mschapv2/doc</a>.
|
|
92 |
*
|
|
93 |
* @subsection EAP_SecurID_GTC EAP/SecurID and GTC
|
|
94 |
* EAP/SecurID implementation is in a directory
|
|
95 |
* <a href="../../../type/securid">EAPOL/type/securid</a>.
|
|
96 |
* EAP/SecurID is specified in draft-josefsson-eap-securid-XX.txt.
|
|
97 |
* The most current is
|
|
98 |
* <a href="../../type/securid/doc/draft-josefsson-eap-securid-01.txt">
|
|
99 |
* EAP/SecurID draft version 1</a>.
|
|
100 |
* IETF drafts are stored to a directory <a href="../../type/securid/doc">
|
|
101 |
* EAPOL/type/securid/documentation</a>.
|
|
102 |
*
|
|
103 |
* @subsection EAP_LEAP EAP/LEAP
|
|
104 |
* EAP/LEAP implementation is in a directory
|
|
105 |
* <a href="../../../type/leap">EAPOL/type/leap</a>.
|
|
106 |
* EAP/LEAP documentation is not included here.
|
|
107 |
*
|
|
108 |
* @subsection SAE Experimental Security Association for EAPOL (not used)
|
|
109 |
* SAE implementation is in a directory <a href="../../../../../wlan_testing/wlaneapol_testing/SAE">EAPOL/SAE</a>.
|
|
110 |
* Document defining SAE is <a href="../../../../../wlan_testing/wlaneapol_testing/SAE/documentation/EAPOL_SA.doc">EAPOL_SA.doc</a>.
|
|
111 |
* This is a very experimental test implementation.
|
|
112 |
* Idea is to use Diffie-Hellman to create keys for a anonymous EAPOL tunnel.
|
|
113 |
* Any EAP-type could then run inside the tunnel.
|
|
114 |
* This fixes the problem of current EAPOL over WLAN.
|
|
115 |
* EAP was designed for poin to point environment and EAPOL to non-shared environment.
|
|
116 |
*
|
|
117 |
* NOTE SAE is not used anywhere.
|
|
118 |
*
|
|
119 |
* @section Symbian Symbian Plug-in
|
|
120 |
* EAP Type Plug-in Architecture for Symbian is specified in
|
|
121 |
* <a href="../../am/type/symbian/plugin/doc/eap_plugin_architecture.doc">
|
|
122 |
* eap_plugin_architecture.doc</a>.
|
|
123 |
*
|
|
124 |
*/
|
|
125 |
|
|
126 |
|
|
127 |
#if !defined(_DUMMY_EAP_CORE_H_)
|
|
128 |
#define _DUMMY_EAP_CORE_H_
|
|
129 |
|
|
130 |
#include "eap_am_export.h"
|
49
|
131 |
// Start: added by script change_export_macros.sh.
|
|
132 |
#if defined(EAP_NO_EXPORT_DUMMY_EAP_CORE_H)
|
|
133 |
#define EAP_CLASS_VISIBILITY_DUMMY_EAP_CORE_H EAP_NONSHARABLE
|
|
134 |
#define EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H
|
|
135 |
#define EAP_C_FUNC_VISIBILITY_DUMMY_EAP_CORE_H
|
|
136 |
#define EAP_FUNC_EXPORT_DUMMY_EAP_CORE_H
|
|
137 |
#define EAP_C_FUNC_EXPORT_DUMMY_EAP_CORE_H
|
|
138 |
#elif defined(EAP_EXPORT_DUMMY_EAP_CORE_H)
|
|
139 |
#define EAP_CLASS_VISIBILITY_DUMMY_EAP_CORE_H EAP_EXPORT
|
|
140 |
#define EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H EAP_FUNC_EXPORT
|
|
141 |
#define EAP_C_FUNC_VISIBILITY_DUMMY_EAP_CORE_H EAP_C_FUNC_EXPORT
|
|
142 |
#define EAP_FUNC_EXPORT_DUMMY_EAP_CORE_H EAP_FUNC_EXPORT
|
|
143 |
#define EAP_C_FUNC_EXPORT_DUMMY_EAP_CORE_H EAP_C_FUNC_EXPORT
|
|
144 |
#else
|
|
145 |
#define EAP_CLASS_VISIBILITY_DUMMY_EAP_CORE_H EAP_IMPORT
|
|
146 |
#define EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H EAP_FUNC_IMPORT
|
|
147 |
#define EAP_C_FUNC_VISIBILITY_DUMMY_EAP_CORE_H EAP_C_FUNC_IMPORT
|
|
148 |
#define EAP_FUNC_EXPORT_DUMMY_EAP_CORE_H
|
|
149 |
#define EAP_C_FUNC_EXPORT_DUMMY_EAP_CORE_H
|
|
150 |
#endif
|
|
151 |
// End: added by script change_export_macros.sh.
|
26
|
152 |
#include "abs_eap_base_type.h"
|
|
153 |
#include "eap_core_map.h"
|
|
154 |
#include "eap_am_network_id.h"
|
|
155 |
#include "abs_eap_stack_interface.h"
|
|
156 |
#include "eap_configuration_field.h"
|
|
157 |
#include "abs_eap_core_map.h"
|
|
158 |
#include "eap_core.h"
|
|
159 |
|
|
160 |
class abs_eap_core_c;
|
|
161 |
class abs_eap_am_tools_c;
|
|
162 |
class eap_core_retransmission_c;
|
|
163 |
class eap_base_type_c;
|
|
164 |
class eap_variable_data_c;
|
|
165 |
|
|
166 |
//--------------------------------------------------------------------------------------------------
|
|
167 |
|
|
168 |
/**
|
|
169 |
* @defgroup EAP_Core_config_options Configuration options of EAP Core.
|
|
170 |
* The following configuration options are read through abs_eap_base_type_c::read_configure() function.
|
|
171 |
* @{
|
|
172 |
*/
|
|
173 |
|
|
174 |
|
|
175 |
|
|
176 |
//--------------------------------------------------------------------------------------------------
|
|
177 |
|
|
178 |
|
|
179 |
|
|
180 |
/// A eap_core_c class implements the basic functionality of EAP-type.
|
49
|
181 |
class EAP_CLASS_VISIBILITY_DUMMY_EAP_CORE_H dummy_eap_core_c
|
26
|
182 |
: public abs_eap_core_map_c
|
|
183 |
, public abs_eap_base_type_c
|
|
184 |
, public abs_eap_base_timer_c
|
|
185 |
, public abs_eap_stack_interface_c
|
|
186 |
{
|
|
187 |
private:
|
|
188 |
//--------------------------------------------------
|
|
189 |
|
|
190 |
/// This is back pointer to object which created this object.
|
|
191 |
/// Packets are sent to the partner.
|
|
192 |
abs_eap_core_c *m_partner;
|
|
193 |
|
|
194 |
/// This is pointer to the tools class.
|
|
195 |
abs_eap_am_tools_c * const m_am_tools;
|
|
196 |
|
|
197 |
/// This stores eap_base_type objects using eap_variable_data selector.
|
|
198 |
eap_core_map_c<eap_base_type_c, abs_eap_core_map_c, eap_variable_data_c> m_type_map;
|
|
199 |
|
|
200 |
/// This stores the current EAP-type. When requested, we send our ID using
|
|
201 |
/// our default EAP-type. This is our best quess of other peer's EAP-type.
|
|
202 |
/// Other peer will sent the real EAP-type later and we can NAK it then
|
|
203 |
/// and send our own EAP-type. This is due the limitations of EAP-protocol.
|
|
204 |
eap_type_value_e m_current_eap_type;
|
|
205 |
|
|
206 |
/// This is our default EAP-type.
|
|
207 |
eap_type_value_e m_default_eap_type;
|
|
208 |
|
|
209 |
/// This is the queried EAP-identity.
|
|
210 |
/// This is saved because other EAP-types may be load afterwards
|
|
211 |
/// and they may query EAP-identity.
|
|
212 |
eap_variable_data_c m_eap_identity;
|
|
213 |
|
|
214 |
/// This is offset in bytes of the EAP-type header.
|
|
215 |
u32_t m_eap_header_offset;
|
|
216 |
|
|
217 |
/// This is maximum transfer unit in bytes.
|
|
218 |
u32_t m_MTU;
|
|
219 |
|
|
220 |
/// This is length of the trailer in bytes.
|
|
221 |
u32_t m_trailer_length;
|
|
222 |
|
|
223 |
/// This is network identity of the received packet.
|
|
224 |
eap_am_network_id_c m_receive_network_id;
|
|
225 |
|
|
226 |
/// Re-transmission is used to test protocols.
|
|
227 |
/// This stores the information to resent a message. This is used for testing purposes.
|
|
228 |
eap_core_retransmission_c *m_retransmission;
|
|
229 |
|
|
230 |
/// Re-transmission is used to test protocols.
|
|
231 |
/// This is the time after resent a message. This is used for testing purposes.
|
|
232 |
u32_t m_retransmission_time;
|
|
233 |
|
|
234 |
/// Re-transmission is used to test protocols.
|
|
235 |
/// This is the maximum count of retransmission of one message. This is used for testing purposes.
|
|
236 |
u32_t m_retransmission_counter;
|
|
237 |
|
|
238 |
/// This is the maximum time authentication could succeed.
|
|
239 |
/// Authentication is terminated after this time elapses.
|
|
240 |
/// The EAP-type could change the timeout by calling set_session_timeout() function.
|
|
241 |
u32_t m_session_timeout;
|
|
242 |
|
|
243 |
u32_t m_eap_core_failure_received_timeout;
|
|
244 |
|
|
245 |
u32_t m_remove_session_timeout;
|
|
246 |
|
|
247 |
#if defined(USE_EAP_CORE_WAIT_REQUEST_TYPE_TIMER)
|
|
248 |
u32_t m_wait_eap_request_type_timeout;
|
|
249 |
bool m_wait_eap_request_type_timeout_set;
|
|
250 |
#endif //#if defined(USE_EAP_CORE_WAIT_REQUEST_TYPE_TIMER)
|
|
251 |
|
|
252 |
/// Latest received EAP-identifier. Used only for EAP-Request/Identity handling in client.
|
|
253 |
/// Ensures that the EAP-Response/Identity is sent with the latest EAP-identifier.
|
|
254 |
u8_t m_eap_identity_request_identifier_client;
|
|
255 |
|
|
256 |
/// This indicates whether this object is client (true) or server (false).
|
|
257 |
/// In terms of EAP-protocol whether this network entity is EAP-supplicant (true) or EAP-authenticator (false).
|
|
258 |
bool m_is_client;
|
|
259 |
|
|
260 |
/// This indicates whether the authentication role of this object is client (true) or server (false).
|
|
261 |
/// In terms of EAP-protocol whether this network entitys authentication role is EAP-supplicant (true) or EAP-authenticator (false).
|
|
262 |
/// NOTE the LEAP type changes authentication role during the authentication session.
|
|
263 |
bool m_is_client_role;
|
|
264 |
|
|
265 |
/// This indicates whether this object was generated successfully.
|
|
266 |
bool m_is_valid;
|
|
267 |
|
|
268 |
/// Client has initiated restart.
|
|
269 |
bool m_client_restart_authentication_initiated;
|
|
270 |
|
|
271 |
/// This flag indicates that this object is marked to removed asynchronously.
|
|
272 |
/// The very same object could be taken use before the removing timer elapses.
|
|
273 |
bool m_marked_removed;
|
|
274 |
|
|
275 |
/// This flag prevents server receiving of multiple EAP-Response/Identity message.
|
|
276 |
/// This is set true after the server accepts EAP-Response/Identity message.
|
|
277 |
bool m_eap_identity_response_accepted;
|
|
278 |
|
|
279 |
/// Function shutdown() is called already.
|
|
280 |
bool m_shutdown_was_called;
|
|
281 |
|
|
282 |
/// Server received EAP-Response from client. Server must not sent any other EAP-type. Server could send EAP-Failure or EAP-Success.
|
|
283 |
/// Client sent a response. Client must not accept any other EAP-type.
|
|
284 |
bool m_eap_type_response_sent;
|
|
285 |
|
|
286 |
/// Tells whether this is tunneled EAP-session. For example inside PEAP or TTLS tunnel.
|
|
287 |
/// This causes some changes to timeouts.
|
|
288 |
bool m_is_tunneled_eap;
|
|
289 |
|
|
290 |
#if defined(USE_EAP_CORE_SERVER)
|
|
291 |
/// If this flag is true EAP-Response/Nak is processed immediately.
|
|
292 |
/// If this flag is false EAP-Response/Nak is processed after a timeout.
|
|
293 |
/// There might be received more suitable EAP-Response.
|
|
294 |
bool m_process_eap_nak_immediately;
|
|
295 |
|
|
296 |
/// EAP-Response/Nak is initiated.
|
|
297 |
bool m_nak_process_timer_active;
|
|
298 |
|
|
299 |
/// This flag prevents server sending of multiple EAP-Request/Identity message.
|
|
300 |
bool m_eap_identity_request_send;
|
|
301 |
|
|
302 |
/// This is set true after the server receives EAP-Response/Identity message.
|
|
303 |
bool m_eap_identity_response_received;
|
|
304 |
|
|
305 |
/// This flag is set true after a EAP-Failure is sent.
|
|
306 |
bool m_eap_failure_sent;
|
|
307 |
|
|
308 |
/// This flag selects whether EAP-Success is send after state notification is forwarded to lower layer (true)
|
|
309 |
/// or EAP-Success is send before state notification is forwarded to lower layer (false).
|
|
310 |
bool m_send_eap_success_after_notification;
|
|
311 |
|
|
312 |
#if defined(USE_EAP_CORE_WAIT_REQUEST_TYPE_TIMER)
|
|
313 |
// This flag selects whether EAP-Request/Identity is send (true) or not (false).
|
|
314 |
bool m_skip_eap_request_identity;
|
|
315 |
#endif //#if defined(USE_EAP_CORE_WAIT_REQUEST_TYPE_TIMER)
|
|
316 |
#endif //#if defined(USE_EAP_CORE_SERVER)
|
|
317 |
|
|
318 |
bool m_use_eap_expanded_type;
|
|
319 |
|
|
320 |
/// Some of the protocols terminates with EAP-Failure. This flag tells to ignore EAP-Failure.
|
|
321 |
bool m_ignore_eap_failure;
|
|
322 |
|
|
323 |
bool m_ignore_notifications;
|
|
324 |
|
|
325 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
326 |
|
|
327 |
/**
|
|
328 |
* Re-transmission is used to test protocols.
|
|
329 |
* This function resends the packet.
|
|
330 |
*/
|
49
|
331 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e resend_packet(
|
26
|
332 |
const eap_am_network_id_c * const send_network_id,
|
|
333 |
eap_buf_chain_wr_c * const sent_packet,
|
|
334 |
const u32_t header_offset,
|
|
335 |
const u32_t data_length,
|
|
336 |
const u32_t buffer_free,
|
|
337 |
const u32_t retransmission_counter
|
|
338 |
);
|
|
339 |
|
|
340 |
/**
|
|
341 |
* Re-transmission is used to test protocols.
|
|
342 |
* This function cancels retransmissions.
|
|
343 |
*/
|
49
|
344 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e cancel_retransmission();
|
26
|
345 |
|
|
346 |
/**
|
|
347 |
* Re-transmission is used to test protocols.
|
|
348 |
* This function inits retransmission of sent packet.
|
|
349 |
*/
|
49
|
350 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e init_retransmission(
|
26
|
351 |
const eap_am_network_id_c * const send_network_id,
|
|
352 |
eap_buf_chain_wr_c * const sent_packet,
|
|
353 |
const u32_t header_offset,
|
|
354 |
const u32_t data_length,
|
|
355 |
const eap_code_value_e eap_code,
|
|
356 |
const u8_t eap_identifier,
|
|
357 |
const eap_type_value_e eap_type
|
|
358 |
);
|
|
359 |
|
|
360 |
/**
|
|
361 |
* This function cancels previous session timeout and initializes new timeout for the session.
|
|
362 |
*/
|
49
|
363 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e initialize_session_timeout(
|
26
|
364 |
const u32_t session_timeout_ms);
|
|
365 |
|
|
366 |
/**
|
|
367 |
* This function cancels timeout for a session.
|
|
368 |
*/
|
49
|
369 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e cancel_session_timeout();
|
26
|
370 |
|
|
371 |
/**
|
|
372 |
* This function calls shutdown() for one eap_base_type_c object.
|
|
373 |
*/
|
49
|
374 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H static eap_status_e shutdown_operation(
|
26
|
375 |
eap_base_type_c * const value,
|
|
376 |
abs_eap_am_tools_c * const m_am_tools);
|
|
377 |
|
|
378 |
/**
|
|
379 |
* This function calls reset() for one eap_base_type_c object.
|
|
380 |
*/
|
49
|
381 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H static eap_status_e reset_operation(
|
26
|
382 |
eap_base_type_c * const handler,
|
|
383 |
abs_eap_am_tools_c * const m_am_tools);
|
|
384 |
|
49
|
385 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e client_proposes_eap_types(
|
26
|
386 |
const eap_am_network_id_c * const receive_network_id,
|
|
387 |
const u8_t eap_identifier);
|
|
388 |
|
|
389 |
/**
|
|
390 |
* This function processes EAP-packet with known EAP-type.
|
|
391 |
*/
|
49
|
392 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e packet_process_type(
|
26
|
393 |
const eap_type_value_e used_eap_type,
|
|
394 |
const eap_am_network_id_c * const receive_network_id,
|
|
395 |
eap_general_header_base_c * const packet_data,
|
|
396 |
const u32_t packet_length);
|
|
397 |
|
|
398 |
#if defined(USE_EAP_CORE_SERVER)
|
|
399 |
/**
|
|
400 |
* This function re-starts authentication with new EAP-type.
|
|
401 |
* Only server calls this function.
|
|
402 |
*/
|
49
|
403 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e restart_with_new_type(
|
26
|
404 |
const eap_type_value_e used_eap_type,
|
|
405 |
const eap_am_network_id_c * const receive_network_id,
|
|
406 |
const u8_t eap_identifier);
|
|
407 |
#endif //#if defined(USE_EAP_CORE_SERVER)
|
|
408 |
|
|
409 |
#if defined(USE_EAP_CORE_SERVER)
|
49
|
410 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e handle_eap_identity_response(
|
26
|
411 |
eap_base_type_c * const handler,
|
|
412 |
const eap_type_value_e used_eap_type,
|
|
413 |
const eap_am_network_id_c * const receive_network_id,
|
|
414 |
eap_header_wr_c * const eap,
|
|
415 |
const u32_t packet_length);
|
|
416 |
#endif //#if defined(USE_EAP_CORE_SERVER)
|
|
417 |
|
|
418 |
/**
|
|
419 |
* This function handles EAP-Request/Identity.
|
|
420 |
*/
|
49
|
421 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e handle_eap_identity_request(
|
26
|
422 |
const eap_type_value_e used_eap_type,
|
|
423 |
const u8_t eap_identifier,
|
|
424 |
const eap_am_network_id_c * const receive_network_id);
|
|
425 |
|
|
426 |
/**
|
|
427 |
* This function creates EAP-Response/Identity.
|
|
428 |
*/
|
49
|
429 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e create_eap_identity_response(
|
26
|
430 |
eap_buf_chain_wr_c * const response_packet,
|
|
431 |
const eap_variable_data_c * const identity,
|
|
432 |
const u8_t eap_identifier
|
|
433 |
);
|
|
434 |
|
|
435 |
/**
|
|
436 |
* This function sends EAP-Response/Identity.
|
|
437 |
*/
|
49
|
438 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e send_eap_identity_response(
|
26
|
439 |
const eap_am_network_id_c * const send_network_id,
|
|
440 |
const eap_variable_data_c * const identity,
|
|
441 |
const u8_t eap_identifier);
|
|
442 |
|
|
443 |
/**
|
|
444 |
* This function sends EAP-Response/Notification.
|
|
445 |
*/
|
49
|
446 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e send_eap_notification_response(
|
26
|
447 |
const eap_am_network_id_c * const send_network_id,
|
|
448 |
const u8_t eap_identifier);
|
|
449 |
|
|
450 |
/**
|
|
451 |
* This function initializes timeout for received EAP-Failure.
|
|
452 |
*/
|
49
|
453 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e set_eap_failure_timeout();
|
26
|
454 |
|
|
455 |
/**
|
|
456 |
* This function cancels timeout for received EAP-Failure.
|
|
457 |
*/
|
49
|
458 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e cancel_eap_failure_timeout();
|
26
|
459 |
|
|
460 |
#if defined(USE_EAP_CORE_WAIT_REQUEST_TYPE_TIMER)
|
|
461 |
eap_status_e set_wait_eap_request_type_timeout();
|
|
462 |
|
|
463 |
eap_status_e cancel_wait_eap_request_type_timeout();
|
|
464 |
#endif //#if defined(USE_EAP_CORE_WAIT_REQUEST_TYPE_TIMER)
|
|
465 |
|
49
|
466 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e asynchronous_init_remove_eap_session();
|
26
|
467 |
|
49
|
468 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e initialize_asynchronous_init_remove_eap_session(
|
26
|
469 |
const u32_t remove_session_timeout);
|
|
470 |
|
49
|
471 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e cancel_asynchronous_init_remove_eap_session();
|
26
|
472 |
|
|
473 |
eap_status_e init_end_of_session(
|
|
474 |
const abs_eap_state_notification_c * const state);
|
|
475 |
|
|
476 |
eap_status_e set_eap_identity_routing_info_and_nai_decoration(
|
|
477 |
eap_variable_data_c * const identity);
|
|
478 |
|
|
479 |
//--------------------------------------------------
|
|
480 |
protected:
|
|
481 |
//--------------------------------------------------
|
|
482 |
|
|
483 |
//--------------------------------------------------
|
|
484 |
public:
|
|
485 |
//--------------------------------------------------
|
|
486 |
|
|
487 |
/**
|
|
488 |
* The destructor of the eap_core class does nothing special.
|
|
489 |
*/
|
49
|
490 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H virtual ~dummy_eap_core_c();
|
26
|
491 |
|
|
492 |
/**
|
|
493 |
* The constructor initializes member attributes using parameters passed to it.
|
|
494 |
* @param tools is pointer to the tools class. @see abs_eap_am_tools_c.
|
|
495 |
* @param partner is back pointer to object which created this object.
|
|
496 |
* @param is_client_when_true indicates whether the network entity should act
|
|
497 |
* @param is_tunneled_eap tells the EAP is run in tunnel (PEAP or other).
|
|
498 |
* as a client (true) or server (false), in terms of EAP-protocol
|
|
499 |
* whether this network entity is EAP-supplicant (true) or EAP-authenticator (false).
|
|
500 |
*/
|
49
|
501 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H dummy_eap_core_c(
|
26
|
502 |
abs_eap_am_tools_c * const tools,
|
|
503 |
abs_eap_core_c * const partner,
|
|
504 |
const bool is_client_when_true,
|
|
505 |
const eap_am_network_id_c * const receive_network_id,
|
|
506 |
const bool is_tunneled_eap);
|
|
507 |
|
|
508 |
/**
|
|
509 |
* The load_type() function function indicates the lower level to load
|
|
510 |
* new module including EAP-type. The type parameter is the requested EAP-type.
|
|
511 |
* @param type is the identifier of the required EAP type.
|
|
512 |
* @return Function returns pointer to the EAP type object.
|
|
513 |
*/
|
49
|
514 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_base_type_c * load_type(
|
26
|
515 |
const eap_type_value_e type,
|
|
516 |
const eap_type_value_e tunneling_type,
|
|
517 |
const eap_am_network_id_c * const receive_network_id);
|
|
518 |
|
49
|
519 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H void trace_eap_packet(
|
26
|
520 |
eap_const_string prefix,
|
|
521 |
const eap_header_wr_c * const eap_header);
|
|
522 |
|
|
523 |
// This is documented in abs_eap_stack_interface_c::packet_process().
|
49
|
524 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e packet_process(
|
26
|
525 |
const eap_am_network_id_c * const receive_network_id,
|
|
526 |
eap_general_header_base_c * const packet_data,
|
|
527 |
const u32_t packet_length);
|
|
528 |
|
|
529 |
// This is documented in abs_eap_base_type_c::packet_send().
|
49
|
530 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e packet_send(
|
26
|
531 |
const eap_am_network_id_c * const send_network_id,
|
|
532 |
eap_buf_chain_wr_c * const sent_packet,
|
|
533 |
const u32_t header_offset,
|
|
534 |
const u32_t data_length,
|
|
535 |
const u32_t buffer_length);
|
|
536 |
|
|
537 |
/**
|
|
538 |
* The get_partner() function returns pointer to partner class.
|
|
539 |
*/
|
49
|
540 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H abs_eap_core_c * get_partner();
|
26
|
541 |
|
|
542 |
/**
|
|
543 |
* The set_partner() function sets pointer to partner class.
|
|
544 |
*/
|
49
|
545 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H void set_partner(abs_eap_core_c * const partner);
|
26
|
546 |
|
|
547 |
// This is documented in abs_eap_base_type_c::get_header_offset().
|
49
|
548 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H u32_t get_header_offset(
|
26
|
549 |
u32_t * const MTU,
|
|
550 |
u32_t * const trailer_length);
|
|
551 |
|
|
552 |
// This is documented in abs_eap_base_type_c::load_module().
|
49
|
553 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e load_module(
|
26
|
554 |
const eap_type_value_e type,
|
|
555 |
const eap_type_value_e /* tunneling_type */,
|
|
556 |
abs_eap_base_type_c * const partner,
|
|
557 |
eap_base_type_c ** const eap_type,
|
|
558 |
const bool is_client_when_true,
|
|
559 |
const eap_am_network_id_c * const receive_network_id);
|
|
560 |
|
|
561 |
// This is documented in abs_eap_base_type_c::unload_module().
|
49
|
562 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e unload_module(
|
26
|
563 |
const eap_type_value_e type);
|
|
564 |
|
|
565 |
/**
|
|
566 |
* The adaptation module calls the eap_acknowledge() function after
|
|
567 |
* any Network Protocol packet is received. This is used as a success indication.
|
|
568 |
* This is described in RFC 2284 "PPP Extensible Authentication Protocol (EAP)".
|
|
569 |
* Mostly there is only one session in the client.
|
|
570 |
* The server does not need eap_acknowledge() function because
|
|
571 |
* server (EAP-authenticator) sends the EAP-success message.
|
|
572 |
*/
|
49
|
573 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e eap_acknowledge(
|
26
|
574 |
const eap_am_network_id_c * const receive_network_id);
|
|
575 |
|
|
576 |
// This is documented in abs_eap_base_type_c::restart_authentication().
|
49
|
577 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e restart_authentication(
|
26
|
578 |
const eap_am_network_id_c * const send_network_id,
|
|
579 |
const bool is_client_when_true);
|
|
580 |
|
|
581 |
/**
|
|
582 |
* The EAP Core calls the send_eap_nak_response() function
|
|
583 |
* when EAP-authentication with requested EAP type is not possible.
|
|
584 |
* @param receive_network_id includes the addresses (network identity) and packet type.
|
|
585 |
* @param eap_identifier is the EAP-Identifier to be used with EAP-Nak message.
|
|
586 |
* @param preferred_eap_type is the acceptable EAP-Type to be informed with an other peer.
|
|
587 |
*/
|
49
|
588 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e send_eap_nak_response(
|
26
|
589 |
const eap_am_network_id_c * const receive_network_id,
|
|
590 |
const u8_t eap_identifier,
|
|
591 |
const eap_array_c<eap_type_value_e> * const eap_type_list);
|
|
592 |
|
|
593 |
|
|
594 |
#if defined(USE_EAP_CORE_SERVER)
|
|
595 |
|
|
596 |
/**
|
|
597 |
* The EAP Core calls the send_eap_identity_request() function
|
|
598 |
* when EAP-authentication is needed with another peer.
|
|
599 |
* @param network_id includes the addresses (network identity) and packet type.
|
|
600 |
*/
|
49
|
601 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e send_eap_identity_request(
|
26
|
602 |
const eap_am_network_id_c * const network_id);
|
|
603 |
|
|
604 |
/**
|
|
605 |
* This function sends EAP-Success.
|
|
606 |
*/
|
49
|
607 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e send_eap_success(
|
26
|
608 |
const eap_am_network_id_c * const send_network_id,
|
|
609 |
const u8_t eap_identifier);
|
|
610 |
|
|
611 |
/**
|
|
612 |
* This function sends EAP-Failure.
|
|
613 |
*/
|
49
|
614 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e send_eap_failure(
|
26
|
615 |
const eap_am_network_id_c * const send_network_id,
|
|
616 |
const u8_t eap_identifier);
|
|
617 |
|
|
618 |
#endif //#if defined(USE_EAP_CORE_SERVER)
|
|
619 |
|
|
620 |
|
|
621 |
// This is documented in abs_eap_base_type_c::packet_data_crypto_keys().
|
49
|
622 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e packet_data_crypto_keys(
|
26
|
623 |
const eap_am_network_id_c * const send_network_id,
|
|
624 |
const eap_master_session_key_c * const master_session_key
|
|
625 |
);
|
|
626 |
|
|
627 |
// This is documented in abs_eap_stack_interface_c::configure().
|
49
|
628 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e configure();
|
26
|
629 |
|
|
630 |
// This is documented in abs_eap_stack_interface_c::shutdown().
|
49
|
631 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e shutdown();
|
26
|
632 |
|
|
633 |
// This is documented in abs_eap_base_type_c::read_configure().
|
49
|
634 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H virtual eap_status_e read_configure(
|
26
|
635 |
const eap_configuration_field_c * const field,
|
|
636 |
eap_variable_data_c * const data);
|
|
637 |
|
|
638 |
// This is documented in abs_eap_base_type_c::write_configure().
|
49
|
639 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H virtual eap_status_e write_configure(
|
26
|
640 |
const eap_configuration_field_c * const field,
|
|
641 |
eap_variable_data_c * const data);
|
|
642 |
|
|
643 |
// This is documented in abs_eap_stack_interface_c::set_is_valid().
|
49
|
644 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H void set_is_valid();
|
26
|
645 |
|
|
646 |
// This is documented in abs_eap_stack_interface_c::get_is_valid().
|
49
|
647 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H bool get_is_valid();
|
26
|
648 |
|
|
649 |
// This is documented in abs_eap_base_type_c::state_notification().
|
49
|
650 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H void state_notification(
|
26
|
651 |
const abs_eap_state_notification_c * const state);
|
|
652 |
|
|
653 |
// See abs_eap_base_timer_c::timer_expired().
|
49
|
654 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e timer_expired(
|
26
|
655 |
const u32_t id, void *data);
|
|
656 |
|
|
657 |
// See abs_eap_base_timer_c::timer_delete_data().
|
49
|
658 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e timer_delete_data(
|
26
|
659 |
const u32_t id, void *data);
|
|
660 |
|
|
661 |
/**
|
|
662 |
* eap_core_map_c class increases reference count each time reference to stored object is get.
|
|
663 |
* Here is always just one state for one session so no references are used.
|
|
664 |
*/
|
49
|
665 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H void object_increase_reference_count();
|
26
|
666 |
|
|
667 |
/**
|
|
668 |
* eap_core_map_c class increases reference count each time reference to stored object is get.
|
|
669 |
* Here is always just one state for one session so no references are used.
|
|
670 |
*/
|
49
|
671 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H u32_t object_decrease_reference_count();
|
26
|
672 |
|
|
673 |
/**
|
|
674 |
* @{ Add configuration of accepted EAP-types. }
|
|
675 |
*/
|
|
676 |
// This is documented in abs_eap_base_type_c::check_is_valid_eap_type().
|
49
|
677 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type);
|
26
|
678 |
|
|
679 |
// This is commented in abs_eap_base_type_c::get_eap_type_list().
|
49
|
680 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e get_eap_type_list(
|
26
|
681 |
eap_array_c<eap_type_value_e> * const eap_type_list);
|
|
682 |
|
|
683 |
/**
|
|
684 |
* Gets flag whether this session is marked removed.
|
|
685 |
* Session is removed later if it is not reused.
|
|
686 |
*/
|
49
|
687 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H bool get_marked_removed();
|
26
|
688 |
|
|
689 |
/**
|
|
690 |
* Marks this session removed.
|
|
691 |
* Session is removed later if it is not reused.
|
|
692 |
*/
|
49
|
693 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H void set_marked_removed();
|
26
|
694 |
|
|
695 |
/**
|
|
696 |
* Marks this session not removed.
|
|
697 |
* Session is not removed it is reused.
|
|
698 |
*/
|
49
|
699 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H void unset_marked_removed();
|
26
|
700 |
|
|
701 |
/**
|
|
702 |
* Prevents all notifications.
|
|
703 |
*/
|
49
|
704 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H void ignore_notifications();
|
26
|
705 |
|
|
706 |
/**
|
|
707 |
* This function must reset the state of object to same as
|
|
708 |
* state was after the configure() function call.
|
|
709 |
* If object reset succeeds this function must return eap_status_ok.
|
|
710 |
* If object reset fails this function must return corresponding error status.
|
|
711 |
* @return This function returns the status of reset operation.
|
|
712 |
*/
|
49
|
713 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e reset();
|
26
|
714 |
|
|
715 |
// This is documented in abs_eap_base_type_c::complete_eap_identity_query().
|
49
|
716 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e complete_eap_identity_query(
|
26
|
717 |
const eap_am_network_id_c * const send_network_id,
|
|
718 |
const eap_variable_data_c * const identity,
|
|
719 |
const u8_t eap_identifier);
|
|
720 |
|
|
721 |
// This is documented in abs_eap_base_type_c::get_saved_eap_identity().
|
49
|
722 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e get_saved_eap_identity(eap_variable_data_c * const identity);
|
26
|
723 |
|
|
724 |
// This is documented in abs_eap_base_type_c::set_session_timeout().
|
49
|
725 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e set_session_timeout(
|
26
|
726 |
const u32_t session_timeout_ms);
|
|
727 |
|
|
728 |
// This is documented in abs_eap_base_type_c::set_timer().
|
49
|
729 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e set_timer(
|
26
|
730 |
abs_eap_base_timer_c * const p_initializer,
|
|
731 |
const u32_t p_id,
|
|
732 |
void * const p_data,
|
|
733 |
const u32_t p_time_ms);
|
|
734 |
|
|
735 |
// This is documented in abs_eap_base_type_c::cancel_timer().
|
49
|
736 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e cancel_timer(
|
26
|
737 |
abs_eap_base_timer_c * const p_initializer,
|
|
738 |
const u32_t p_id);
|
|
739 |
|
|
740 |
// This is documented in abs_eap_base_type_c::set_authentication_role().
|
49
|
741 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e set_authentication_role(const bool when_true_set_client);
|
26
|
742 |
|
|
743 |
// This is documented in abs_eap_base_type_c::add_rogue_ap().
|
49
|
744 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H eap_status_e add_rogue_ap(eap_array_c<eap_rogue_ap_entry_c> & rogue_ap_list);
|
26
|
745 |
|
|
746 |
// This is documented in abs_eap_base_type_c::get_is_tunneled().
|
49
|
747 |
EAP_FUNC_VISIBILITY_DUMMY_EAP_CORE_H bool get_is_tunneled_eap() const;
|
26
|
748 |
|
|
749 |
//--------------------------------------------------
|
|
750 |
}; // class dummy_eap_core_c
|
|
751 |
|
|
752 |
|
|
753 |
#endif //#if !defined(_DUMMY_EAP_CORE_H_)
|
|
754 |
|
|
755 |
//--------------------------------------------------
|
|
756 |
|
|
757 |
|
|
758 |
|
|
759 |
// End.
|