1e5b75505Sopenharmony_ci/*
2e5b75505Sopenharmony_ci * EAP peer state machine functions (RFC 4137)
3e5b75505Sopenharmony_ci * Copyright (c) 2004-2012, Jouni Malinen <j@w1.fi>
4e5b75505Sopenharmony_ci *
5e5b75505Sopenharmony_ci * This software may be distributed under the terms of the BSD license.
6e5b75505Sopenharmony_ci * See README for more details.
7e5b75505Sopenharmony_ci */
8e5b75505Sopenharmony_ci
9e5b75505Sopenharmony_ci#ifndef EAP_H
10e5b75505Sopenharmony_ci#define EAP_H
11e5b75505Sopenharmony_ci
12e5b75505Sopenharmony_ci#include "common/defs.h"
13e5b75505Sopenharmony_ci#include "eap_common/eap_defs.h"
14e5b75505Sopenharmony_ci#include "eap_peer/eap_methods.h"
15e5b75505Sopenharmony_ci
16e5b75505Sopenharmony_cistruct eap_sm;
17e5b75505Sopenharmony_cistruct wpa_config_blob;
18e5b75505Sopenharmony_cistruct wpabuf;
19e5b75505Sopenharmony_cistruct tls_cert_data;
20e5b75505Sopenharmony_ci
21e5b75505Sopenharmony_cistruct eap_method_type {
22e5b75505Sopenharmony_ci	int vendor;
23e5b75505Sopenharmony_ci	u32 method;
24e5b75505Sopenharmony_ci};
25e5b75505Sopenharmony_ci
26e5b75505Sopenharmony_ci#ifdef IEEE8021X_EAPOL
27e5b75505Sopenharmony_ci
28e5b75505Sopenharmony_ci/**
29e5b75505Sopenharmony_ci * enum eapol_bool_var - EAPOL boolean state variables for EAP state machine
30e5b75505Sopenharmony_ci *
31e5b75505Sopenharmony_ci * These variables are used in the interface between EAP peer state machine and
32e5b75505Sopenharmony_ci * lower layer. These are defined in RFC 4137, Sect. 4.1. Lower layer code is
33e5b75505Sopenharmony_ci * expected to maintain these variables and register a callback functions for
34e5b75505Sopenharmony_ci * EAP state machine to get and set the variables.
35e5b75505Sopenharmony_ci */
36e5b75505Sopenharmony_cienum eapol_bool_var {
37e5b75505Sopenharmony_ci	/**
38e5b75505Sopenharmony_ci	 * EAPOL_eapSuccess - EAP SUCCESS state reached
39e5b75505Sopenharmony_ci	 *
40e5b75505Sopenharmony_ci	 * EAP state machine reads and writes this value.
41e5b75505Sopenharmony_ci	 */
42e5b75505Sopenharmony_ci	EAPOL_eapSuccess,
43e5b75505Sopenharmony_ci
44e5b75505Sopenharmony_ci	/**
45e5b75505Sopenharmony_ci	 * EAPOL_eapRestart - Lower layer request to restart authentication
46e5b75505Sopenharmony_ci	 *
47e5b75505Sopenharmony_ci	 * Set to TRUE in lower layer, FALSE in EAP state machine.
48e5b75505Sopenharmony_ci	 */
49e5b75505Sopenharmony_ci	EAPOL_eapRestart,
50e5b75505Sopenharmony_ci
51e5b75505Sopenharmony_ci	/**
52e5b75505Sopenharmony_ci	 * EAPOL_eapFail - EAP FAILURE state reached
53e5b75505Sopenharmony_ci	 *
54e5b75505Sopenharmony_ci	 * EAP state machine writes this value.
55e5b75505Sopenharmony_ci	 */
56e5b75505Sopenharmony_ci	EAPOL_eapFail,
57e5b75505Sopenharmony_ci
58e5b75505Sopenharmony_ci	/**
59e5b75505Sopenharmony_ci	 * EAPOL_eapResp - Response to send
60e5b75505Sopenharmony_ci	 *
61e5b75505Sopenharmony_ci	 * Set to TRUE in EAP state machine, FALSE in lower layer.
62e5b75505Sopenharmony_ci	 */
63e5b75505Sopenharmony_ci	EAPOL_eapResp,
64e5b75505Sopenharmony_ci
65e5b75505Sopenharmony_ci	/**
66e5b75505Sopenharmony_ci	 * EAPOL_eapNoResp - Request has been process; no response to send
67e5b75505Sopenharmony_ci	 *
68e5b75505Sopenharmony_ci	 * Set to TRUE in EAP state machine, FALSE in lower layer.
69e5b75505Sopenharmony_ci	 */
70e5b75505Sopenharmony_ci	EAPOL_eapNoResp,
71e5b75505Sopenharmony_ci
72e5b75505Sopenharmony_ci	/**
73e5b75505Sopenharmony_ci	 * EAPOL_eapReq - EAP request available from lower layer
74e5b75505Sopenharmony_ci	 *
75e5b75505Sopenharmony_ci	 * Set to TRUE in lower layer, FALSE in EAP state machine.
76e5b75505Sopenharmony_ci	 */
77e5b75505Sopenharmony_ci	EAPOL_eapReq,
78e5b75505Sopenharmony_ci
79e5b75505Sopenharmony_ci	/**
80e5b75505Sopenharmony_ci	 * EAPOL_portEnabled - Lower layer is ready for communication
81e5b75505Sopenharmony_ci	 *
82e5b75505Sopenharmony_ci	 * EAP state machines reads this value.
83e5b75505Sopenharmony_ci	 */
84e5b75505Sopenharmony_ci	EAPOL_portEnabled,
85e5b75505Sopenharmony_ci
86e5b75505Sopenharmony_ci	/**
87e5b75505Sopenharmony_ci	 * EAPOL_altAccept - Alternate indication of success (RFC3748)
88e5b75505Sopenharmony_ci	 *
89e5b75505Sopenharmony_ci	 * EAP state machines reads this value.
90e5b75505Sopenharmony_ci	 */
91e5b75505Sopenharmony_ci	EAPOL_altAccept,
92e5b75505Sopenharmony_ci
93e5b75505Sopenharmony_ci	/**
94e5b75505Sopenharmony_ci	 * EAPOL_altReject - Alternate indication of failure (RFC3748)
95e5b75505Sopenharmony_ci	 *
96e5b75505Sopenharmony_ci	 * EAP state machines reads this value.
97e5b75505Sopenharmony_ci	 */
98e5b75505Sopenharmony_ci	EAPOL_altReject,
99e5b75505Sopenharmony_ci
100e5b75505Sopenharmony_ci	/**
101e5b75505Sopenharmony_ci	 * EAPOL_eapTriggerStart - EAP-based trigger to send EAPOL-Start
102e5b75505Sopenharmony_ci	 *
103e5b75505Sopenharmony_ci	 * EAP state machine writes this value.
104e5b75505Sopenharmony_ci	 */
105e5b75505Sopenharmony_ci	EAPOL_eapTriggerStart
106e5b75505Sopenharmony_ci};
107e5b75505Sopenharmony_ci
108e5b75505Sopenharmony_ci/**
109e5b75505Sopenharmony_ci * enum eapol_int_var - EAPOL integer state variables for EAP state machine
110e5b75505Sopenharmony_ci *
111e5b75505Sopenharmony_ci * These variables are used in the interface between EAP peer state machine and
112e5b75505Sopenharmony_ci * lower layer. These are defined in RFC 4137, Sect. 4.1. Lower layer code is
113e5b75505Sopenharmony_ci * expected to maintain these variables and register a callback functions for
114e5b75505Sopenharmony_ci * EAP state machine to get and set the variables.
115e5b75505Sopenharmony_ci */
116e5b75505Sopenharmony_cienum eapol_int_var {
117e5b75505Sopenharmony_ci	/**
118e5b75505Sopenharmony_ci	 * EAPOL_idleWhile - Outside time for EAP peer timeout
119e5b75505Sopenharmony_ci	 *
120e5b75505Sopenharmony_ci	 * This integer variable is used to provide an outside timer that the
121e5b75505Sopenharmony_ci	 * external (to EAP state machine) code must decrement by one every
122e5b75505Sopenharmony_ci	 * second until the value reaches zero. This is used in the same way as
123e5b75505Sopenharmony_ci	 * EAPOL state machine timers. EAP state machine reads and writes this
124e5b75505Sopenharmony_ci	 * value.
125e5b75505Sopenharmony_ci	 */
126e5b75505Sopenharmony_ci	EAPOL_idleWhile
127e5b75505Sopenharmony_ci};
128e5b75505Sopenharmony_ci
129e5b75505Sopenharmony_ci/**
130e5b75505Sopenharmony_ci * struct eapol_callbacks - Callback functions from EAP to lower layer
131e5b75505Sopenharmony_ci *
132e5b75505Sopenharmony_ci * This structure defines the callback functions that EAP state machine
133e5b75505Sopenharmony_ci * requires from the lower layer (usually EAPOL state machine) for updating
134e5b75505Sopenharmony_ci * state variables and requesting information. eapol_ctx from
135e5b75505Sopenharmony_ci * eap_peer_sm_init() call will be used as the ctx parameter for these
136e5b75505Sopenharmony_ci * callback functions.
137e5b75505Sopenharmony_ci */
138e5b75505Sopenharmony_cistruct eapol_callbacks {
139e5b75505Sopenharmony_ci	/**
140e5b75505Sopenharmony_ci	 * get_config - Get pointer to the current network configuration
141e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
142e5b75505Sopenharmony_ci	 */
143e5b75505Sopenharmony_ci	struct eap_peer_config * (*get_config)(void *ctx);
144e5b75505Sopenharmony_ci
145e5b75505Sopenharmony_ci	/**
146e5b75505Sopenharmony_ci	 * get_bool - Get a boolean EAPOL state variable
147e5b75505Sopenharmony_ci	 * @variable: EAPOL boolean variable to get
148e5b75505Sopenharmony_ci	 * Returns: Value of the EAPOL variable
149e5b75505Sopenharmony_ci	 */
150e5b75505Sopenharmony_ci	Boolean (*get_bool)(void *ctx, enum eapol_bool_var variable);
151e5b75505Sopenharmony_ci
152e5b75505Sopenharmony_ci	/**
153e5b75505Sopenharmony_ci	 * set_bool - Set a boolean EAPOL state variable
154e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
155e5b75505Sopenharmony_ci	 * @variable: EAPOL boolean variable to set
156e5b75505Sopenharmony_ci	 * @value: Value for the EAPOL variable
157e5b75505Sopenharmony_ci	 */
158e5b75505Sopenharmony_ci	void (*set_bool)(void *ctx, enum eapol_bool_var variable,
159e5b75505Sopenharmony_ci			 Boolean value);
160e5b75505Sopenharmony_ci
161e5b75505Sopenharmony_ci	/**
162e5b75505Sopenharmony_ci	 * get_int - Get an integer EAPOL state variable
163e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
164e5b75505Sopenharmony_ci	 * @variable: EAPOL integer variable to get
165e5b75505Sopenharmony_ci	 * Returns: Value of the EAPOL variable
166e5b75505Sopenharmony_ci	 */
167e5b75505Sopenharmony_ci	unsigned int (*get_int)(void *ctx, enum eapol_int_var variable);
168e5b75505Sopenharmony_ci
169e5b75505Sopenharmony_ci	/**
170e5b75505Sopenharmony_ci	 * set_int - Set an integer EAPOL state variable
171e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
172e5b75505Sopenharmony_ci	 * @variable: EAPOL integer variable to set
173e5b75505Sopenharmony_ci	 * @value: Value for the EAPOL variable
174e5b75505Sopenharmony_ci	 */
175e5b75505Sopenharmony_ci	void (*set_int)(void *ctx, enum eapol_int_var variable,
176e5b75505Sopenharmony_ci			unsigned int value);
177e5b75505Sopenharmony_ci
178e5b75505Sopenharmony_ci	/**
179e5b75505Sopenharmony_ci	 * get_eapReqData - Get EAP-Request data
180e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
181e5b75505Sopenharmony_ci	 * @len: Pointer to variable that will be set to eapReqDataLen
182e5b75505Sopenharmony_ci	 * Returns: Reference to eapReqData (EAP state machine will not free
183e5b75505Sopenharmony_ci	 * this) or %NULL if eapReqData not available.
184e5b75505Sopenharmony_ci	 */
185e5b75505Sopenharmony_ci	struct wpabuf * (*get_eapReqData)(void *ctx);
186e5b75505Sopenharmony_ci
187e5b75505Sopenharmony_ci	/**
188e5b75505Sopenharmony_ci	 * set_config_blob - Set named configuration blob
189e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
190e5b75505Sopenharmony_ci	 * @blob: New value for the blob
191e5b75505Sopenharmony_ci	 *
192e5b75505Sopenharmony_ci	 * Adds a new configuration blob or replaces the current value of an
193e5b75505Sopenharmony_ci	 * existing blob.
194e5b75505Sopenharmony_ci	 */
195e5b75505Sopenharmony_ci	void (*set_config_blob)(void *ctx, struct wpa_config_blob *blob);
196e5b75505Sopenharmony_ci
197e5b75505Sopenharmony_ci	/**
198e5b75505Sopenharmony_ci	 * get_config_blob - Get a named configuration blob
199e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
200e5b75505Sopenharmony_ci	 * @name: Name of the blob
201e5b75505Sopenharmony_ci	 * Returns: Pointer to blob data or %NULL if not found
202e5b75505Sopenharmony_ci	 */
203e5b75505Sopenharmony_ci	const struct wpa_config_blob * (*get_config_blob)(void *ctx,
204e5b75505Sopenharmony_ci							  const char *name);
205e5b75505Sopenharmony_ci
206e5b75505Sopenharmony_ci	/**
207e5b75505Sopenharmony_ci	 * notify_pending - Notify that a pending request can be retried
208e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
209e5b75505Sopenharmony_ci	 *
210e5b75505Sopenharmony_ci	 * An EAP method can perform a pending operation (e.g., to get a
211e5b75505Sopenharmony_ci	 * response from an external process). Once the response is available,
212e5b75505Sopenharmony_ci	 * this callback function can be used to request EAPOL state machine to
213e5b75505Sopenharmony_ci	 * retry delivering the previously received (and still unanswered) EAP
214e5b75505Sopenharmony_ci	 * request to EAP state machine.
215e5b75505Sopenharmony_ci	 */
216e5b75505Sopenharmony_ci	void (*notify_pending)(void *ctx);
217e5b75505Sopenharmony_ci
218e5b75505Sopenharmony_ci	/**
219e5b75505Sopenharmony_ci	 * eap_param_needed - Notify that EAP parameter is needed
220e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
221e5b75505Sopenharmony_ci	 * @field: Field indicator (e.g., WPA_CTRL_REQ_EAP_IDENTITY)
222e5b75505Sopenharmony_ci	 * @txt: User readable text describing the required parameter
223e5b75505Sopenharmony_ci	 */
224e5b75505Sopenharmony_ci	void (*eap_param_needed)(void *ctx, enum wpa_ctrl_req_type field,
225e5b75505Sopenharmony_ci				 const char *txt);
226e5b75505Sopenharmony_ci
227e5b75505Sopenharmony_ci	/**
228e5b75505Sopenharmony_ci	 * notify_cert - Notification of a peer certificate
229e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
230e5b75505Sopenharmony_ci	 * @cert: Certificate information
231e5b75505Sopenharmony_ci	 * @cert_hash: SHA-256 hash of the certificate
232e5b75505Sopenharmony_ci	 */
233e5b75505Sopenharmony_ci	void (*notify_cert)(void *ctx, struct tls_cert_data *cert,
234e5b75505Sopenharmony_ci			    const char *cert_hash);
235e5b75505Sopenharmony_ci
236e5b75505Sopenharmony_ci	/**
237e5b75505Sopenharmony_ci	 * notify_status - Notification of the current EAP state
238e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
239e5b75505Sopenharmony_ci	 * @status: Step in the process of EAP authentication
240e5b75505Sopenharmony_ci	 * @parameter: Step-specific parameter, e.g., EAP method name
241e5b75505Sopenharmony_ci	 */
242e5b75505Sopenharmony_ci	void (*notify_status)(void *ctx, const char *status,
243e5b75505Sopenharmony_ci			      const char *parameter);
244e5b75505Sopenharmony_ci
245e5b75505Sopenharmony_ci	/**
246e5b75505Sopenharmony_ci	 * notify_eap_error - Report EAP method error code
247e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
248e5b75505Sopenharmony_ci	 * @error_code: Error code from the used EAP method
249e5b75505Sopenharmony_ci	 */
250e5b75505Sopenharmony_ci	void (*notify_eap_error)(void *ctx, int error_code);
251e5b75505Sopenharmony_ci
252e5b75505Sopenharmony_ci#ifdef CONFIG_EAP_PROXY
253e5b75505Sopenharmony_ci	/**
254e5b75505Sopenharmony_ci	 * eap_proxy_cb - Callback signifying any updates from eap_proxy
255e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
256e5b75505Sopenharmony_ci	 */
257e5b75505Sopenharmony_ci	void (*eap_proxy_cb)(void *ctx);
258e5b75505Sopenharmony_ci
259e5b75505Sopenharmony_ci	/**
260e5b75505Sopenharmony_ci	 * eap_proxy_notify_sim_status - Notification of SIM status change
261e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
262e5b75505Sopenharmony_ci	 * @sim_state: One of enum value from sim_state
263e5b75505Sopenharmony_ci	 */
264e5b75505Sopenharmony_ci	void (*eap_proxy_notify_sim_status)(void *ctx,
265e5b75505Sopenharmony_ci					    enum eap_proxy_sim_state sim_state);
266e5b75505Sopenharmony_ci
267e5b75505Sopenharmony_ci	/**
268e5b75505Sopenharmony_ci	 * get_imsi - Get the IMSI value from eap_proxy
269e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
270e5b75505Sopenharmony_ci	 * @sim_num: SIM/USIM number to get the IMSI value for
271e5b75505Sopenharmony_ci	 * @imsi: Buffer for IMSI value
272e5b75505Sopenharmony_ci	 * @len: Buffer for returning IMSI length in octets
273e5b75505Sopenharmony_ci	 * Returns: MNC length (2 or 3) or -1 on error
274e5b75505Sopenharmony_ci	 */
275e5b75505Sopenharmony_ci	int (*get_imsi)(void *ctx, int sim_num, char *imsi, size_t *len);
276e5b75505Sopenharmony_ci#endif /* CONFIG_EAP_PROXY */
277e5b75505Sopenharmony_ci
278e5b75505Sopenharmony_ci	/**
279e5b75505Sopenharmony_ci	 * set_anon_id - Set or add anonymous identity
280e5b75505Sopenharmony_ci	 * @ctx: eapol_ctx from eap_peer_sm_init() call
281e5b75505Sopenharmony_ci	 * @id: Anonymous identity (e.g., EAP-SIM pseudonym) or %NULL to clear
282e5b75505Sopenharmony_ci	 * @len: Length of anonymous identity in octets
283e5b75505Sopenharmony_ci	 */
284e5b75505Sopenharmony_ci	void (*set_anon_id)(void *ctx, const u8 *id, size_t len);
285e5b75505Sopenharmony_ci};
286e5b75505Sopenharmony_ci
287e5b75505Sopenharmony_ci/**
288e5b75505Sopenharmony_ci * struct eap_config - Configuration for EAP state machine
289e5b75505Sopenharmony_ci */
290e5b75505Sopenharmony_cistruct eap_config {
291e5b75505Sopenharmony_ci	/**
292e5b75505Sopenharmony_ci	 * opensc_engine_path - OpenSC engine for OpenSSL engine support
293e5b75505Sopenharmony_ci	 *
294e5b75505Sopenharmony_ci	 * Usually, path to engine_opensc.so.
295e5b75505Sopenharmony_ci	 */
296e5b75505Sopenharmony_ci	const char *opensc_engine_path;
297e5b75505Sopenharmony_ci	/**
298e5b75505Sopenharmony_ci	 * pkcs11_engine_path - PKCS#11 engine for OpenSSL engine support
299e5b75505Sopenharmony_ci	 *
300e5b75505Sopenharmony_ci	 * Usually, path to engine_pkcs11.so.
301e5b75505Sopenharmony_ci	 */
302e5b75505Sopenharmony_ci	const char *pkcs11_engine_path;
303e5b75505Sopenharmony_ci	/**
304e5b75505Sopenharmony_ci	 * pkcs11_module_path - OpenSC PKCS#11 module for OpenSSL engine
305e5b75505Sopenharmony_ci	 *
306e5b75505Sopenharmony_ci	 * Usually, path to opensc-pkcs11.so.
307e5b75505Sopenharmony_ci	 */
308e5b75505Sopenharmony_ci	const char *pkcs11_module_path;
309e5b75505Sopenharmony_ci	/**
310e5b75505Sopenharmony_ci	 * openssl_ciphers - OpenSSL cipher string
311e5b75505Sopenharmony_ci	 *
312e5b75505Sopenharmony_ci	 * This is an OpenSSL specific configuration option for configuring the
313e5b75505Sopenharmony_ci	 * default ciphers. If not set, "DEFAULT:!EXP:!LOW" is used as the
314e5b75505Sopenharmony_ci	 * default.
315e5b75505Sopenharmony_ci	 */
316e5b75505Sopenharmony_ci	const char *openssl_ciphers;
317e5b75505Sopenharmony_ci	/**
318e5b75505Sopenharmony_ci	 * wps - WPS context data
319e5b75505Sopenharmony_ci	 *
320e5b75505Sopenharmony_ci	 * This is only used by EAP-WSC and can be left %NULL if not available.
321e5b75505Sopenharmony_ci	 */
322e5b75505Sopenharmony_ci	struct wps_context *wps;
323e5b75505Sopenharmony_ci
324e5b75505Sopenharmony_ci	/**
325e5b75505Sopenharmony_ci	 * cert_in_cb - Include server certificates in callback
326e5b75505Sopenharmony_ci	 */
327e5b75505Sopenharmony_ci	int cert_in_cb;
328e5b75505Sopenharmony_ci};
329e5b75505Sopenharmony_ci
330e5b75505Sopenharmony_cistruct eap_sm * eap_peer_sm_init(void *eapol_ctx,
331e5b75505Sopenharmony_ci				 const struct eapol_callbacks *eapol_cb,
332e5b75505Sopenharmony_ci				 void *msg_ctx, struct eap_config *conf);
333e5b75505Sopenharmony_civoid eap_peer_sm_deinit(struct eap_sm *sm);
334e5b75505Sopenharmony_ciint eap_peer_sm_step(struct eap_sm *sm);
335e5b75505Sopenharmony_civoid eap_sm_abort(struct eap_sm *sm);
336e5b75505Sopenharmony_ciint eap_sm_get_status(struct eap_sm *sm, char *buf, size_t buflen,
337e5b75505Sopenharmony_ci		      int verbose);
338e5b75505Sopenharmony_ciconst char * eap_sm_get_method_name(struct eap_sm *sm);
339e5b75505Sopenharmony_cistruct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted);
340e5b75505Sopenharmony_civoid eap_sm_request_identity(struct eap_sm *sm);
341e5b75505Sopenharmony_civoid eap_sm_request_password(struct eap_sm *sm);
342e5b75505Sopenharmony_civoid eap_sm_request_new_password(struct eap_sm *sm);
343e5b75505Sopenharmony_civoid eap_sm_request_pin(struct eap_sm *sm);
344e5b75505Sopenharmony_civoid eap_sm_request_otp(struct eap_sm *sm, const char *msg, size_t msg_len);
345e5b75505Sopenharmony_civoid eap_sm_request_passphrase(struct eap_sm *sm);
346e5b75505Sopenharmony_civoid eap_sm_request_sim(struct eap_sm *sm, const char *req);
347e5b75505Sopenharmony_civoid eap_sm_notify_ctrl_attached(struct eap_sm *sm);
348e5b75505Sopenharmony_ciu32 eap_get_phase2_type(const char *name, int *vendor);
349e5b75505Sopenharmony_cistruct eap_method_type * eap_get_phase2_types(struct eap_peer_config *config,
350e5b75505Sopenharmony_ci					      size_t *count);
351e5b75505Sopenharmony_civoid eap_set_fast_reauth(struct eap_sm *sm, int enabled);
352e5b75505Sopenharmony_civoid eap_set_workaround(struct eap_sm *sm, unsigned int workaround);
353e5b75505Sopenharmony_civoid eap_set_force_disabled(struct eap_sm *sm, int disabled);
354e5b75505Sopenharmony_civoid eap_set_external_sim(struct eap_sm *sm, int external_sim);
355e5b75505Sopenharmony_ciint eap_key_available(struct eap_sm *sm);
356e5b75505Sopenharmony_civoid eap_notify_success(struct eap_sm *sm);
357e5b75505Sopenharmony_civoid eap_notify_lower_layer_success(struct eap_sm *sm);
358e5b75505Sopenharmony_ciconst u8 * eap_get_eapSessionId(struct eap_sm *sm, size_t *len);
359e5b75505Sopenharmony_ciconst u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len);
360e5b75505Sopenharmony_cistruct wpabuf * eap_get_eapRespData(struct eap_sm *sm);
361e5b75505Sopenharmony_civoid eap_register_scard_ctx(struct eap_sm *sm, void *ctx);
362e5b75505Sopenharmony_civoid eap_invalidate_cached_session(struct eap_sm *sm);
363e5b75505Sopenharmony_ci
364e5b75505Sopenharmony_ciint eap_is_wps_pbc_enrollee(struct eap_peer_config *conf);
365e5b75505Sopenharmony_ciint eap_is_wps_pin_enrollee(struct eap_peer_config *conf);
366e5b75505Sopenharmony_ci
367e5b75505Sopenharmony_cistruct ext_password_data;
368e5b75505Sopenharmony_civoid eap_sm_set_ext_pw_ctx(struct eap_sm *sm, struct ext_password_data *ext);
369e5b75505Sopenharmony_civoid eap_set_anon_id(struct eap_sm *sm, const u8 *id, size_t len);
370e5b75505Sopenharmony_ciint eap_peer_was_failure_expected(struct eap_sm *sm);
371e5b75505Sopenharmony_civoid eap_peer_erp_free_keys(struct eap_sm *sm);
372e5b75505Sopenharmony_cistruct wpabuf * eap_peer_build_erp_reauth_start(struct eap_sm *sm, u8 eap_id);
373e5b75505Sopenharmony_civoid eap_peer_finish(struct eap_sm *sm, const struct eap_hdr *hdr, size_t len);
374e5b75505Sopenharmony_ciint eap_peer_get_erp_info(struct eap_sm *sm, struct eap_peer_config *config,
375e5b75505Sopenharmony_ci			  const u8 **username, size_t *username_len,
376e5b75505Sopenharmony_ci			  const u8 **realm, size_t *realm_len, u16 *erp_seq_num,
377e5b75505Sopenharmony_ci			  const u8 **rrk, size_t *rrk_len);
378e5b75505Sopenharmony_ciint eap_peer_update_erp_next_seq_num(struct eap_sm *sm, u16 seq_num);
379e5b75505Sopenharmony_civoid eap_peer_erp_init(struct eap_sm *sm, u8 *ext_session_id,
380e5b75505Sopenharmony_ci		       size_t ext_session_id_len, u8 *ext_emsk,
381e5b75505Sopenharmony_ci		       size_t ext_emsk_len);
382e5b75505Sopenharmony_ci
383e5b75505Sopenharmony_ci#endif /* IEEE8021X_EAPOL */
384e5b75505Sopenharmony_ci
385e5b75505Sopenharmony_ci#endif /* EAP_H */
386