Home | History | Annotate | Download | only in eap_peer

Lines Matching refs:sm

42 static Boolean eap_sm_allowMethod(struct eap_sm *sm, int vendor,
44 static struct wpabuf * eap_sm_buildNak(struct eap_sm *sm, int id);
45 static void eap_sm_processIdentity(struct eap_sm *sm,
47 static void eap_sm_processNotify(struct eap_sm *sm, const struct wpabuf *req);
49 static void eap_sm_parseEapReq(struct eap_sm *sm, const struct wpabuf *req);
57 static Boolean eapol_get_bool(struct eap_sm *sm, enum eapol_bool_var var)
59 return sm->eapol_cb->get_bool(sm->eapol_ctx, var);
63 static void eapol_set_bool(struct eap_sm *sm, enum eapol_bool_var var,
66 sm->eapol_cb->set_bool(sm->eapol_ctx, var, value);
70 static unsigned int eapol_get_int(struct eap_sm *sm, enum eapol_int_var var)
72 return sm->eapol_cb->get_int(sm->eapol_ctx, var);
76 static void eapol_set_int(struct eap_sm *sm, enum eapol_int_var var,
79 sm->eapol_cb->set_int(sm->eapol_ctx, var, value);
83 static struct wpabuf * eapol_get_eapReqData(struct eap_sm *sm)
85 return sm->eapol_cb->get_eapReqData(sm->eapol_ctx);
89 static void eap_deinit_prev_method(struct eap_sm *sm, const char *txt)
91 if (sm->m == NULL || sm->eap_method_priv == NULL)
95 "(%d, %s) at %s", sm->selectedMethod, sm->m->name, txt);
96 sm->m->deinit(sm, sm->eap_method_priv);
97 sm->eap_method_priv = NULL;
98 sm->m = NULL;
104 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
109 int eap_allowed_method(struct eap_sm *sm, int vendor, u32 method)
111 struct eap_peer_config *config = eap_get_config(sm);
136 if (sm->fast_reauth && sm->m && sm->m->has_reauth_data &&
137 sm->m->has_reauth_data(sm, sm->eap_method_priv) &&
138 !sm->prev_failure) {
141 sm->m->deinit_for_reauth(sm, sm->eap_method_priv);
143 eap_deinit_prev_method(sm, "INITIALIZE");
145 sm->selectedMethod = EAP_TYPE_NONE;
146 sm->methodState = METHOD_NONE;
147 sm->allowNotifications = TRUE;
148 sm->decision = DECISION_FAIL;
149 eapol_set_int(sm, EAPOL_idleWhile, sm->ClientTimeout);
150 eapol_set_bool(sm, EAPOL_eapSuccess, FALSE);
151 eapol_set_bool(sm, EAPOL_eapFail, FALSE);
152 os_free(sm->eapKeyData);
153 sm->eapKeyData = NULL;
154 sm->eapKeyAvailable = FALSE;
155 eapol_set_bool(sm, EAPOL_eapRestart, FALSE);
156 sm->lastId = -1; /* new session - make sure this does not match with
166 eapol_set_bool(sm, EAPOL_eapResp, FALSE);
167 eapol_set_bool(sm, EAPOL_eapNoResp, FALSE);
168 sm->num_rounds = 0;
169 sm->prev_failure = 0;
181 sm->num_rounds = 0;
205 eapReqData = eapol_get_eapReqData(sm);
207 eap_sm_parseEapReq(sm, eapReqData);
208 sm->num_rounds++;
223 if (sm->reqMethod == EAP_TYPE_EXPANDED)
224 method = sm->reqVendorMethod;
226 method = sm->reqMethod;
228 if (!eap_sm_allowMethod(sm, sm->reqVendor, method)) {
230 sm->reqVendor, method);
242 if (sm->fast_reauth &&
243 sm->m && sm->m->vendor == sm->reqVendor &&
244 sm->m->method == method &&
245 sm->m->has_reauth_data &&
246 sm->m->has_reauth_data(sm, sm->eap_method_priv)) {
251 eap_deinit_prev_method(sm, "GET_METHOD");
255 sm->selectedMethod = sm->reqMethod;
256 if (sm->m == NULL)
257 sm->m = eap_peer_get_eap_method(sm->reqVendor, method);
258 if (!sm->m) {
261 sm->reqVendor, method);
267 sm->reqVendor, method, sm->m->name);
269 sm->eap_method_priv = sm->m->init_for_reauth(
270 sm, sm->eap_method_priv);
272 sm->eap_method_priv = sm->m->init(sm);
274 if (sm->eap_method_priv == NULL) {
275 struct eap_peer_config *config = eap_get_config(sm);
276 wpa_msg(sm->msg_ctx, MSG_INFO,
279 sm->reqVendor, method, sm->m->name);
280 sm->m = NULL;
281 sm->methodState = METHOD_NONE;
282 sm->selectedMethod = EAP_TYPE_NONE;
283 if (sm->reqMethod == EAP_TYPE_TLS && config &&
299 sm->methodState = METHOD_INIT;
300 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_METHOD
302 sm->reqVendor, method, sm->m->name);
306 wpabuf_free(sm->eapRespData);
307 sm->eapRespData = NULL;
308 sm->eapRespData = eap_sm_buildNak(sm, sm->reqId);
322 if (sm->m == NULL) {
327 eapReqData = eapol_get_eapReqData(sm);
344 ret.ignore = sm->ignore;
345 ret.methodState = sm->methodState;
346 ret.decision = sm->decision;
347 ret.allowNotifications = sm->allowNotifications;
348 wpabuf_free(sm->eapRespData);
349 sm->eapRespData = NULL;
350 sm->eapRespData = sm->m->process(sm, sm->eap_method_priv, &ret,
358 sm->ignore = ret.ignore;
359 if (sm->ignore)
361 sm->methodState = ret.methodState;
362 sm->decision = ret.decision;
363 sm->allowNotifications = ret.allowNotifications;
365 if (sm->m->isKeyAvailable && sm->m->getKey &&
366 sm->m->isKeyAvailable(sm, sm->eap_method_priv)) {
367 os_free(sm->eapKeyData);
368 sm->eapKeyData = sm->m->getKey(sm, sm->eap_method_priv,
369 &sm->eapKeyDataLen);
381 wpabuf_free(sm->lastRespData);
382 if (sm->eapRespData) {
383 if (sm->workaround)
384 os_memcpy(sm->last_md5, sm->req_md5, 16);
385 sm->lastId = sm->reqId;
386 sm->lastRespData = wpabuf_dup(sm->eapRespData);
387 eapol_set_bool(sm, EAPOL_eapResp, TRUE);
389 sm->lastRespData = NULL;
390 eapol_set_bool(sm, EAPOL_eapReq, FALSE);
391 eapol_set_int(sm, EAPOL_idleWhile, sm->ClientTimeout);
402 eapol_set_bool(sm, EAPOL_eapReq, FALSE);
403 eapol_set_bool(sm, EAPOL_eapNoResp, TRUE);
415 eapReqData = eapol_get_eapReqData(sm);
416 eap_sm_processIdentity(sm, eapReqData);
417 wpabuf_free(sm->eapRespData);
418 sm->eapRespData = NULL;
419 sm->eapRespData = eap_sm_buildIdentity(sm, sm->reqId, 0);
431 eapReqData = eapol_get_eapReqData(sm);
432 eap_sm_processNotify(sm, eapReqData);
433 wpabuf_free(sm->eapRespData);
434 sm->eapRespData = NULL;
435 sm->eapRespData = eap_sm_buildNotify(sm->reqId);
445 wpabuf_free(sm->eapRespData);
446 if (sm->lastRespData)
447 sm->eapRespData = wpabuf_dup(sm->lastRespData);
449 sm->eapRespData = NULL;
461 if (sm->eapKeyData != NULL)
462 sm->eapKeyAvailable = TRUE;
463 eapol_set_bool(sm, EAPOL_eapSuccess, TRUE);
470 eapol_set_bool(sm, EAPOL_eapReq, FALSE);
478 eapol_set_bool(sm, EAPOL_eapNoResp, TRUE);
480 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_SUCCESS
492 eapol_set_bool(sm, EAPOL_eapFail, TRUE);
499 eapol_set_bool(sm, EAPOL_eapReq, FALSE);
506 eapol_set_bool(sm, EAPOL_eapNoResp, TRUE);
508 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_FAILURE
511 sm->prev_failure = 1;
515 static int eap_success_workaround(struct eap_sm *sm, int reqId, int lastId)
527 if (sm->workaround && (reqId == ((lastId + 1) & 0xff) ||
545 static void eap_peer_sm_step_idle(struct eap_sm *sm)
552 if (eapol_get_bool(sm, EAPOL_eapReq))
554 else if ((eapol_get_bool(sm, EAPOL_altAccept) &&
555 sm->decision != DECISION_FAIL) ||
556 (eapol_get_int(sm, EAPOL_idleWhile) == 0 &&
557 sm->decision == DECISION_UNCOND_SUCC))
559 else if (eapol_get_bool(sm, EAPOL_altReject) ||
560 (eapol_get_int(sm, EAPOL_idleWhile) == 0 &&
561 sm->decision != DECISION_UNCOND_SUCC) ||
562 (eapol_get_bool(sm, EAPOL_altAccept) &&
563 sm->methodState != METHOD_CONT &&
564 sm
566 else if (sm->selectedMethod == EAP_TYPE_LEAP &&
567 sm->leap_done && sm->decision != DECISION_FAIL &&
568 sm->methodState == METHOD_DONE)
570 else if (sm->selectedMethod == EAP_TYPE_PEAP &&
571 sm->peap_done && sm->decision != DECISION_FAIL &&
572 sm->methodState == METHOD_DONE)
577 static int eap_peer_req_is_duplicate(struct eap_sm *sm)
581 duplicate = (sm->reqId == sm->lastId) && sm->rxReq;
582 if (sm->workaround && duplicate &&
583 os_memcmp(sm->req_md5, sm->last_md5, 16) != 0) {
603 static void eap_peer_sm_step_received(struct eap_sm *sm)
605 int duplicate = eap_peer_req_is_duplicate(sm);
612 if (sm->rxSuccess && sm->decision != DECISION_FAIL &&
613 (sm->reqId == sm->lastId ||
614 eap_success_workaround(sm, sm->reqId, sm->lastId)))
616 else if (sm->methodState != METHOD_CONT &&
617 ((sm->rxFailure &&
618 sm->decision != DECISION_UNCOND_SUCC) ||
619 (sm->rxSuccess && sm->decision == DECISION_FAIL &&
620 (sm->selectedMethod != EAP_TYPE_LEAP ||
621 sm->methodState != METHOD_MAY_CONT))) &&
622 (sm->reqId == sm->lastId ||
623 eap_success_workaround(sm, sm->reqId, sm->lastId)))
625 else if (sm->rxReq && duplicate)
627 else if (sm->rxReq && !duplicate &&
628 sm->reqMethod == EAP_TYPE_NOTIFICATION &&
629 sm->allowNotifications)
631 else if (sm->rxReq && !duplicate &&
632 sm->selectedMethod == EAP_TYPE_NONE &&
633 sm->reqMethod == EAP_TYPE_IDENTITY)
635 else if (sm->rxReq && !duplicate &&
636 sm->selectedMethod == EAP_TYPE_NONE &&
637 sm->reqMethod != EAP_TYPE_IDENTITY &&
638 sm->reqMethod != EAP_TYPE_NOTIFICATION)
640 else if (sm->rxReq && !duplicate &&
641 sm->reqMethod == sm->selectedMethod &&
642 sm->methodState != METHOD_DONE)
644 else if (sm->selectedMethod == EAP_TYPE_LEAP &&
645 (sm->rxSuccess || sm->rxResp))
652 static void eap_peer_sm_step_local(struct eap_sm *sm)
654 switch (sm->EAP_state) {
659 if (eapol_get_bool(sm, EAPOL_portEnabled) &&
660 !sm->force_disabled)
664 eap_peer_sm_step_idle(sm);
667 eap_peer_sm_step_received(sm);
670 if (sm->selectedMethod == sm->reqMethod)
676 if (sm->ignore)
707 if (eapol_get_bool(sm, EAPOL_eapRestart) &&
708 eapol_get_bool(sm, EAPOL_portEnabled))
710 else if (!eapol_get_bool(sm, EAPOL_portEnabled) || sm->force_disabled)
712 else if (sm->num_rounds > EAP_MAX_AUTH_ROUNDS) {
721 if (sm->num_rounds == EAP_MAX_AUTH_ROUNDS + 1) {
722 wpa_msg(sm->msg_ctx, MSG_INFO, "EAP: more than %d "
725 sm->num_rounds++;
730 eap_peer_sm_step_local(sm);
735 static Boolean eap_sm_allowMethod(struct eap_sm *sm, int vendor,
738 if (!eap_allowed_method(sm, vendor, method)) {
752 struct eap_sm *sm, int id, const struct eap_method *methods,
771 if (sm->reqVendor == m->vendor &&
772 sm->reqVendorMethod == m->method)
774 if (eap_allowed_method(sm, m->vendor, m->method)) {
798 static struct wpabuf * eap_sm_buildNak(struct eap_sm *sm, int id)
807 "vendor=%u method=%u not allowed)", sm->reqMethod,
808 sm->reqVendor, sm->reqVendorMethod);
812 if (sm->reqMethod == EAP_TYPE_EXPANDED)
813 return eap_sm_build_expanded_nak(sm, id, methods, count);
824 if (m->vendor == EAP_VENDOR_IETF && m->method == sm->reqMethod)
826 if (eap_allowed_method(sm, m->vendor, m->method)) {
847 static void eap_sm_processIdentity(struct eap_sm *sm, const struct wpabuf *req)
853 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_STARTED
871 static int eap_sm_imsi_identity(struct eap_sm *sm,
881 if (scard_get_imsi(sm->scard_ctx, imsi, &imsi_len)) {
914 static int eap_sm_set_scard_pin(struct eap_sm *sm,
918 if (scard_set_pin(sm->scard_ctx, conf->pin)) {
927 eap_sm_request_pin(sm);
936 static int eap_sm_get_scard_identity(struct eap_sm *sm,
940 if (eap_sm_set_scard_pin(sm, conf))
943 return eap_sm_imsi_identity(sm, conf);
952 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
961 struct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted)
963 struct eap_peer_config *config = eap_get_config(sm);
974 if (sm->m && sm->m->get_identity &&
975 (identity = sm->m->get_identity(sm, sm->eap_method_priv,
995 if (eap_sm_get_scard_identity(sm, config) < 0)
1002 eap_sm_request_identity(sm);
1006 if (eap_sm_set_scard_pin(sm, config) < 0)
1021 static void eap_sm_processNotify(struct eap_sm *sm, const struct wpabuf *req)
1040 wpa_msg(sm->msg_ctx, MSG_INFO, "%s%s",
1060 static void eap_sm_parseEapReq(struct eap_sm *sm, const struct wpabuf *req)
1066 sm->rxReq = sm->rxResp = sm->rxSuccess = sm->rxFailure = FALSE;
1067 sm->reqId = 0;
1068 sm->reqMethod = EAP_TYPE_NONE;
1069 sm->reqVendor = EAP_VENDOR_IETF;
1070 sm->reqVendorMethod = EAP_TYPE_NONE;
1085 sm->reqId = hdr->identifier;
1087 if (sm->workaround) {
1090 md5_vector(1, addr, &plen, sm->req_md5);
1100 sm->rxReq = TRUE;
1102 sm->reqMethod = *pos++;
1103 if (sm->reqMethod == EAP_TYPE_EXPANDED) {
1110 sm->reqVendor = WPA_GET_BE24(pos);
1112 sm->reqVendorMethod = WPA_GET_BE32(pos);
1116 sm->reqId, sm->reqMethod, sm->reqVendor,
1117 sm->reqVendorMethod);
1120 if (sm->selectedMethod == EAP_TYPE_LEAP) {
1131 sm->rxResp = TRUE;
1133 sm->reqMethod = *pos;
1136 sm->reqMethod, sm->reqId);
1143 sm->rxSuccess = TRUE;
1147 sm->rxFailure = TRUE;
1175 struct eap_sm *sm;
1178 sm = os_zalloc(sizeof(*sm));
1179 if (sm == NULL)
1181 sm->eapol_ctx = eapol_ctx;
1182 sm->eapol_cb = eapol_cb;
1183 sm->msg_ctx = msg_ctx;
1184 sm->ClientTimeout = 60;
1185 sm->wps = conf->wps;
1191 sm->ssl_ctx = tls_init(&tlsconf);
1192 if (sm->ssl_ctx == NULL) {
1195 os_free(sm);
1199 return sm;
1205 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1210 void eap_peer_sm_deinit(struct eap_sm *sm)
1212 if (sm == NULL)
1214 eap_deinit_prev_method(sm, "EAP deinit");
1215 eap_sm_abort(sm);
1216 tls_deinit(sm->ssl_ctx);
1217 os_free(sm);
1223 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1230 int eap_peer_sm_step(struct eap_sm *sm)
1234 sm->changed = FALSE;
1236 if (sm->changed)
1238 } while (sm->changed);
1245 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1250 void eap_sm_abort(struct eap_sm *sm)
1252 wpabuf_free(sm->lastRespData);
1253 sm->lastRespData = NULL;
1254 wpabuf_free(sm->eapRespData);
1255 sm->eapRespData = NULL;
1256 os_free(sm->eapKeyData);
1257 sm->eapKeyData = NULL;
1262 eapol_set_bool(sm, EAPOL_eapSuccess, FALSE);
1343 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1354 int eap_sm_get_status(struct eap_sm *sm, char *buf, size_t buflen, int verbose)
1358 if (sm == NULL)
1363 eap_sm_state_txt(sm->EAP_state));
1367 if (sm->selectedMethod != EAP_TYPE_NONE) {
1369 if (sm->m) {
1370 name = sm->m->name;
1374 sm->selectedMethod);
1382 sm->selectedMethod, name);
1387 if (sm->m && sm->m->get_status) {
1388 len += sm->m->get_status(sm, sm->eap_method_priv,
1400 sm->reqMethod,
1401 eap_sm_method_state_txt(sm->methodState),
1402 eap_sm_decision_txt(sm->decision),
1403 sm->ClientTimeout);
1420 static void eap_sm_request(struct eap_sm *sm, eap_ctrl_req_type type,
1426 if (sm == NULL)
1428 config = eap_get_config(sm);
1482 if (sm->eapol_cb->eap_param_needed)
1483 sm->eapol_cb->eap_param_needed(sm->eapol_ctx, field, txt);
1486 #define eap_sm_request(sm, type, msg, msglen) do { } while (0)
1492 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1499 void eap_sm_request_identity(struct eap_sm *sm)
1501 eap_sm_request(sm, TYPE_IDENTITY, NULL, 0);
1507 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1514 void eap_sm_request_password(struct eap_sm *sm)
1516 eap_sm_request(sm, TYPE_PASSWORD, NULL, 0);
1522 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1529 void eap_sm_request_new_password(struct eap_sm *sm)
1531 eap_sm_request(sm, TYPE_NEW_PASSWORD, NULL, 0);
1537 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1544 void eap_sm_request_pin(struct eap_sm *sm)
1546 eap_sm_request(sm, TYPE_PIN, NULL, 0);
1552 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1560 void eap_sm_request_otp(struct eap_sm *sm, const char *msg, size_t msg_len)
1562 eap_sm_request(sm, TYPE_OTP, msg, msg_len);
1568 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1575 void eap_sm_request_passphrase(struct eap_sm *sm)
1577 eap_sm_request(sm, TYPE_PASSPHRASE, NULL, 0);
1583 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1588 void eap_sm_notify_ctrl_attached(struct eap_sm *sm)
1590 struct eap_peer_config *config = eap_get_config(sm);
1600 eap_sm_request_identity(sm);
1602 eap_sm_request_password(sm);
1604 eap_sm_request_new_password(sm);
1606 eap_sm_request_otp(sm, NULL, 0);
1608 eap_sm_request_pin(sm);
1610 eap_sm_request_passphrase(sm);
1692 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1695 void eap_set_fast_reauth(struct eap_sm *sm, int enabled)
1697 sm->fast_reauth = enabled;
1703 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1706 void eap_set_workaround(struct eap_sm *sm, unsigned int workaround)
1708 sm->workaround = workaround;
1714 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1722 struct eap_peer_config * eap_get_config(struct eap_sm *sm)
1724 return sm->eapol_cb->get_config(sm->eapol_ctx);
1730 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1734 const u8 * eap_get_config_identity(struct eap_sm *sm, size_t *len)
1736 struct eap_peer_config *config = eap_get_config(sm);
1746 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1750 const u8 * eap_get_config_password(struct eap_sm *sm, size_t *len)
1752 struct eap_peer_config *config = eap_get_config(sm);
1762 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1769 const u8 * eap_get_config_password2(struct eap_sm *sm, size_t *len, int *hash)
1771 struct eap_peer_config *config = eap_get_config(sm);
1783 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1787 const u8 * eap_get_config_new_password(struct eap_sm *sm, size_t *len)
1789 struct eap_peer_config *config = eap_get_config(sm);
1799 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1803 const u8 * eap_get_config_otp(struct eap_sm *sm, size_t *len)
1805 struct eap_peer_config *config = eap_get_config(sm);
1815 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1821 void eap_clear_config_otp(struct eap_sm *sm)
1823 struct eap_peer_config *config = eap_get_config(sm);
1835 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1838 const char * eap_get_config_phase1(struct eap_sm *sm)
1840 struct eap_peer_config *config = eap_get_config(sm);
1849 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1852 const char * eap_get_config_phase2(struct eap_sm *sm)
1854 struct eap_peer_config *config = eap_get_config(sm);
1863 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1866 int eap_key_available(struct eap_sm *sm)
1868 return sm ? sm->eapKeyAvailable : 0;
1874 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1881 void eap_notify_success(struct eap_sm *sm)
1883 if (sm) {
1884 sm->decision = DECISION_COND_SUCC;
1885 sm->EAP_state = EAP_SUCCESS;
1892 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1897 void eap_notify_lower_layer_success(struct eap_sm *sm)
1899 if (sm == NULL)
1902 if (eapol_get_bool(sm, EAPOL_eapSuccess) ||
1903 sm->decision == DECISION_FAIL ||
1904 (sm->methodState != METHOD_MAY_CONT &&
1905 sm->methodState != METHOD_DONE))
1908 if (sm->eapKeyData != NULL)
1909 sm->eapKeyAvailable = TRUE;
1910 eapol_set_bool(sm, EAPOL_eapSuccess, TRUE);
1911 wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_SUCCESS
1919 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1928 const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len)
1930 if (sm == NULL || sm->eapKeyData == NULL) {
1935 *len = sm->eapKeyDataLen;
1936 return sm->eapKeyData;
1942 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1950 struct wpabuf * eap_get_eapRespData(struct eap_sm *sm)
1954 if (sm == NULL || sm->eapRespData == NULL)
1957 resp = sm->eapRespData;
1958 sm->eapRespData = NULL;
1966 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1972 void eap_register_scard_ctx(struct eap_sm *sm, void *ctx)
1974 if (sm)
1975 sm->scard_ctx = ctx;
1981 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
1987 void eap_set_config_blob(struct eap_sm *sm, struct wpa_config_blob *blob)
1990 sm->eapol_cb->set_config_blob(sm->eapol_ctx, blob);
1997 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
2001 const struct wpa_config_blob * eap_get_config_blob(struct eap_sm *sm,
2005 return sm->eapol_cb->get_config_blob(sm->eapol_ctx, name);
2014 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
2020 void eap_set_force_disabled(struct eap_sm *sm, int disabled)
2022 sm->force_disabled = disabled;
2028 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
2035 void eap_notify_pending(struct eap_sm *sm)
2037 sm->eapol_cb->notify_pending(sm->eapol_ctx);
2043 * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
2045 void eap_invalidate_cached_session(struct eap_sm *sm)
2047 if (sm)
2048 eap_deinit_prev_method(sm, "invalidate");