Lines Matching refs:sm
39 static Boolean eap_sm_allowMethod(struct eap_sm *sm, int vendor,
41 static struct wpabuf * eap_sm_buildNak(struct eap_sm *sm, int id);
42 static void eap_sm_processIdentity(struct eap_sm *sm,
44 static void eap_sm_processNotify(struct eap_sm *sm, const struct wpabuf *req);
46 static void eap_sm_parseEapReq(struct eap_sm *sm, const struct wpabuf *req);
51 static void eap_sm_request(struct eap_sm *sm, enum wpa_ctrl_req_type field,
56 static Boolean eapol_get_bool(struct eap_sm *sm, enum eapol_bool_var var) in eapol_get_bool() argument
58 return sm->eapol_cb->get_bool(sm->eapol_ctx, var); in eapol_get_bool()
62 static void eapol_set_bool(struct eap_sm *sm, enum eapol_bool_var var, in eapol_set_bool() argument
65 sm->eapol_cb->set_bool(sm->eapol_ctx, var, value); in eapol_set_bool()
69 static unsigned int eapol_get_int(struct eap_sm *sm, enum eapol_int_var var) in eapol_get_int() argument
71 return sm->eapol_cb->get_int(sm->eapol_ctx, var); in eapol_get_int()
75 static void eapol_set_int(struct eap_sm *sm, enum eapol_int_var var, in eapol_set_int() argument
78 sm->eapol_cb->set_int(sm->eapol_ctx, var, value); in eapol_set_int()
82 static struct wpabuf * eapol_get_eapReqData(struct eap_sm *sm) in eapol_get_eapReqData() argument
84 return sm->eapol_cb->get_eapReqData(sm->eapol_ctx); in eapol_get_eapReqData()
88 static void eap_notify_status(struct eap_sm *sm, const char *status, in eap_notify_status() argument
93 if (sm->eapol_cb->notify_status) in eap_notify_status()
94 sm->eapol_cb->notify_status(sm->eapol_ctx, status, parameter); in eap_notify_status()
98 static void eap_sm_free_key(struct eap_sm *sm) in eap_sm_free_key() argument
100 if (sm->eapKeyData) { in eap_sm_free_key()
101 bin_clear_free(sm->eapKeyData, sm->eapKeyDataLen); in eap_sm_free_key()
102 sm->eapKeyData = NULL; in eap_sm_free_key()
107 static void eap_deinit_prev_method(struct eap_sm *sm, const char *txt) in eap_deinit_prev_method() argument
109 ext_password_free(sm->ext_pw_buf); in eap_deinit_prev_method()
110 sm->ext_pw_buf = NULL; in eap_deinit_prev_method()
112 if (sm->m == NULL || sm->eap_method_priv == NULL) in eap_deinit_prev_method()
116 "(%d, %s) at %s", sm->selectedMethod, sm->m->name, txt); in eap_deinit_prev_method()
117 sm->m->deinit(sm, sm->eap_method_priv); in eap_deinit_prev_method()
118 sm->eap_method_priv = NULL; in eap_deinit_prev_method()
119 sm->m = NULL; in eap_deinit_prev_method()
130 int eap_allowed_method(struct eap_sm *sm, int vendor, u32 method) in eap_allowed_method() argument
132 struct eap_peer_config *config = eap_get_config(sm); in eap_allowed_method()
157 if (sm->fast_reauth && sm->m && sm->m->has_reauth_data && in SM_STATE()
158 sm->m->has_reauth_data(sm, sm->eap_method_priv) && in SM_STATE()
159 !sm->prev_failure && in SM_STATE()
160 sm->last_config == eap_get_config(sm)) { in SM_STATE()
163 sm->m->deinit_for_reauth(sm, sm->eap_method_priv); in SM_STATE()
165 sm->last_config = eap_get_config(sm); in SM_STATE()
166 eap_deinit_prev_method(sm, "INITIALIZE"); in SM_STATE()
168 sm->selectedMethod = EAP_TYPE_NONE; in SM_STATE()
169 sm->methodState = METHOD_NONE; in SM_STATE()
170 sm->allowNotifications = TRUE; in SM_STATE()
171 sm->decision = DECISION_FAIL; in SM_STATE()
172 sm->ClientTimeout = EAP_CLIENT_TIMEOUT_DEFAULT; in SM_STATE()
173 eapol_set_int(sm, EAPOL_idleWhile, sm->ClientTimeout); in SM_STATE()
174 eapol_set_bool(sm, EAPOL_eapSuccess, FALSE); in SM_STATE()
175 eapol_set_bool(sm, EAPOL_eapFail, FALSE); in SM_STATE()
176 eap_sm_free_key(sm); in SM_STATE()
177 os_free(sm->eapSessionId); in SM_STATE()
178 sm->eapSessionId = NULL; in SM_STATE()
179 sm->eapKeyAvailable = FALSE; in SM_STATE()
180 eapol_set_bool(sm, EAPOL_eapRestart, FALSE); in SM_STATE()
181 sm->lastId = -1; /* new session - make sure this does not match with in SM_STATE()
191 eapol_set_bool(sm, EAPOL_eapResp, FALSE); in SM_STATE()
192 eapol_set_bool(sm, EAPOL_eapNoResp, FALSE); in SM_STATE()
200 sm->ignore = 0; in SM_STATE()
201 sm->num_rounds = 0; in SM_STATE()
202 sm->prev_failure = 0; in SM_STATE()
203 sm->expected_failure = 0; in SM_STATE()
204 sm->reauthInit = FALSE; in SM_STATE()
205 sm->erp_seq = (u32) -1; in SM_STATE()
217 sm->num_rounds = 0; in SM_STATE()
223 eapol_set_int(sm, EAPOL_idleWhile, 0); in SM_STATE()
247 eapReqData = eapol_get_eapReqData(sm); in SM_STATE()
249 eap_sm_parseEapReq(sm, eapReqData); in SM_STATE()
250 sm->num_rounds++; in SM_STATE()
266 if (sm->reqMethod == EAP_TYPE_EXPANDED) in SM_STATE()
267 method = sm->reqVendorMethod; in SM_STATE()
269 method = sm->reqMethod; in SM_STATE()
271 eap_method = eap_peer_get_eap_method(sm->reqVendor, method); in SM_STATE()
273 if (!eap_sm_allowMethod(sm, sm->reqVendor, method)) { in SM_STATE()
275 sm->reqVendor, method); in SM_STATE()
276 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_PROPOSED_METHOD in SM_STATE()
278 sm->reqVendor, method); in SM_STATE()
279 eap_notify_status(sm, "refuse proposed method", in SM_STATE()
284 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_PROPOSED_METHOD in SM_STATE()
285 "vendor=%u method=%u", sm->reqVendor, method); in SM_STATE()
287 eap_notify_status(sm, "accept proposed method", in SM_STATE()
297 if (sm->fast_reauth && in SM_STATE()
298 sm->m && sm->m->vendor == sm->reqVendor && in SM_STATE()
299 sm->m->method == method && in SM_STATE()
300 sm->m->has_reauth_data && in SM_STATE()
301 sm->m->has_reauth_data(sm, sm->eap_method_priv)) { in SM_STATE()
306 eap_deinit_prev_method(sm, "GET_METHOD"); in SM_STATE()
310 sm->selectedMethod = sm->reqMethod; in SM_STATE()
311 if (sm->m == NULL) in SM_STATE()
312 sm->m = eap_method; in SM_STATE()
313 if (!sm->m) { in SM_STATE()
316 sm->reqVendor, method); in SM_STATE()
320 sm->ClientTimeout = EAP_CLIENT_TIMEOUT_DEFAULT; in SM_STATE()
324 sm->reqVendor, method, sm->m->name); in SM_STATE()
326 sm->eap_method_priv = sm->m->init_for_reauth( in SM_STATE()
327 sm, sm->eap_method_priv); in SM_STATE()
329 sm->waiting_ext_cert_check = 0; in SM_STATE()
330 sm->ext_cert_check = 0; in SM_STATE()
331 sm->eap_method_priv = sm->m->init(sm); in SM_STATE()
334 if (sm->eap_method_priv == NULL) { in SM_STATE()
335 struct eap_peer_config *config = eap_get_config(sm); in SM_STATE()
336 wpa_msg(sm->msg_ctx, MSG_INFO, in SM_STATE()
339 sm->reqVendor, method, sm->m->name); in SM_STATE()
340 sm->m = NULL; in SM_STATE()
341 sm->methodState = METHOD_NONE; in SM_STATE()
342 sm->selectedMethod = EAP_TYPE_NONE; in SM_STATE()
343 if (sm->reqMethod == EAP_TYPE_TLS && config && in SM_STATE()
359 sm->methodState = METHOD_INIT; in SM_STATE()
360 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_METHOD in SM_STATE()
362 sm->reqVendor, method, sm->m->name); in SM_STATE()
366 wpabuf_free(sm->eapRespData); in SM_STATE()
367 sm->eapRespData = NULL; in SM_STATE()
368 sm->eapRespData = eap_sm_buildNak(sm, sm->reqId); in SM_STATE()
374 static char * eap_home_realm(struct eap_sm *sm) in eap_home_realm() argument
376 struct eap_peer_config *config = eap_get_config(sm); in eap_home_realm()
421 eap_erp_get_key(struct eap_sm *sm, const char *realm) in eap_erp_get_key() argument
425 dl_list_for_each(erp, &sm->erp_keys, struct eap_erp_key, list) { in eap_erp_get_key()
441 eap_erp_get_key_nai(struct eap_sm *sm, const char *nai) in eap_erp_get_key_nai() argument
445 dl_list_for_each(erp, &sm->erp_keys, struct eap_erp_key, list) { in eap_erp_get_key_nai()
461 static void eap_erp_remove_keys_realm(struct eap_sm *sm, const char *realm) in eap_erp_remove_keys_realm() argument
465 while ((erp = eap_erp_get_key(sm, realm)) != NULL) { in eap_erp_remove_keys_realm()
475 void eap_peer_erp_free_keys(struct eap_sm *sm) in eap_peer_erp_free_keys() argument
480 dl_list_for_each_safe(erp, tmp, &sm->erp_keys, struct eap_erp_key, list) in eap_peer_erp_free_keys()
486 static void eap_peer_erp_init(struct eap_sm *sm) in eap_peer_erp_init() argument
498 realm = eap_home_realm(sm); in eap_peer_erp_init()
503 eap_erp_remove_keys_realm(sm, realm); in eap_peer_erp_init()
520 emsk = sm->m->get_emsk(sm, sm->eap_method_priv, &emsk_len); in eap_peer_erp_init()
530 if (hmac_sha256_kdf(sm->eapSessionId, sm->eapSessionIdLen, "EMSK", in eap_peer_erp_init()
565 dl_list_add(&sm->erp_keys, &erp->list); in eap_peer_erp_init()
576 struct wpabuf * eap_peer_build_erp_reauth_start(struct eap_sm *sm, u8 eap_id) in eap_peer_build_erp_reauth_start() argument
583 realm = eap_home_realm(sm); in eap_peer_build_erp_reauth_start()
587 erp = eap_erp_get_key(sm, realm); in eap_peer_build_erp_reauth_start()
623 sm->erp_seq = erp->next_seq; in eap_peer_build_erp_reauth_start()
632 static int eap_peer_erp_reauth_start(struct eap_sm *sm, u8 eap_id) in eap_peer_erp_reauth_start() argument
636 msg = eap_peer_build_erp_reauth_start(sm, eap_id); in eap_peer_erp_reauth_start()
641 wpabuf_free(sm->eapRespData); in eap_peer_erp_reauth_start()
642 sm->eapRespData = msg; in eap_peer_erp_reauth_start()
643 sm->reauthInit = TRUE; in eap_peer_erp_reauth_start()
660 if (sm->m == NULL) { in SM_STATE()
665 eapReqData = eapol_get_eapReqData(sm); in SM_STATE()
666 if (sm->m->vendor == EAP_VENDOR_IETF && sm->m->method == EAP_TYPE_LEAP) in SM_STATE()
686 ret.ignore = sm->ignore; in SM_STATE()
687 ret.methodState = sm->methodState; in SM_STATE()
688 ret.decision = sm->decision; in SM_STATE()
689 ret.allowNotifications = sm->allowNotifications; in SM_STATE()
690 wpabuf_free(sm->eapRespData); in SM_STATE()
691 sm->eapRespData = NULL; in SM_STATE()
692 sm->eapRespData = sm->m->process(sm, sm->eap_method_priv, &ret, in SM_STATE()
699 sm->eapRespData); in SM_STATE()
701 sm->ignore = ret.ignore; in SM_STATE()
702 if (sm->ignore) in SM_STATE()
704 sm->methodState = ret.methodState; in SM_STATE()
705 sm->decision = ret.decision; in SM_STATE()
706 sm->allowNotifications = ret.allowNotifications; in SM_STATE()
708 if (sm->m->isKeyAvailable && sm->m->getKey && in SM_STATE()
709 sm->m->isKeyAvailable(sm, sm->eap_method_priv)) { in SM_STATE()
710 struct eap_peer_config *config = eap_get_config(sm); in SM_STATE()
712 eap_sm_free_key(sm); in SM_STATE()
713 sm->eapKeyData = sm->m->getKey(sm, sm->eap_method_priv, in SM_STATE()
714 &sm->eapKeyDataLen); in SM_STATE()
715 os_free(sm->eapSessionId); in SM_STATE()
716 sm->eapSessionId = NULL; in SM_STATE()
717 if (sm->m->getSessionId) { in SM_STATE()
718 sm->eapSessionId = sm->m->getSessionId( in SM_STATE()
719 sm, sm->eap_method_priv, in SM_STATE()
720 &sm->eapSessionIdLen); in SM_STATE()
722 sm->eapSessionId, sm->eapSessionIdLen); in SM_STATE()
724 if (config->erp && sm->m->get_emsk && sm->eapSessionId) in SM_STATE()
725 eap_peer_erp_init(sm); in SM_STATE()
737 wpabuf_free(sm->lastRespData); in SM_STATE()
738 if (sm->eapRespData) { in SM_STATE()
739 if (sm->workaround) in SM_STATE()
740 os_memcpy(sm->last_sha1, sm->req_sha1, 20); in SM_STATE()
741 sm->lastId = sm->reqId; in SM_STATE()
742 sm->lastRespData = wpabuf_dup(sm->eapRespData); in SM_STATE()
743 eapol_set_bool(sm, EAPOL_eapResp, TRUE); in SM_STATE()
746 sm->lastRespData = NULL; in SM_STATE()
748 eapol_set_bool(sm, EAPOL_eapReq, FALSE); in SM_STATE()
749 eapol_set_int(sm, EAPOL_idleWhile, sm->ClientTimeout); in SM_STATE()
750 sm->reauthInit = FALSE; in SM_STATE()
761 eapol_set_bool(sm, EAPOL_eapReq, FALSE); in SM_STATE()
762 eapol_set_bool(sm, EAPOL_eapNoResp, TRUE); in SM_STATE()
774 eapReqData = eapol_get_eapReqData(sm); in SM_STATE()
777 eap_sm_processIdentity(sm, eapReqData); in SM_STATE()
778 wpabuf_free(sm->eapRespData); in SM_STATE()
779 sm->eapRespData = NULL; in SM_STATE()
780 sm->eapRespData = eap_sm_buildIdentity(sm, sm->reqId, 0); in SM_STATE()
792 eapReqData = eapol_get_eapReqData(sm); in SM_STATE()
795 eap_sm_processNotify(sm, eapReqData); in SM_STATE()
796 wpabuf_free(sm->eapRespData); in SM_STATE()
797 sm->eapRespData = NULL; in SM_STATE()
798 sm->eapRespData = eap_sm_buildNotify(sm->reqId); in SM_STATE()
808 wpabuf_free(sm->eapRespData); in SM_STATE()
809 if (sm->lastRespData) in SM_STATE()
810 sm->eapRespData = wpabuf_dup(sm->lastRespData); in SM_STATE()
812 sm->eapRespData = NULL; in SM_STATE()
824 if (sm->eapKeyData != NULL) in SM_STATE()
825 sm->eapKeyAvailable = TRUE; in SM_STATE()
826 eapol_set_bool(sm, EAPOL_eapSuccess, TRUE); in SM_STATE()
833 eapol_set_bool(sm, EAPOL_eapReq, FALSE); in SM_STATE()
841 eapol_set_bool(sm, EAPOL_eapNoResp, TRUE); in SM_STATE()
843 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_SUCCESS in SM_STATE()
855 eapol_set_bool(sm, EAPOL_eapFail, TRUE); in SM_STATE()
862 eapol_set_bool(sm, EAPOL_eapReq, FALSE); in SM_STATE()
869 eapol_set_bool(sm, EAPOL_eapNoResp, TRUE); in SM_STATE()
871 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_FAILURE in SM_STATE()
874 sm->prev_failure = 1; in SM_STATE()
878 static int eap_success_workaround(struct eap_sm *sm, int reqId, int lastId) in eap_success_workaround() argument
890 if (sm->workaround && (reqId == ((lastId + 1) & 0xff) || in eap_success_workaround()
908 static void eap_peer_sm_step_idle(struct eap_sm *sm) in eap_peer_sm_step_idle() argument
915 if (eapol_get_bool(sm, EAPOL_eapReq)) in eap_peer_sm_step_idle()
917 else if ((eapol_get_bool(sm, EAPOL_altAccept) && in eap_peer_sm_step_idle()
918 sm->decision != DECISION_FAIL) || in eap_peer_sm_step_idle()
919 (eapol_get_int(sm, EAPOL_idleWhile) == 0 && in eap_peer_sm_step_idle()
920 sm->decision == DECISION_UNCOND_SUCC)) in eap_peer_sm_step_idle()
922 else if (eapol_get_bool(sm, EAPOL_altReject) || in eap_peer_sm_step_idle()
923 (eapol_get_int(sm, EAPOL_idleWhile) == 0 && in eap_peer_sm_step_idle()
924 sm->decision != DECISION_UNCOND_SUCC) || in eap_peer_sm_step_idle()
925 (eapol_get_bool(sm, EAPOL_altAccept) && in eap_peer_sm_step_idle()
926 sm->methodState != METHOD_CONT && in eap_peer_sm_step_idle()
927 sm->decision == DECISION_FAIL)) in eap_peer_sm_step_idle()
929 else if (sm->selectedMethod == EAP_TYPE_LEAP && in eap_peer_sm_step_idle()
930 sm->leap_done && sm->decision != DECISION_FAIL && in eap_peer_sm_step_idle()
931 sm->methodState == METHOD_DONE) in eap_peer_sm_step_idle()
933 else if (sm->selectedMethod == EAP_TYPE_PEAP && in eap_peer_sm_step_idle()
934 sm->peap_done && sm->decision != DECISION_FAIL && in eap_peer_sm_step_idle()
935 sm->methodState == METHOD_DONE) in eap_peer_sm_step_idle()
940 static int eap_peer_req_is_duplicate(struct eap_sm *sm) in eap_peer_req_is_duplicate() argument
944 duplicate = (sm->reqId == sm->lastId) && sm->rxReq; in eap_peer_req_is_duplicate()
945 if (sm->workaround && duplicate && in eap_peer_req_is_duplicate()
946 os_memcmp(sm->req_sha1, sm->last_sha1, 20) != 0) { in eap_peer_req_is_duplicate()
966 static int eap_peer_sm_allow_canned(struct eap_sm *sm) in eap_peer_sm_allow_canned() argument
968 struct eap_peer_config *config = eap_get_config(sm); in eap_peer_sm_allow_canned()
975 static void eap_peer_sm_step_received(struct eap_sm *sm) in eap_peer_sm_step_received() argument
977 int duplicate = eap_peer_req_is_duplicate(sm); in eap_peer_sm_step_received()
984 if (sm->rxSuccess && sm->decision != DECISION_FAIL && in eap_peer_sm_step_received()
985 (sm->reqId == sm->lastId || in eap_peer_sm_step_received()
986 eap_success_workaround(sm, sm->reqId, sm->lastId))) in eap_peer_sm_step_received()
988 else if (sm->workaround && sm->lastId == -1 && sm->rxSuccess && in eap_peer_sm_step_received()
989 !sm->rxFailure && !sm->rxReq && eap_peer_sm_allow_canned(sm)) in eap_peer_sm_step_received()
991 else if (sm->workaround && sm->lastId == -1 && sm->rxFailure && in eap_peer_sm_step_received()
992 !sm->rxReq && sm->methodState != METHOD_CONT && in eap_peer_sm_step_received()
993 eap_peer_sm_allow_canned(sm)) in eap_peer_sm_step_received()
995 else if (sm->workaround && sm->rxSuccess && !sm->rxFailure && in eap_peer_sm_step_received()
996 !sm->rxReq && sm->methodState != METHOD_CONT && in eap_peer_sm_step_received()
997 eap_peer_sm_allow_canned(sm)) in eap_peer_sm_step_received()
999 else if (sm->methodState != METHOD_CONT && in eap_peer_sm_step_received()
1000 ((sm->rxFailure && in eap_peer_sm_step_received()
1001 sm->decision != DECISION_UNCOND_SUCC) || in eap_peer_sm_step_received()
1002 (sm->rxSuccess && sm->decision == DECISION_FAIL && in eap_peer_sm_step_received()
1003 (sm->selectedMethod != EAP_TYPE_LEAP || in eap_peer_sm_step_received()
1004 sm->methodState != METHOD_MAY_CONT))) && in eap_peer_sm_step_received()
1005 (sm->reqId == sm->lastId || in eap_peer_sm_step_received()
1006 eap_success_workaround(sm, sm->reqId, sm->lastId))) in eap_peer_sm_step_received()
1008 else if (sm->rxReq && duplicate) in eap_peer_sm_step_received()
1010 else if (sm->rxReq && !duplicate && in eap_peer_sm_step_received()
1011 sm->reqMethod == EAP_TYPE_NOTIFICATION && in eap_peer_sm_step_received()
1012 sm->allowNotifications) in eap_peer_sm_step_received()
1014 else if (sm->rxReq && !duplicate && in eap_peer_sm_step_received()
1015 sm->selectedMethod == EAP_TYPE_NONE && in eap_peer_sm_step_received()
1016 sm->reqMethod == EAP_TYPE_IDENTITY) in eap_peer_sm_step_received()
1018 else if (sm->rxReq && !duplicate && in eap_peer_sm_step_received()
1019 sm->selectedMethod == EAP_TYPE_NONE && in eap_peer_sm_step_received()
1020 sm->reqMethod != EAP_TYPE_IDENTITY && in eap_peer_sm_step_received()
1021 sm->reqMethod != EAP_TYPE_NOTIFICATION) in eap_peer_sm_step_received()
1023 else if (sm->rxReq && !duplicate && in eap_peer_sm_step_received()
1024 sm->reqMethod == sm->selectedMethod && in eap_peer_sm_step_received()
1025 sm->methodState != METHOD_DONE) in eap_peer_sm_step_received()
1027 else if (sm->selectedMethod == EAP_TYPE_LEAP && in eap_peer_sm_step_received()
1028 (sm->rxSuccess || sm->rxResp)) in eap_peer_sm_step_received()
1030 else if (sm->reauthInit) in eap_peer_sm_step_received()
1037 static void eap_peer_sm_step_local(struct eap_sm *sm) in eap_peer_sm_step_local() argument
1039 switch (sm->EAP_state) { in eap_peer_sm_step_local()
1044 if (eapol_get_bool(sm, EAPOL_portEnabled) && in eap_peer_sm_step_local()
1045 !sm->force_disabled) in eap_peer_sm_step_local()
1049 eap_peer_sm_step_idle(sm); in eap_peer_sm_step_local()
1052 eap_peer_sm_step_received(sm); in eap_peer_sm_step_local()
1055 if (sm->selectedMethod == sm->reqMethod) in eap_peer_sm_step_local()
1069 if (sm->ignore) in eap_peer_sm_step_local()
1071 else if (sm->methodState == METHOD_DONE && in eap_peer_sm_step_local()
1072 sm->decision == DECISION_FAIL && !sm->eapRespData) in eap_peer_sm_step_local()
1103 if (eapol_get_bool(sm, EAPOL_eapRestart) && in SM_STEP()
1104 eapol_get_bool(sm, EAPOL_portEnabled)) in SM_STEP()
1106 else if (!eapol_get_bool(sm, EAPOL_portEnabled) || sm->force_disabled) in SM_STEP()
1108 else if (sm->num_rounds > EAP_MAX_AUTH_ROUNDS) { in SM_STEP()
1117 if (sm->num_rounds == EAP_MAX_AUTH_ROUNDS + 1) { in SM_STEP()
1118 wpa_msg(sm->msg_ctx, MSG_INFO, "EAP: more than %d " in SM_STEP()
1121 sm->num_rounds++; in SM_STEP()
1126 eap_peer_sm_step_local(sm); in SM_STEP()
1131 static Boolean eap_sm_allowMethod(struct eap_sm *sm, int vendor, in eap_sm_allowMethod() argument
1134 if (!eap_allowed_method(sm, vendor, method)) { in eap_sm_allowMethod()
1148 struct eap_sm *sm, int id, const struct eap_method *methods, in eap_sm_build_expanded_nak() argument
1167 if (sm->reqVendor == m->vendor && in eap_sm_build_expanded_nak()
1168 sm->reqVendorMethod == m->method) in eap_sm_build_expanded_nak()
1170 if (eap_allowed_method(sm, m->vendor, m->method)) { in eap_sm_build_expanded_nak()
1194 static struct wpabuf * eap_sm_buildNak(struct eap_sm *sm, int id) in eap_sm_buildNak() argument
1203 "vendor=%u method=%u not allowed)", sm->reqMethod, in eap_sm_buildNak()
1204 sm->reqVendor, sm->reqVendorMethod); in eap_sm_buildNak()
1208 if (sm->reqMethod == EAP_TYPE_EXPANDED) in eap_sm_buildNak()
1209 return eap_sm_build_expanded_nak(sm, id, methods, count); in eap_sm_buildNak()
1220 if (m->vendor == EAP_VENDOR_IETF && m->method == sm->reqMethod) in eap_sm_buildNak()
1222 if (eap_allowed_method(sm, m->vendor, m->method)) { in eap_sm_buildNak()
1243 static void eap_sm_processIdentity(struct eap_sm *sm, const struct wpabuf *req) in eap_sm_processIdentity() argument
1248 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_STARTED in eap_sm_processIdentity()
1250 eap_notify_status(sm, "started", ""); in eap_sm_processIdentity()
1295 static int eap_sm_append_3gpp_realm(struct eap_sm *sm, char *imsi, in eap_sm_append_3gpp_realm() argument
1307 mnc_len = scard_get_mnc_len(sm->scard_ctx); in eap_sm_append_3gpp_realm()
1337 static int eap_sm_imsi_identity(struct eap_sm *sm, in eap_sm_imsi_identity() argument
1347 if (scard_get_imsi(sm->scard_ctx, imsi, &imsi_len)) { in eap_sm_imsi_identity()
1359 if (eap_sm_append_3gpp_realm(sm, imsi, sizeof(imsi), &imsi_len) < 0) { in eap_sm_imsi_identity()
1406 static int eap_sm_set_scard_pin(struct eap_sm *sm, in eap_sm_set_scard_pin() argument
1409 if (scard_set_pin(sm->scard_ctx, conf->pin)) { in eap_sm_set_scard_pin()
1418 eap_sm_request_pin(sm); in eap_sm_set_scard_pin()
1425 static int eap_sm_get_scard_identity(struct eap_sm *sm, in eap_sm_get_scard_identity() argument
1428 if (eap_sm_set_scard_pin(sm, conf)) in eap_sm_get_scard_identity()
1431 return eap_sm_imsi_identity(sm, conf); in eap_sm_get_scard_identity()
1448 struct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted) in eap_sm_buildIdentity() argument
1450 struct eap_peer_config *config = eap_get_config(sm); in eap_sm_buildIdentity()
1461 if (sm->m && sm->m->get_identity && in eap_sm_buildIdentity()
1462 (identity = sm->m->get_identity(sm, sm->eap_method_priv, in eap_sm_buildIdentity()
1481 if (eap_sm_get_scard_identity(sm, config) < 0) in eap_sm_buildIdentity()
1488 } else if (eap_sm_set_scard_pin(sm, config) < 0) { in eap_sm_buildIdentity()
1497 eap_sm_request_identity(sm); in eap_sm_buildIdentity()
1512 static void eap_sm_processNotify(struct eap_sm *sm, const struct wpabuf *req) in eap_sm_processNotify() argument
1531 wpa_msg(sm->msg_ctx, MSG_INFO, "%s%s", in eap_sm_processNotify()
1545 static void eap_peer_initiate(struct eap_sm *sm, const struct eap_hdr *hdr, in eap_peer_initiate() argument
1585 if (eap_peer_erp_reauth_start(sm, hdr->identifier) == 0) in eap_peer_initiate()
1592 eapol_set_bool(sm, EAPOL_eapTriggerStart, TRUE); in eap_peer_initiate()
1596 void eap_peer_finish(struct eap_sm *sm, const struct eap_hdr *hdr, size_t len) in eap_peer_finish() argument
1636 if (seq != sm->erp_seq) { in eap_peer_finish()
1667 erp = eap_erp_get_key_nai(sm, nai); in eap_peer_finish()
1716 eapol_set_bool(sm, EAPOL_eapFail, TRUE); in eap_peer_finish()
1717 eapol_set_bool(sm, EAPOL_eapReq, FALSE); in eap_peer_finish()
1718 eapol_set_bool(sm, EAPOL_eapNoResp, TRUE); in eap_peer_finish()
1719 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_FAILURE in eap_peer_finish()
1721 sm->prev_failure = 1; in eap_peer_finish()
1728 eap_sm_free_key(sm); in eap_peer_finish()
1729 sm->eapKeyDataLen = 0; in eap_peer_finish()
1730 sm->eapKeyData = os_malloc(erp->rRK_len); in eap_peer_finish()
1731 if (!sm->eapKeyData) in eap_peer_finish()
1733 sm->eapKeyDataLen = erp->rRK_len; in eap_peer_finish()
1740 sm->eapKeyData, erp->rRK_len) < 0) { in eap_peer_finish()
1742 eap_sm_free_key(sm); in eap_peer_finish()
1746 sm->eapKeyData, sm->eapKeyDataLen); in eap_peer_finish()
1747 sm->eapKeyAvailable = TRUE; in eap_peer_finish()
1748 eapol_set_bool(sm, EAPOL_eapSuccess, TRUE); in eap_peer_finish()
1749 eapol_set_bool(sm, EAPOL_eapReq, FALSE); in eap_peer_finish()
1750 eapol_set_bool(sm, EAPOL_eapNoResp, TRUE); in eap_peer_finish()
1751 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_SUCCESS in eap_peer_finish()
1757 static void eap_sm_parseEapReq(struct eap_sm *sm, const struct wpabuf *req) in eap_sm_parseEapReq() argument
1763 sm->rxReq = sm->rxResp = sm->rxSuccess = sm->rxFailure = FALSE; in eap_sm_parseEapReq()
1764 sm->reqId = 0; in eap_sm_parseEapReq()
1765 sm->reqMethod = EAP_TYPE_NONE; in eap_sm_parseEapReq()
1766 sm->reqVendor = EAP_VENDOR_IETF; in eap_sm_parseEapReq()
1767 sm->reqVendorMethod = EAP_TYPE_NONE; in eap_sm_parseEapReq()
1782 sm->reqId = hdr->identifier; in eap_sm_parseEapReq()
1784 if (sm->workaround) { in eap_sm_parseEapReq()
1787 sha1_vector(1, addr, &plen, sm->req_sha1); in eap_sm_parseEapReq()
1797 sm->rxReq = TRUE; in eap_sm_parseEapReq()
1799 sm->reqMethod = *pos++; in eap_sm_parseEapReq()
1800 if (sm->reqMethod == EAP_TYPE_EXPANDED) { in eap_sm_parseEapReq()
1807 sm->reqVendor = WPA_GET_BE24(pos); in eap_sm_parseEapReq()
1809 sm->reqVendorMethod = WPA_GET_BE32(pos); in eap_sm_parseEapReq()
1813 sm->reqId, sm->reqMethod, sm->reqVendor, in eap_sm_parseEapReq()
1814 sm->reqVendorMethod); in eap_sm_parseEapReq()
1817 if (sm->selectedMethod == EAP_TYPE_LEAP) { in eap_sm_parseEapReq()
1828 sm->rxResp = TRUE; in eap_sm_parseEapReq()
1830 sm->reqMethod = *pos; in eap_sm_parseEapReq()
1833 sm->reqMethod, sm->reqId); in eap_sm_parseEapReq()
1840 eap_notify_status(sm, "completion", "success"); in eap_sm_parseEapReq()
1841 sm->rxSuccess = TRUE; in eap_sm_parseEapReq()
1845 eap_notify_status(sm, "completion", "failure"); in eap_sm_parseEapReq()
1846 sm->rxFailure = TRUE; in eap_sm_parseEapReq()
1849 eap_peer_initiate(sm, hdr, plen); in eap_sm_parseEapReq()
1852 eap_peer_finish(sm, hdr, plen); in eap_sm_parseEapReq()
1865 struct eap_sm *sm = ctx; in eap_peer_sm_tls_event() local
1870 eap_notify_status(sm, "remote certificate verification", in eap_peer_sm_tls_event()
1872 if (sm->ext_cert_check) { in eap_peer_sm_tls_event()
1873 sm->waiting_ext_cert_check = 1; in eap_peer_sm_tls_event()
1874 eap_sm_request(sm, WPA_CTRL_REQ_EXT_CERT_CHECK, in eap_peer_sm_tls_event()
1879 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_TLS_CERT_ERROR in eap_peer_sm_tls_event()
1885 eap_notify_status(sm, "remote certificate verification", in eap_peer_sm_tls_event()
1889 if (!sm->eapol_cb->notify_cert) in eap_peer_sm_tls_event()
1902 sm->eapol_cb->notify_cert(sm->eapol_ctx, in eap_peer_sm_tls_event()
1911 eap_notify_status(sm, "local TLS alert", in eap_peer_sm_tls_event()
1914 eap_notify_status(sm, "remote TLS alert", in eap_peer_sm_tls_event()
1941 struct eap_sm *sm; in eap_peer_sm_init() local
1944 sm = os_zalloc(sizeof(*sm)); in eap_peer_sm_init()
1945 if (sm == NULL) in eap_peer_sm_init()
1947 sm->eapol_ctx = eapol_ctx; in eap_peer_sm_init()
1948 sm->eapol_cb = eapol_cb; in eap_peer_sm_init()
1949 sm->msg_ctx = msg_ctx; in eap_peer_sm_init()
1950 sm->ClientTimeout = EAP_CLIENT_TIMEOUT_DEFAULT; in eap_peer_sm_init()
1951 sm->wps = conf->wps; in eap_peer_sm_init()
1952 dl_list_init(&sm->erp_keys); in eap_peer_sm_init()
1963 tlsconf.cb_ctx = sm; in eap_peer_sm_init()
1965 sm->ssl_ctx = tls_init(&tlsconf); in eap_peer_sm_init()
1966 if (sm->ssl_ctx == NULL) { in eap_peer_sm_init()
1969 os_free(sm); in eap_peer_sm_init()
1973 sm->ssl_ctx2 = tls_init(&tlsconf); in eap_peer_sm_init()
1974 if (sm->ssl_ctx2 == NULL) { in eap_peer_sm_init()
1980 return sm; in eap_peer_sm_init()
1991 void eap_peer_sm_deinit(struct eap_sm *sm) in eap_peer_sm_deinit() argument
1993 if (sm == NULL) in eap_peer_sm_deinit()
1995 eap_deinit_prev_method(sm, "EAP deinit"); in eap_peer_sm_deinit()
1996 eap_sm_abort(sm); in eap_peer_sm_deinit()
1997 if (sm->ssl_ctx2) in eap_peer_sm_deinit()
1998 tls_deinit(sm->ssl_ctx2); in eap_peer_sm_deinit()
1999 tls_deinit(sm->ssl_ctx); in eap_peer_sm_deinit()
2000 eap_peer_erp_free_keys(sm); in eap_peer_sm_deinit()
2001 os_free(sm); in eap_peer_sm_deinit()
2014 int eap_peer_sm_step(struct eap_sm *sm) in eap_peer_sm_step() argument
2018 sm->changed = FALSE; in eap_peer_sm_step()
2020 if (sm->changed) in eap_peer_sm_step()
2022 } while (sm->changed); in eap_peer_sm_step()
2034 void eap_sm_abort(struct eap_sm *sm) in eap_sm_abort() argument
2036 wpabuf_free(sm->lastRespData); in eap_sm_abort()
2037 sm->lastRespData = NULL; in eap_sm_abort()
2038 wpabuf_free(sm->eapRespData); in eap_sm_abort()
2039 sm->eapRespData = NULL; in eap_sm_abort()
2040 eap_sm_free_key(sm); in eap_sm_abort()
2041 os_free(sm->eapSessionId); in eap_sm_abort()
2042 sm->eapSessionId = NULL; in eap_sm_abort()
2047 eapol_set_bool(sm, EAPOL_eapSuccess, FALSE); in eap_sm_abort()
2139 int eap_sm_get_status(struct eap_sm *sm, char *buf, size_t buflen, int verbose) in eap_sm_get_status() argument
2143 if (sm == NULL) in eap_sm_get_status()
2148 eap_sm_state_txt(sm->EAP_state)); in eap_sm_get_status()
2152 if (sm->selectedMethod != EAP_TYPE_NONE) { in eap_sm_get_status()
2154 if (sm->m) { in eap_sm_get_status()
2155 name = sm->m->name; in eap_sm_get_status()
2159 sm->selectedMethod); in eap_sm_get_status()
2167 sm->selectedMethod, name); in eap_sm_get_status()
2172 if (sm->m && sm->m->get_status) { in eap_sm_get_status()
2173 len += sm->m->get_status(sm, sm->eap_method_priv, in eap_sm_get_status()
2185 sm->reqMethod, in eap_sm_get_status()
2186 eap_sm_method_state_txt(sm->methodState), in eap_sm_get_status()
2187 eap_sm_decision_txt(sm->decision), in eap_sm_get_status()
2188 sm->ClientTimeout); in eap_sm_get_status()
2199 static void eap_sm_request(struct eap_sm *sm, enum wpa_ctrl_req_type field, in eap_sm_request() argument
2207 if (sm == NULL) in eap_sm_request()
2209 config = eap_get_config(sm); in eap_sm_request()
2258 if (sm->eapol_cb->eap_param_needed) in eap_sm_request()
2259 sm->eapol_cb->eap_param_needed(sm->eapol_ctx, field, txt); in eap_sm_request()
2264 const char * eap_sm_get_method_name(struct eap_sm *sm) in eap_sm_get_method_name() argument
2266 if (sm->m == NULL) in eap_sm_get_method_name()
2268 return sm->m->name; in eap_sm_get_method_name()
2281 void eap_sm_request_identity(struct eap_sm *sm) in eap_sm_request_identity() argument
2283 eap_sm_request(sm, WPA_CTRL_REQ_EAP_IDENTITY, NULL, 0); in eap_sm_request_identity()
2296 void eap_sm_request_password(struct eap_sm *sm) in eap_sm_request_password() argument
2298 eap_sm_request(sm, WPA_CTRL_REQ_EAP_PASSWORD, NULL, 0); in eap_sm_request_password()
2311 void eap_sm_request_new_password(struct eap_sm *sm) in eap_sm_request_new_password() argument
2313 eap_sm_request(sm, WPA_CTRL_REQ_EAP_NEW_PASSWORD, NULL, 0); in eap_sm_request_new_password()
2326 void eap_sm_request_pin(struct eap_sm *sm) in eap_sm_request_pin() argument
2328 eap_sm_request(sm, WPA_CTRL_REQ_EAP_PIN, NULL, 0); in eap_sm_request_pin()
2342 void eap_sm_request_otp(struct eap_sm *sm, const char *msg, size_t msg_len) in eap_sm_request_otp() argument
2344 eap_sm_request(sm, WPA_CTRL_REQ_EAP_OTP, msg, msg_len); in eap_sm_request_otp()
2357 void eap_sm_request_passphrase(struct eap_sm *sm) in eap_sm_request_passphrase() argument
2359 eap_sm_request(sm, WPA_CTRL_REQ_EAP_PASSPHRASE, NULL, 0); in eap_sm_request_passphrase()
2368 void eap_sm_request_sim(struct eap_sm *sm, const char *req) in eap_sm_request_sim() argument
2370 eap_sm_request(sm, WPA_CTRL_REQ_SIM, req, os_strlen(req)); in eap_sm_request_sim()
2381 void eap_sm_notify_ctrl_attached(struct eap_sm *sm) in eap_sm_notify_ctrl_attached() argument
2383 struct eap_peer_config *config = eap_get_config(sm); in eap_sm_notify_ctrl_attached()
2393 eap_sm_request_identity(sm); in eap_sm_notify_ctrl_attached()
2395 eap_sm_request_password(sm); in eap_sm_notify_ctrl_attached()
2397 eap_sm_request_new_password(sm); in eap_sm_notify_ctrl_attached()
2399 eap_sm_request_otp(sm, NULL, 0); in eap_sm_notify_ctrl_attached()
2401 eap_sm_request_pin(sm); in eap_sm_notify_ctrl_attached()
2403 eap_sm_request_passphrase(sm); in eap_sm_notify_ctrl_attached()
2488 void eap_set_fast_reauth(struct eap_sm *sm, int enabled) in eap_set_fast_reauth() argument
2490 sm->fast_reauth = enabled; in eap_set_fast_reauth()
2499 void eap_set_workaround(struct eap_sm *sm, unsigned int workaround) in eap_set_workaround() argument
2501 sm->workaround = workaround; in eap_set_workaround()
2515 struct eap_peer_config * eap_get_config(struct eap_sm *sm) in eap_get_config() argument
2517 return sm->eapol_cb->get_config(sm->eapol_ctx); in eap_get_config()
2527 const u8 * eap_get_config_identity(struct eap_sm *sm, size_t *len) in eap_get_config_identity() argument
2529 struct eap_peer_config *config = eap_get_config(sm); in eap_get_config_identity()
2537 static int eap_get_ext_password(struct eap_sm *sm, in eap_get_ext_password() argument
2550 ext_password_free(sm->ext_pw_buf); in eap_get_ext_password()
2551 sm->ext_pw_buf = ext_password_get(sm->ext_pw, name); in eap_get_ext_password()
2554 return sm->ext_pw_buf == NULL ? -1 : 0; in eap_get_ext_password()
2564 const u8 * eap_get_config_password(struct eap_sm *sm, size_t *len) in eap_get_config_password() argument
2566 struct eap_peer_config *config = eap_get_config(sm); in eap_get_config_password()
2571 if (eap_get_ext_password(sm, config) < 0) in eap_get_config_password()
2573 *len = wpabuf_len(sm->ext_pw_buf); in eap_get_config_password()
2574 return wpabuf_head(sm->ext_pw_buf); in eap_get_config_password()
2591 const u8 * eap_get_config_password2(struct eap_sm *sm, size_t *len, int *hash) in eap_get_config_password2() argument
2593 struct eap_peer_config *config = eap_get_config(sm); in eap_get_config_password2()
2598 if (eap_get_ext_password(sm, config) < 0) in eap_get_config_password2()
2602 *len = wpabuf_len(sm->ext_pw_buf); in eap_get_config_password2()
2603 return wpabuf_head(sm->ext_pw_buf); in eap_get_config_password2()
2619 const u8 * eap_get_config_new_password(struct eap_sm *sm, size_t *len) in eap_get_config_new_password() argument
2621 struct eap_peer_config *config = eap_get_config(sm); in eap_get_config_new_password()
2635 const u8 * eap_get_config_otp(struct eap_sm *sm, size_t *len) in eap_get_config_otp() argument
2637 struct eap_peer_config *config = eap_get_config(sm); in eap_get_config_otp()
2653 void eap_clear_config_otp(struct eap_sm *sm) in eap_clear_config_otp() argument
2655 struct eap_peer_config *config = eap_get_config(sm); in eap_clear_config_otp()
2670 const char * eap_get_config_phase1(struct eap_sm *sm) in eap_get_config_phase1() argument
2672 struct eap_peer_config *config = eap_get_config(sm); in eap_get_config_phase1()
2684 const char * eap_get_config_phase2(struct eap_sm *sm) in eap_get_config_phase2() argument
2686 struct eap_peer_config *config = eap_get_config(sm); in eap_get_config_phase2()
2693 int eap_get_config_fragment_size(struct eap_sm *sm) in eap_get_config_fragment_size() argument
2695 struct eap_peer_config *config = eap_get_config(sm); in eap_get_config_fragment_size()
2707 int eap_key_available(struct eap_sm *sm) in eap_key_available() argument
2709 return sm ? sm->eapKeyAvailable : 0; in eap_key_available()
2722 void eap_notify_success(struct eap_sm *sm) in eap_notify_success() argument
2724 if (sm) { in eap_notify_success()
2725 sm->decision = DECISION_COND_SUCC; in eap_notify_success()
2726 sm->EAP_state = EAP_SUCCESS; in eap_notify_success()
2738 void eap_notify_lower_layer_success(struct eap_sm *sm) in eap_notify_lower_layer_success() argument
2740 if (sm == NULL) in eap_notify_lower_layer_success()
2743 if (eapol_get_bool(sm, EAPOL_eapSuccess) || in eap_notify_lower_layer_success()
2744 sm->decision == DECISION_FAIL || in eap_notify_lower_layer_success()
2745 (sm->methodState != METHOD_MAY_CONT && in eap_notify_lower_layer_success()
2746 sm->methodState != METHOD_DONE)) in eap_notify_lower_layer_success()
2749 if (sm->eapKeyData != NULL) in eap_notify_lower_layer_success()
2750 sm->eapKeyAvailable = TRUE; in eap_notify_lower_layer_success()
2751 eapol_set_bool(sm, EAPOL_eapSuccess, TRUE); in eap_notify_lower_layer_success()
2752 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_SUCCESS in eap_notify_lower_layer_success()
2768 const u8 * eap_get_eapSessionId(struct eap_sm *sm, size_t *len) in eap_get_eapSessionId() argument
2770 if (sm == NULL || sm->eapSessionId == NULL) { in eap_get_eapSessionId()
2775 *len = sm->eapSessionIdLen; in eap_get_eapSessionId()
2776 return sm->eapSessionId; in eap_get_eapSessionId()
2791 const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len) in eap_get_eapKeyData() argument
2793 if (sm == NULL || sm->eapKeyData == NULL) { in eap_get_eapKeyData()
2798 *len = sm->eapKeyDataLen; in eap_get_eapKeyData()
2799 return sm->eapKeyData; in eap_get_eapKeyData()
2813 struct wpabuf * eap_get_eapRespData(struct eap_sm *sm) in eap_get_eapRespData() argument
2817 if (sm == NULL || sm->eapRespData == NULL) in eap_get_eapRespData()
2820 resp = sm->eapRespData; in eap_get_eapRespData()
2821 sm->eapRespData = NULL; in eap_get_eapRespData()
2835 void eap_register_scard_ctx(struct eap_sm *sm, void *ctx) in eap_register_scard_ctx() argument
2837 if (sm) in eap_register_scard_ctx()
2838 sm->scard_ctx = ctx; in eap_register_scard_ctx()
2850 void eap_set_config_blob(struct eap_sm *sm, struct wpa_config_blob *blob) in eap_set_config_blob() argument
2853 sm->eapol_cb->set_config_blob(sm->eapol_ctx, blob); in eap_set_config_blob()
2864 const struct wpa_config_blob * eap_get_config_blob(struct eap_sm *sm, in eap_get_config_blob() argument
2868 return sm->eapol_cb->get_config_blob(sm->eapol_ctx, name); in eap_get_config_blob()
2883 void eap_set_force_disabled(struct eap_sm *sm, int disabled) in eap_set_force_disabled() argument
2885 sm->force_disabled = disabled; in eap_set_force_disabled()
2894 void eap_set_external_sim(struct eap_sm *sm, int external_sim) in eap_set_external_sim() argument
2896 sm->external_sim = external_sim; in eap_set_external_sim()
2909 void eap_notify_pending(struct eap_sm *sm) in eap_notify_pending() argument
2911 sm->eapol_cb->notify_pending(sm->eapol_ctx); in eap_notify_pending()
2919 void eap_invalidate_cached_session(struct eap_sm *sm) in eap_invalidate_cached_session() argument
2921 if (sm) in eap_invalidate_cached_session()
2922 eap_deinit_prev_method(sm, "invalidate"); in eap_invalidate_cached_session()
2952 void eap_sm_set_ext_pw_ctx(struct eap_sm *sm, struct ext_password_data *ext) in eap_sm_set_ext_pw_ctx() argument
2954 ext_password_free(sm->ext_pw_buf); in eap_sm_set_ext_pw_ctx()
2955 sm->ext_pw_buf = NULL; in eap_sm_set_ext_pw_ctx()
2956 sm->ext_pw = ext; in eap_sm_set_ext_pw_ctx()
2966 void eap_set_anon_id(struct eap_sm *sm, const u8 *id, size_t len) in eap_set_anon_id() argument
2968 if (sm->eapol_cb->set_anon_id) in eap_set_anon_id()
2969 sm->eapol_cb->set_anon_id(sm->eapol_ctx, id, len); in eap_set_anon_id()
2973 int eap_peer_was_failure_expected(struct eap_sm *sm) in eap_peer_was_failure_expected() argument
2975 return sm->expected_failure; in eap_peer_was_failure_expected()