Lines Matching refs:sm

32 static int eap_sm_calculateTimeout(struct eap_sm *sm, int retransCount,
35 static void eap_sm_parseEapResp(struct eap_sm *sm, const struct wpabuf *resp);
37 static struct wpabuf * eap_sm_buildSuccess(struct eap_sm *sm, u8 id);
38 static struct wpabuf * eap_sm_buildFailure(struct eap_sm *sm, u8 id);
39 static int eap_sm_nextId(struct eap_sm *sm, int id);
40 static void eap_sm_Policy_update(struct eap_sm *sm, const u8 *nak_list,
42 static EapType eap_sm_Policy_getNextMethod(struct eap_sm *sm, int *vendor);
43 static int eap_sm_Policy_getDecision(struct eap_sm *sm);
44 static Boolean eap_sm_Policy_doPickUp(struct eap_sm *sm, EapType method);
82 * @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
89 * selected based on the specified identity. sm->user and
90 * sm->user_eap_method_index are updated for the new user when a matching user
91 * is found. sm->user can be used to get user information (e.g., password).
93 int eap_user_get(struct eap_sm *sm, const u8 *identity, size_t identity_len,
98 if (sm == NULL || sm->eapol_cb == NULL ||
99 sm->eapol_cb->get_eap_user == NULL)
102 eap_user_free(sm->user);
103 sm->user = NULL;
109 if (sm->eapol_cb->get_eap_user(sm->eapol_ctx, identity,
115 sm->user = user;
116 sm->user_eap_method_index = 0;
125 sm->num_rounds = 0;
133 if (sm->eap_if.eapRestart && !sm->eap_server && sm->identity) {
138 eap_server_clear_identity(sm);
141 sm->currentId = -1;
142 sm->eap_if.eapSuccess = FALSE;
143 sm->eap_if.eapFail = FALSE;
144 sm->eap_if.eapTimeout = FALSE;
145 os_free(sm->eap_if.eapKeyData);
146 sm->eap_if.eapKeyData = NULL;
147 sm->eap_if.eapKeyDataLen = 0;
148 sm->eap_if.eapKeyAvailable = FALSE;
149 sm->eap_if.eapRestart = FALSE;
156 if (sm->m && sm->eap_method_priv) {
157 sm->m->reset(sm, sm->eap_method_priv);
158 sm->eap_method_priv = NULL;
160 sm->m = NULL;
161 sm->user_eap_method_index = 0;
163 if (sm->backend_auth) {
164 sm->currentMethod = EAP_TYPE_NONE;
166 eap_sm_parseEapResp(sm, sm->eap_if.eapRespData);
167 if (sm->rxResp) {
168 sm->currentId = sm->respId;
171 sm->num_rounds = 0;
172 sm->method_pending = METHOD_PENDING_NONE;
174 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_STARTED
175 MACSTR, MAC2STR(sm->peer_addr));
183 if (eap_sm_Policy_doPickUp(sm, sm->respMethod)) {
184 sm->currentMethod = sm->respMethod;
185 if (sm->m && sm->eap_method_priv) {
186 sm->m->reset(sm, sm->eap_method_priv);
187 sm->eap_method_priv = NULL;
189 sm->m = eap_server_get_eap_method(EAP_VENDOR_IETF,
190 sm->currentMethod);
191 if (sm->m && sm->m->initPickUp) {
192 sm->eap_method_priv = sm->m->initPickUp(sm);
193 if (sm->eap_method_priv == NULL) {
196 sm->currentMethod);
197 sm->m = NULL;
198 sm->currentMethod = EAP_TYPE_NONE;
201 sm->m = NULL;
202 sm->currentMethod = EAP_TYPE_NONE;
206 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_PROPOSED_METHOD
207 "method=%u", sm->currentMethod);
215 sm->eap_if.retransWhile = eap_sm_calculateTimeout(
216 sm, sm->retransCount, sm->eap_if.eapSRTT, sm->eap_if.eapRTTVAR,
217 sm->methodTimeout);
225 sm->retransCount++;
226 if (sm->retransCount <= sm->MaxRetrans && sm->lastReqData) {
227 if (eap_copy_buf(&sm->eap_if.eapReqData, sm->lastReqData) == 0)
228 sm->eap_if.eapReq = TRUE;
238 eap_sm_parseEapResp(sm, sm->eap_if.eapRespData);
239 sm->num_rounds++;
246 sm->eap_if.eapResp = FALSE;
247 sm->eap_if.eapNoReq = TRUE;
255 sm->retransCount = 0;
256 if (sm->eap_if.eapReqData) {
257 if (eap_copy_buf(&sm->lastReqData, sm->eap_if.eapReqData) == 0)
259 sm->eap_if.eapResp = FALSE;
260 sm->eap_if.eapReq = TRUE;
262 sm->eap_if.eapResp = FALSE;
263 sm->eap_if.eapReq = FALSE;
267 sm->eap_if.eapResp = FALSE;
268 sm->eap_if.eapReq = FALSE;
269 sm->eap_if.eapNoReq = TRUE;
278 if (!eap_hdr_len_valid(sm->eap_if.eapRespData, 1)) {
279 sm->ignore = TRUE;
283 if (sm->m->check) {
284 sm->ignore = sm->m->check(sm, sm->eap_method_priv,
285 sm->eap_if.eapRespData);
294 if (sm->m == NULL) {
299 sm->currentId = eap_sm_nextId(sm, sm->currentId);
301 sm->currentId);
302 sm->lastId = sm->currentId;
303 wpabuf_free(sm->eap_if.eapReqData);
304 sm->eap_if.eapReqData = sm->m->buildReq(sm, sm->eap_method_priv,
305 sm->currentId);
306 if (sm->m->getTimeout)
307 sm->methodTimeout = sm->m->getTimeout(sm, sm->eap_method_priv);
309 sm->methodTimeout = 0;
317 if (!eap_hdr_len_valid(sm->eap_if.eapRespData, 1))
320 sm->m->process(sm, sm->eap_method_priv, sm->eap_if.eapRespData);
321 if (sm->m->isDone(sm, sm->eap_method_priv)) {
322 eap_sm_Policy_update(sm, NULL, 0);
323 os_free(sm->eap_if.eapKeyData);
324 if (sm->m->getKey) {
325 sm->eap_if.eapKeyData = sm->m->getKey(
326 sm, sm->eap_method_priv,
327 &sm->eap_if.eapKeyDataLen);
329 sm->eap_if.eapKeyData = NULL;
330 sm->eap_if.eapKeyDataLen = 0;
332 sm->methodState = METHOD_END;
334 sm->methodState = METHOD_CONTINUE;
346 type = eap_sm_Policy_getNextMethod(sm, &vendor);
348 sm->currentMethod = type;
350 sm->currentMethod = EAP_TYPE_EXPANDED;
351 if (sm->m && sm->eap_method_priv) {
352 sm->m->reset(sm, sm->eap_method_priv);
353 sm->eap_method_priv = NULL;
355 sm->m = eap_server_get_eap_method(vendor, type);
356 if (sm->m) {
357 sm->eap_method_priv = sm->m->init(sm);
358 if (sm->eap_method_priv == NULL) {
360 "method %d", sm->currentMethod);
361 sm->m = NULL;
362 sm->currentMethod = EAP_TYPE_NONE;
365 if (sm->currentMethod == EAP_TYPE_IDENTITY ||
366 sm->currentMethod == EAP_TYPE_NOTIFICATION)
367 sm->methodState = METHOD_CONTINUE;
369 sm->methodState = METHOD_PROPOSED;
371 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_PROPOSED_METHOD
372 "vendor=%u method=%u", vendor, sm->currentMethod);
385 if (sm->eap_method_priv) {
386 sm->m->reset(sm, sm->eap_method_priv);
387 sm->eap_method_priv = NULL;
389 sm->m = NULL;
391 if (!eap_hdr_len_valid(sm->eap_if.eapRespData, 1))
394 nak = wpabuf_head(sm->eap_if.eapRespData);
395 if (nak && wpabuf_len(sm->eap_if.eapRespData) > sizeof(*nak)) {
397 if (len > wpabuf_len(sm->eap_if.eapRespData))
398 len = wpabuf_len(sm->eap_if.eapRespData);
407 eap_sm_Policy_update(sm, nak_list, len);
415 sm->decision = eap_sm_Policy_getDecision(sm);
423 sm->eap_if.eapTimeout = TRUE;
431 wpabuf_free(sm->eap_if.eapReqData);
432 sm->eap_if.eapReqData = eap_sm_buildFailure(sm, sm->currentId);
433 wpabuf_free(sm->lastReqData);
434 sm->lastReqData = NULL;
435 sm->eap_if.eapFail = TRUE;
437 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_FAILURE
438 MACSTR, MAC2STR(sm->peer_addr));
446 wpabuf_free(sm->eap_if.eapReqData);
447 sm->eap_if.eapReqData = eap_sm_buildSuccess(sm, sm->currentId);
448 wpabuf_free(sm->lastReqData);
449 sm->lastReqData = NULL;
450 if (sm->eap_if.eapKeyData)
451 sm->eap_if.eapKeyAvailable = TRUE;
452 sm->eap_if.eapSuccess = TRUE;
454 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_SUCCESS
455 MACSTR, MAC2STR(sm->peer_addr));
463 wpabuf_free(sm->eap_if.aaaEapRespData);
464 sm->eap_if.aaaEapRespData = NULL;
472 sm->eap_if.retransWhile = eap_sm_calculateTimeout(
473 sm, sm->retransCount, sm->eap_if.eapSRTT, sm->eap_if.eapRTTVAR,
474 sm->methodTimeout);
482 sm->retransCount++;
483 if (sm->retransCount <= sm->MaxRetrans && sm->lastReqData) {
484 if (eap_copy_buf(&sm->eap_if.eapReqData, sm->lastReqData) == 0)
485 sm->eap_if.eapReq = TRUE;
495 eap_sm_parseEapResp(sm, sm->eap_if.eapRespData);
502 sm->eap_if.eapResp = FALSE;
503 sm->eap_if.eapNoReq = TRUE;
511 sm->retransCount = 0;
512 if (sm->eap_if.eapReqData) {
513 if (eap_copy_buf(&sm->lastReqData, sm->eap_if.eapReqData) == 0)
515 sm->eap_if.eapResp = FALSE;
516 sm->eap_if.eapReq = TRUE;
518 sm->eap_if.eapResp = FALSE;
519 sm->eap_if.eapReq = FALSE;
523 sm->eap_if.eapResp = FALSE;
524 sm->eap_if.eapReq = FALSE;
525 sm->eap_if.eapNoReq = TRUE;
534 if (sm->eap_if.eapRespData == NULL) {
543 * stores the identity into sm->identity.
546 eap_copy_buf(&sm->eap_if.aaaEapRespData, sm->eap_if.eapRespData);
554 eap_copy_buf(&sm->eap_if.eapReqData, sm->eap_if.aaaEapReqData);
555 sm->currentId = eap_sm_getId(sm->eap_if.eapReqData);
556 sm->methodTimeout = sm->eap_if.aaaMethodTimeout;
564 sm->eap_if.aaaFail = FALSE;
565 sm->eap_if.aaaSuccess = FALSE;
566 sm->eap_if.aaaEapReq = FALSE;
567 sm->eap_if.aaaEapNoReq = FALSE;
568 sm->eap_if.aaaEapResp = TRUE;
576 sm->eap_if.eapTimeout = TRUE;
584 eap_copy_buf(&sm->eap_if.eapReqData, sm->eap_if.aaaEapReqData);
585 sm->eap_if.eapFail = TRUE;
593 eap_copy_buf(&sm->eap_if.eapReqData, sm->eap_if.aaaEapReqData);
595 sm->eap_if.eapKeyAvailable = sm->eap_if.aaaEapKeyAvailable;
596 if (sm->eap_if.aaaEapKeyAvailable) {
597 EAP_COPY(&sm->eap_if.eapKeyData, sm->eap_if.aaaEapKeyData);
599 os_free(sm->eap_if.eapKeyData);
600 sm->eap_if.eapKeyData = NULL;
601 sm->eap_if.eapKeyDataLen = 0;
604 sm->eap_if.eapSuccess = TRUE;
611 sm->start_reauth = TRUE;
617 if (sm->eap_if.eapRestart && sm->eap_if.portEnabled)
619 else if (!sm->eap_if.portEnabled)
621 else if (sm->num_rounds > EAP_MAX_AUTH_ROUNDS) {
622 if (sm->num_rounds == EAP_MAX_AUTH_ROUNDS + 1) {
626 sm->num_rounds++;
629 } else switch (sm->EAP_state) {
631 if (sm->backend_auth) {
632 if (!sm->rxResp)
634 else if (sm->rxResp &&
635 (sm->respMethod == EAP_TYPE_NAK ||
636 (sm->respMethod == EAP_TYPE_EXPANDED &&
637 sm->respVendor == EAP_VENDOR_IETF &&
638 sm->respVendorMethod == EAP_TYPE_NAK)))
647 if (sm->currentMethod == EAP_TYPE_NONE) {
654 if (sm->eap_if.portEnabled)
658 if (sm->eap_if.retransWhile == 0)
660 else if (sm->eap_if.eapResp)
664 if (sm->retransCount > sm->MaxRetrans)
670 if (sm->rxResp && (sm->respId == sm->currentId) &&
671 (sm->respMethod == EAP_TYPE_NAK ||
672 (sm->respMethod == EAP_TYPE_EXPANDED &&
673 sm->respVendor == EAP_VENDOR_IETF &&
674 sm->respVendorMethod == EAP_TYPE_NAK))
675 && (sm->methodState == METHOD_PROPOSED))
677 else if (sm->rxResp && (sm->respId == sm->currentId) &&
678 ((sm->respMethod == sm->currentMethod) ||
679 (sm->respMethod == EAP_TYPE_EXPANDED &&
680 sm->respVendor == EAP_VENDOR_IETF &&
681 sm->respVendorMethod == sm->currentMethod)))
687 sm->rxResp, sm->respId, sm->currentId,
688 sm->respMethod, sm->currentMethod);
699 if (sm->ignore)
714 if (sm->methodState == METHOD_END)
716 else if (sm->method_pending == METHOD_PENDING_WAIT) {
720 } else if (sm->method_pending == METHOD_PENDING_CONT) {
724 sm->method_pending = METHOD_PENDING_NONE;
736 if (sm->method_pending == METHOD_PENDING_WAIT) {
740 if (sm->user_eap_method_index > 0)
741 sm->user_eap_method_index--;
742 } else if (sm->method_pending == METHOD_PENDING_CONT) {
746 sm->method_pending = METHOD_PENDING_NONE;
755 if (sm->decision == DECISION_FAILURE)
757 else if (sm->decision == DECISION_SUCCESS)
759 else if (sm->decision == DECISION_PASSTHROUGH)
772 if (sm->currentId == -1)
778 if (sm->eap_if.eapResp)
780 else if (sm->eap_if.retransWhile == 0)
784 if (sm->retransCount > sm->MaxRetrans)
790 if (sm->rxResp && (sm->respId == sm->currentId))
808 if (sm->eap_if.aaaFail)
810 else if (sm->eap_if.aaaSuccess)
812 else if (sm->eap_if.aaaEapReq)
814 else if (sm->eap_if.aaaTimeout)
827 static int eap_sm_calculateTimeout(struct eap_sm *sm, int retransCount,
879 static void eap_sm_parseEapResp(struct eap_sm *sm, const struct wpabuf *resp)
885 sm->rxResp = FALSE;
886 sm->respId = -1;
887 sm->respMethod = EAP_TYPE_NONE;
888 sm->respVendor = EAP_VENDOR_IETF;
889 sm->respVendorMethod = EAP_TYPE_NONE;
908 sm->respId = hdr->identifier;
911 sm->rxResp = TRUE;
915 sm->respMethod = *pos++;
916 if (sm->respMethod == EAP_TYPE_EXPANDED) {
923 sm->respVendor = WPA_GET_BE24(pos);
925 sm->respVendorMethod = WPA_GET_BE32(pos);
931 sm->rxResp, sm->respId, sm->respMethod, sm->respVendor,
932 sm->respVendorMethod);
949 static struct wpabuf * eap_sm_buildSuccess(struct eap_sm *sm, u8 id)
967 static struct wpabuf * eap_sm_buildFailure(struct eap_sm *sm, u8 id)
985 static int eap_sm_nextId(struct eap_sm *sm, int id)
991 if (id != sm->lastId)
1000 * @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
1007 void eap_sm_process_nak(struct eap_sm *sm, const u8 *nak_list, size_t len)
1012 if (sm->user == NULL)
1016 "index %d)", sm->user_eap_method_index);
1019 (u8 *) sm->user->methods,
1020 EAP_MAX_METHODS * sizeof(sm->user->methods[0]));
1024 i = sm->user_eap_method_index;
1026 (sm->user->methods[i].vendor != EAP_VENDOR_IETF ||
1027 sm->user->methods[i].method != EAP_TYPE_NONE)) {
1028 if (sm->user->methods[i].vendor != EAP_VENDOR_IETF)
1031 if (nak_list[j] == sm->user->methods[i].method) {
1045 os_memmove(&sm->user->methods[i],
1046 &sm->user->methods[i + 1],
1048 sizeof(sm->user->methods[0]));
1050 sm->user->methods[EAP_MAX_METHODS - 1].vendor =
1052 sm->user->methods[EAP_MAX_METHODS - 1].method = EAP_TYPE_NONE;
1056 (u8 *) sm->user->methods, EAP_MAX_METHODS *
1057 sizeof(sm->user->methods[0]));
1061 static void eap_sm_Policy_update(struct eap_sm *sm, const u8 *nak_list,
1064 if (nak_list == NULL || sm == NULL || sm->user == NULL)
1067 if (sm->user->phase2) {
1070 sm->decision = DECISION_FAILURE;
1074 eap_sm_process_nak(sm, nak_list, len);
1078 static EapType eap_sm_Policy_getNextMethod(struct eap_sm *sm, int *vendor)
1081 int idx = sm->user_eap_method_index;
1090 if (sm->identity == NULL || sm->currentId == -1) {
1093 sm->update_user = TRUE;
1094 } else if (sm->user && idx < EAP_MAX_METHODS &&
1095 (sm->user->methods[idx].vendor != EAP_VENDOR_IETF ||
1096 sm->user->methods[idx].method != EAP_TYPE_NONE)) {
1097 *vendor = sm->user->methods[idx].vendor;
1098 next = sm->user->methods[idx].method;
1099 sm->user_eap_method_index++;
1110 static int eap_sm_Policy_getDecision(struct eap_sm *sm)
1112 if (!sm->eap_server && sm->identity && !sm->start_reauth) {
1117 if (sm->m && sm->currentMethod != EAP_TYPE_IDENTITY &&
1118 sm->m->isSuccess(sm, sm->eap_method_priv)) {
1121 sm->update_user = TRUE;
1125 if (sm->m && sm->m->isDone(sm, sm->eap_method_priv) &&
1126 !sm->m->isSuccess(sm, sm->eap_method_priv)) {
1129 sm->update_user = TRUE;
1133 if ((sm->user == NULL || sm->update_user) && sm->identity &&
1134 !sm->start_reauth) {
1142 if (sm->user && sm->currentMethod == EAP_TYPE_IDENTITY &&
1143 sm->user->methods[0].vendor == EAP_VENDOR_IETF &&
1144 sm->user->methods[0].method == EAP_TYPE_IDENTITY)
1146 if (eap_user_get(sm, sm->identity, sm->identity_len, 0) != 0) {
1151 if (id_req && sm->user &&
1152 sm->user->methods[0].vendor == EAP_VENDOR_IETF &&
1153 sm->user->methods[0].method == EAP_TYPE_IDENTITY) {
1156 sm->update_user = TRUE;
1159 sm->update_user = FALSE;
1161 sm->start_reauth = FALSE;
1163 if (sm->user && sm->user_eap_method_index < EAP_MAX_METHODS &&
1164 (sm->user->methods[sm->user_eap_method_index].vendor !=
1166 sm->user->methods[sm->user_eap_method_index].method !=
1173 if (sm->identity == NULL || sm->currentId == -1) {
1185 static Boolean eap_sm_Policy_doPickUp(struct eap_sm *sm, EapType method)
1193 * @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
1200 int eap_server_sm_step(struct eap_sm *sm)
1204 sm->changed = FALSE;
1206 if (sm->changed)
1208 } while (sm->changed);
1236 struct eap_sm *sm;
1238 sm = os_zalloc(sizeof(*sm));
1239 if (sm == NULL)
1241 sm->eapol_ctx = eapol_ctx;
1242 sm->eapol_cb = eapol_cb;
1243 sm->MaxRetrans = 5; /* RFC 3748: max 3-5 retransmissions suggested */
1244 sm->ssl_ctx = conf->ssl_ctx;
1245 sm->msg_ctx = conf->msg_ctx;
1246 sm->eap_sim_db_priv = conf->eap_sim_db_priv;
1247 sm->backend_auth = conf->backend_auth;
1248 sm->eap_server = conf->eap_server;
1250 sm->pac_opaque_encr_key = os_malloc(16);
1251 if (sm->pac_opaque_encr_key) {
1252 os_memcpy(sm->pac_opaque_encr_key,
1257 sm->eap_fast_a_id = os_malloc(conf->eap_fast_a_id_len);
1258 if (sm->eap_fast_a_id) {
1259 os_memcpy(sm->eap_fast_a_id, conf->eap_fast_a_id,
1261 sm->eap_fast_a_id_len = conf->eap_fast_a_id_len;
1265 sm->eap_fast_a_id_info = os_strdup(conf->eap_fast_a_id_info);
1266 sm->eap_fast_prov = conf->eap_fast_prov;
1267 sm->pac_key_lifetime = conf->pac_key_lifetime;
1268 sm->pac_key_refresh_time = conf->pac_key_refresh_time;
1269 sm->eap_sim_aka_result_ind = conf->eap_sim_aka_result_ind;
1270 sm->tnc = conf->tnc;
1271 sm->wps = conf->wps;
1273 sm->assoc_wps_ie = wpabuf_dup(conf->assoc_wps_ie);
1275 sm->assoc_p2p_ie = wpabuf_dup(conf->assoc_p2p_ie);
1277 os_memcpy(sm->peer_addr, conf->peer_addr, ETH_ALEN);
1278 sm->fragment_size = conf->fragment_size;
1279 sm->pwd_group = conf->pwd_group;
1280 sm->pbc_in_m1 = conf->pbc_in_m1;
1284 return sm;
1290 * @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
1295 void eap_server_sm_deinit(struct eap_sm *sm)
1297 if (sm == NULL)
1300 if (sm->m && sm->eap_method_priv)
1301 sm->m->reset(sm, sm->eap_method_priv);
1302 wpabuf_free(sm->eap_if.eapReqData);
1303 os_free(sm->eap_if.eapKeyData);
1304 wpabuf_free(sm->lastReqData);
1305 wpabuf_free(sm->eap_if.eapRespData);
1306 os_free(sm->identity);
1307 os_free(sm->pac_opaque_encr_key);
1308 os_free(sm->eap_fast_a_id);
1309 os_free(sm->eap_fast_a_id_info);
1310 wpabuf_free(sm->eap_if.aaaEapReqData);
1311 wpabuf_free(sm->eap_if.aaaEapRespData);
1312 os_free(sm->eap_if.aaaEapKeyData);
1313 eap_user_free(sm->user);
1314 wpabuf_free(sm->assoc_wps_ie);
1315 wpabuf_free(sm->assoc_p2p_ie);
1316 os_free(sm);
1322 * @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
1327 void eap_sm_notify_cached(struct eap_sm *sm)
1329 if (sm == NULL)
1332 sm->EAP_state = EAP_SUCCESS;
1338 * @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
1342 void eap_sm_pending_cb(struct eap_sm *sm)
1344 if (sm == NULL)
1347 if (sm->method_pending == METHOD_PENDING_WAIT)
1348 sm->method_pending = METHOD_PENDING_CONT;
1354 * @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
1357 int eap_sm_method_pending(struct eap_sm *sm)
1359 if (sm == NULL)
1361 return sm->method_pending == METHOD_PENDING_WAIT;
1367 * @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
1371 const u8 * eap_get_identity(struct eap_sm *sm, size_t *len)
1373 *len = sm->identity_len;
1374 return sm->identity;
1380 * @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
1383 struct eap_eapol_interface * eap_get_interface(struct eap_sm *sm)
1385 return &sm->eap_if;
1391 * @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
1397 void eap_server_clear_identity(struct eap_sm *sm)
1399 os_free(sm->identity);
1400 sm->identity = NULL;