Lines Matching refs:sta
38 struct sta_info *sta, int success,
42 static void ieee802_1x_send(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_send() argument
67 if (wpa_auth_pairwise_set(sta->wpa_sm)) in ieee802_1x_send()
69 if (sta->flags & WLAN_STA_PREAUTH) { in ieee802_1x_send()
70 rsn_preauth_send(hapd, sta, buf, len); in ieee802_1x_send()
73 hapd, sta->addr, buf, len, in ieee802_1x_send()
74 encrypt, hostapd_sta_flags_to_drv(sta->flags)); in ieee802_1x_send()
82 struct sta_info *sta, int authorized) in ieee802_1x_set_sta_authorized() argument
86 if (sta->flags & WLAN_STA_PREAUTH) in ieee802_1x_set_sta_authorized()
90 ap_sta_set_authorized(hapd, sta, 1); in ieee802_1x_set_sta_authorized()
91 res = hostapd_set_authorized(hapd, sta, 1); in ieee802_1x_set_sta_authorized()
92 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_set_sta_authorized()
95 ap_sta_set_authorized(hapd, sta, 0); in ieee802_1x_set_sta_authorized()
96 res = hostapd_set_authorized(hapd, sta, 0); in ieee802_1x_set_sta_authorized()
97 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_set_sta_authorized()
104 MAC2STR(sta->addr), errno); in ieee802_1x_set_sta_authorized()
108 os_get_reltime(&sta->connected_time); in ieee802_1x_set_sta_authorized()
109 accounting_sta_start(hapd, sta); in ieee802_1x_set_sta_authorized()
115 struct sta_info *sta, in ieee802_1x_tx_key_one() argument
123 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_tx_key_one()
186 ieee802_1x_send(hapd, sta, IEEE802_1X_TYPE_EAPOL_KEY, (u8 *) key, len); in ieee802_1x_tx_key_one()
187 if (sta->eapol_sm) in ieee802_1x_tx_key_one()
188 sta->eapol_sm->dot1xAuthEapolFramesTx++; in ieee802_1x_tx_key_one()
193 void ieee802_1x_tx_key(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_tx_key() argument
196 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_tx_key()
202 MAC2STR(sta->addr)); in ieee802_1x_tx_key()
205 if (sta->vlan_id > 0 && sta->vlan_id <= MAX_VLAN_ID) { in ieee802_1x_tx_key()
212 ieee802_1x_tx_key_one(hapd, sta, eapol->default_wep_key_idx, 1, in ieee802_1x_tx_key()
232 ieee802_1x_tx_key_one(hapd, sta, 0, 0, ikey, in ieee802_1x_tx_key()
238 sta->addr, 0, 1, NULL, 0, ikey, in ieee802_1x_tx_key()
265 int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta) in radius_sta_rate() argument
270 for (i = 0; i < sta->supported_rates_len; i++) in radius_sta_rate()
271 if ((sta->supported_rates[i] & 0x7f) > rate) in radius_sta_rate()
272 rate = sta->supported_rates[i] & 0x7f; in radius_sta_rate()
311 struct sta_info *sta, in add_common_radius_sta_attr_rsn() argument
317 ver = wpa_auth_sta_wpa_version(sta->wpa_sm); in add_common_radius_sta_attr_rsn()
318 val = wpa_auth_get_pairwise(sta->wpa_sm); in add_common_radius_sta_attr_rsn()
340 val = wpa_auth_sta_key_mgmt(sta->wpa_sm); in add_common_radius_sta_attr_rsn()
372 struct sta_info *sta, in add_common_radius_sta_attr() argument
379 !radius_msg_add_attr_int32(msg, RADIUS_ATTR_NAS_PORT, sta->aid)) { in add_common_radius_sta_attr()
385 MAC2STR(sta->addr)); in add_common_radius_sta_attr()
393 if (sta->flags & WLAN_STA_PREAUTH) { in add_common_radius_sta_attr()
398 radius_sta_rate(hapd, sta) / 2, in add_common_radius_sta_attr()
399 (radius_sta_rate(hapd, sta) & 1) ? ".5" : "", in add_common_radius_sta_attr()
411 if (sta->acct_session_id_hi || sta->acct_session_id_lo) { in add_common_radius_sta_attr()
413 sta->acct_session_id_hi, sta->acct_session_id_lo); in add_common_radius_sta_attr()
423 sta->wpa_sm && in add_common_radius_sta_attr()
424 (wpa_key_mgmt_ft(wpa_auth_sta_key_mgmt(sta->wpa_sm)) || in add_common_radius_sta_attr()
425 sta->auth_alg == WLAN_AUTH_FT) && in add_common_radius_sta_attr()
436 if (hapd->conf->wpa && sta->wpa_sm && in add_common_radius_sta_attr()
437 add_common_radius_sta_attr_rsn(hapd, req_attr, sta, msg) < 0) in add_common_radius_sta_attr()
446 struct sta_info *sta, in add_common_radius_attr() argument
519 if (sta && add_common_radius_sta_attr(hapd, req_attr, sta, msg) < 0) in add_common_radius_attr()
537 struct sta_info *sta, in ieee802_1x_encapsulate_radius() argument
541 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_encapsulate_radius()
559 radius_msg_make_authenticator(msg, (u8 *) sta, sizeof(*sta)); in ieee802_1x_encapsulate_radius()
568 if (add_common_radius_attr(hapd, hapd->conf->radius_auth_req_attr, sta, in ieee802_1x_encapsulate_radius()
633 if (sta->hs20_ie && wpabuf_len(sta->hs20_ie) > 0) { in ieee802_1x_encapsulate_radius()
637 pos = wpabuf_head_u8(sta->hs20_ie); in ieee802_1x_encapsulate_radius()
640 wpabuf_len(sta->hs20_ie) >= 3) in ieee802_1x_encapsulate_radius()
657 if (radius_client_send(hapd->radius, msg, RADIUS_AUTH, sta->addr) < 0) in ieee802_1x_encapsulate_radius()
669 struct sta_info *sta, struct eap_hdr *eap, in handle_eap_response() argument
673 struct eapol_state_machine *sm = sta->eapol_sm; in handle_eap_response()
701 static void handle_eap(struct hostapd_data *hapd, struct sta_info *sta, in handle_eap() argument
735 handle_eap_response(hapd, sta, eap, eap_len); in handle_eap()
751 ieee802_1x_alloc_eapol_sm(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_alloc_eapol_sm() argument
754 if (sta->flags & WLAN_STA_PREAUTH) in ieee802_1x_alloc_eapol_sm()
756 if (sta->wpa_sm) { in ieee802_1x_alloc_eapol_sm()
758 if (wpa_auth_sta_get_pmksa(sta->wpa_sm)) in ieee802_1x_alloc_eapol_sm()
761 return eapol_auth_alloc(hapd->eapol_auth, sta->addr, flags, in ieee802_1x_alloc_eapol_sm()
762 sta->wps_ie, sta->p2p_ie, sta, in ieee802_1x_alloc_eapol_sm()
763 sta->identity, sta->radius_cui); in ieee802_1x_alloc_eapol_sm()
779 struct sta_info *sta; in ieee802_1x_receive() local
792 sta = ap_get_sta(hapd, sa); in ieee802_1x_receive()
793 if (!sta || (!(sta->flags & (WLAN_STA_ASSOC | WLAN_STA_PREAUTH)) && in ieee802_1x_receive()
812 if (sta->eapol_sm) in ieee802_1x_receive()
813 sta->eapol_sm->dot1xAuthEapLengthErrorFramesRx++; in ieee802_1x_receive()
822 if (sta->eapol_sm) { in ieee802_1x_receive()
823 sta->eapol_sm->dot1xAuthLastEapolFrameVersion = hdr->version; in ieee802_1x_receive()
824 sta->eapol_sm->dot1xAuthEapolFramesRx++; in ieee802_1x_receive()
832 wpa_receive(hapd->wpa_auth, sta->wpa_sm, (u8 *) hdr, in ieee802_1x_receive()
838 !(sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS))) { in ieee802_1x_receive()
844 key_mgmt = wpa_auth_sta_key_mgmt(sta->wpa_sm); in ieee802_1x_receive()
851 if (!sta->eapol_sm) { in ieee802_1x_receive()
852 sta->eapol_sm = ieee802_1x_alloc_eapol_sm(hapd, sta); in ieee802_1x_receive()
853 if (!sta->eapol_sm) in ieee802_1x_receive()
858 u32 wflags = sta->flags & (WLAN_STA_WPS | in ieee802_1x_receive()
873 sta->eapol_sm->flags |= EAPOL_SM_WAIT_START; in ieee802_1x_receive()
878 sta->eapol_sm->eap_if->portEnabled = TRUE; in ieee802_1x_receive()
890 handle_eap(hapd, sta, (u8 *) (hdr + 1), datalen); in ieee802_1x_receive()
894 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_receive()
897 sta->eapol_sm->flags &= ~EAPOL_SM_WAIT_START; in ieee802_1x_receive()
898 pmksa = wpa_auth_sta_get_pmksa(sta->wpa_sm); in ieee802_1x_receive()
900 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_WPA, in ieee802_1x_receive()
904 wpa_auth_sta_clear_pmksa(sta->wpa_sm, pmksa); in ieee802_1x_receive()
906 sta->eapol_sm->eapolStart = TRUE; in ieee802_1x_receive()
907 sta->eapol_sm->dot1xAuthEapolStartFramesRx++; in ieee802_1x_receive()
908 eap_server_clear_identity(sta->eapol_sm->eap); in ieee802_1x_receive()
909 wpa_auth_sm_event(sta->wpa_sm, WPA_REAUTH_EAPOL); in ieee802_1x_receive()
913 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_receive()
916 sta->acct_terminate_cause = in ieee802_1x_receive()
918 accounting_sta_stop(hapd, sta); in ieee802_1x_receive()
919 sta->eapol_sm->eapolLogoff = TRUE; in ieee802_1x_receive()
920 sta->eapol_sm->dot1xAuthEapolLogoffFramesRx++; in ieee802_1x_receive()
921 eap_server_clear_identity(sta->eapol_sm->eap); in ieee802_1x_receive()
926 if (!ap_sta_is_authorized(sta)) { in ieee802_1x_receive()
940 sta->eapol_sm->dot1xAuthInvalidEapolFramesRx++; in ieee802_1x_receive()
944 eapol_auth_step(sta->eapol_sm); in ieee802_1x_receive()
956 void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_new_station() argument
965 (sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS))) { in ieee802_1x_new_station()
982 ieee802_1x_free_station(sta); in ieee802_1x_new_station()
986 key_mgmt = wpa_auth_sta_key_mgmt(sta->wpa_sm); in ieee802_1x_new_station()
993 ieee802_1x_free_station(sta); in ieee802_1x_new_station()
997 if (sta->eapol_sm == NULL) { in ieee802_1x_new_station()
998 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1000 sta->eapol_sm = ieee802_1x_alloc_eapol_sm(hapd, sta); in ieee802_1x_new_station()
1001 if (sta->eapol_sm == NULL) { in ieee802_1x_new_station()
1002 hostapd_logger(hapd, sta->addr, in ieee802_1x_new_station()
1012 sta->eapol_sm->flags &= ~EAPOL_SM_WAIT_START; in ieee802_1x_new_station()
1014 !(sta->flags & WLAN_STA_WPS2)) { in ieee802_1x_new_station()
1022 sta->eapol_sm->flags |= EAPOL_SM_WAIT_START; in ieee802_1x_new_station()
1026 sta->eapol_sm->eap_if->portEnabled = TRUE; in ieee802_1x_new_station()
1029 if (sta->auth_alg == WLAN_AUTH_FT) { in ieee802_1x_new_station()
1030 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1035 sta->eapol_sm->keyRun = TRUE; in ieee802_1x_new_station()
1036 sta->eapol_sm->eap_if->eapKeyAvailable = TRUE; in ieee802_1x_new_station()
1037 sta->eapol_sm->auth_pae_state = AUTH_PAE_AUTHENTICATING; in ieee802_1x_new_station()
1038 sta->eapol_sm->be_auth_state = BE_AUTH_SUCCESS; in ieee802_1x_new_station()
1039 sta->eapol_sm->authSuccess = TRUE; in ieee802_1x_new_station()
1040 sta->eapol_sm->authFail = FALSE; in ieee802_1x_new_station()
1041 if (sta->eapol_sm->eap) in ieee802_1x_new_station()
1042 eap_sm_notify_cached(sta->eapol_sm->eap); in ieee802_1x_new_station()
1048 pmksa = wpa_auth_sta_get_pmksa(sta->wpa_sm); in ieee802_1x_new_station()
1052 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1057 sta->eapol_sm->keyRun = TRUE; in ieee802_1x_new_station()
1058 sta->eapol_sm->eap_if->eapKeyAvailable = TRUE; in ieee802_1x_new_station()
1059 sta->eapol_sm->auth_pae_state = AUTH_PAE_AUTHENTICATING; in ieee802_1x_new_station()
1060 sta->eapol_sm->be_auth_state = BE_AUTH_SUCCESS; in ieee802_1x_new_station()
1061 sta->eapol_sm->authSuccess = TRUE; in ieee802_1x_new_station()
1062 sta->eapol_sm->authFail = FALSE; in ieee802_1x_new_station()
1063 if (sta->eapol_sm->eap) in ieee802_1x_new_station()
1064 eap_sm_notify_cached(sta->eapol_sm->eap); in ieee802_1x_new_station()
1065 old_vlanid = sta->vlan_id; in ieee802_1x_new_station()
1066 pmksa_cache_to_eapol_data(pmksa, sta->eapol_sm); in ieee802_1x_new_station()
1067 if (sta->ssid->dynamic_vlan == DYNAMIC_VLAN_DISABLED) in ieee802_1x_new_station()
1068 sta->vlan_id = 0; in ieee802_1x_new_station()
1069 ap_sta_bind_vlan(hapd, sta, old_vlanid); in ieee802_1x_new_station()
1077 sta->eapol_sm->reAuthenticate = TRUE; in ieee802_1x_new_station()
1079 eapol_auth_step(sta->eapol_sm); in ieee802_1x_new_station()
1084 void ieee802_1x_free_station(struct sta_info *sta) in ieee802_1x_free_station() argument
1086 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_free_station()
1091 sta->eapol_sm = NULL; in ieee802_1x_free_station()
1106 struct sta_info *sta) in ieee802_1x_decapsulate_radius() argument
1113 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_decapsulate_radius()
1128 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_decapsulate_radius()
1136 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_decapsulate_radius()
1174 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_decapsulate_radius()
1187 struct sta_info *sta, struct radius_msg *msg, in ieee802_1x_get_keys() argument
1193 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_get_keys()
1228 struct sta_info *sta, in ieee802_1x_store_radius_class() argument
1233 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_store_radius_class()
1278 MAC2STR(sta->addr)); in ieee802_1x_store_radius_class()
1284 struct sta_info *sta, in ieee802_1x_update_sta_identity() argument
1289 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_update_sta_identity()
1302 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_update_sta_identity()
1316 struct sta_info *sta, in ieee802_1x_update_sta_cui() argument
1319 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_update_sta_cui()
1342 static void ieee802_1x_hs20_sub_rem(struct sta_info *sta, u8 *pos, size_t len) in ieee802_1x_hs20_sub_rem() argument
1344 sta->remediation = 1; in ieee802_1x_hs20_sub_rem()
1345 os_free(sta->remediation_url); in ieee802_1x_hs20_sub_rem()
1347 sta->remediation_url = os_malloc(len); in ieee802_1x_hs20_sub_rem()
1348 if (!sta->remediation_url) in ieee802_1x_hs20_sub_rem()
1350 sta->remediation_method = pos[0]; in ieee802_1x_hs20_sub_rem()
1351 os_memcpy(sta->remediation_url, pos + 1, len - 1); in ieee802_1x_hs20_sub_rem()
1352 sta->remediation_url[len - 1] = '\0'; in ieee802_1x_hs20_sub_rem()
1355 MAC2STR(sta->addr), sta->remediation_method, in ieee802_1x_hs20_sub_rem()
1356 sta->remediation_url); in ieee802_1x_hs20_sub_rem()
1358 sta->remediation_url = NULL; in ieee802_1x_hs20_sub_rem()
1360 "for " MACSTR, MAC2STR(sta->addr)); in ieee802_1x_hs20_sub_rem()
1367 struct sta_info *sta, u8 *pos, in ieee802_1x_hs20_deauth_req() argument
1372 sta->hs20_deauth_requested = 1; in ieee802_1x_hs20_deauth_req()
1376 wpabuf_free(sta->hs20_deauth_req); in ieee802_1x_hs20_deauth_req()
1377 sta->hs20_deauth_req = wpabuf_alloc(len + 1); in ieee802_1x_hs20_deauth_req()
1378 if (sta->hs20_deauth_req) { in ieee802_1x_hs20_deauth_req()
1379 wpabuf_put_data(sta->hs20_deauth_req, pos, 3); in ieee802_1x_hs20_deauth_req()
1380 wpabuf_put_u8(sta->hs20_deauth_req, len - 3); in ieee802_1x_hs20_deauth_req()
1381 wpabuf_put_data(sta->hs20_deauth_req, pos + 3, len - 3); in ieee802_1x_hs20_deauth_req()
1383 ap_sta_session_timeout(hapd, sta, hapd->conf->hs20_deauth_req_timeout); in ieee802_1x_hs20_deauth_req()
1388 struct sta_info *sta, u8 *pos, in ieee802_1x_hs20_session_info() argument
1396 os_free(sta->hs20_session_info_url); in ieee802_1x_hs20_session_info()
1397 sta->hs20_session_info_url = os_malloc(len); in ieee802_1x_hs20_session_info()
1398 if (sta->hs20_session_info_url == NULL) in ieee802_1x_hs20_session_info()
1401 os_memcpy(sta->hs20_session_info_url, pos + 1, len - 1); in ieee802_1x_hs20_session_info()
1402 sta->hs20_session_info_url[len - 1] = '\0'; in ieee802_1x_hs20_session_info()
1405 sta->hs20_session_info_url, swt, session_timeout); in ieee802_1x_hs20_session_info()
1421 sta->hs20_disassoc_timer = swt * 60 * 1000 / beacon_int * 125 / 128; in ieee802_1x_hs20_session_info()
1422 if (sta->hs20_disassoc_timer > 65535) in ieee802_1x_hs20_session_info()
1423 sta->hs20_disassoc_timer = 65535; in ieee802_1x_hs20_session_info()
1425 ap_sta_session_warning_timeout(hapd, sta, warning_time); in ieee802_1x_hs20_session_info()
1432 struct sta_info *sta, in ieee802_1x_check_hs20() argument
1441 sta->remediation = 0; in ieee802_1x_check_hs20()
1442 sta->hs20_deauth_requested = 0; in ieee802_1x_check_hs20()
1466 ieee802_1x_hs20_sub_rem(sta, pos, sublen); in ieee802_1x_check_hs20()
1469 ieee802_1x_hs20_deauth_req(hapd, sta, pos, sublen); in ieee802_1x_check_hs20()
1472 ieee802_1x_hs20_session_info(hapd, sta, pos, sublen, in ieee802_1x_check_hs20()
1488 struct sta_info *sta, in ieee802_1x_select_radius_identifier() argument
1492 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_select_radius_identifier()
1529 struct sta_info *sta; in ieee802_1x_receive_auth() local
1542 sta = sm->sta; in ieee802_1x_receive_auth()
1568 MAC2STR(sta->addr)); in ieee802_1x_receive_auth()
1585 hostapd_logger(hapd, sta->addr, in ieee802_1x_receive_auth()
1592 sta->acct_interim_interval = acct_interim_interval; in ieee802_1x_receive_auth()
1598 if (sta->ssid->dynamic_vlan == DYNAMIC_VLAN_DISABLED) in ieee802_1x_receive_auth()
1599 sta->vlan_id = 0; in ieee802_1x_receive_auth()
1602 old_vlanid = sta->vlan_id; in ieee802_1x_receive_auth()
1603 sta->vlan_id = radius_msg_get_vlanid(msg); in ieee802_1x_receive_auth()
1605 if (sta->vlan_id > 0 && in ieee802_1x_receive_auth()
1606 hostapd_vlan_id_valid(hapd->conf->vlan, sta->vlan_id)) { in ieee802_1x_receive_auth()
1607 hostapd_logger(hapd, sta->addr, in ieee802_1x_receive_auth()
1610 "VLAN ID %d", sta->vlan_id); in ieee802_1x_receive_auth()
1611 } else if (sta->ssid->dynamic_vlan == DYNAMIC_VLAN_REQUIRED) { in ieee802_1x_receive_auth()
1612 sta->eapol_sm->authFail = TRUE; in ieee802_1x_receive_auth()
1613 hostapd_logger(hapd, sta->addr, in ieee802_1x_receive_auth()
1622 if (ap_sta_bind_vlan(hapd, sta, old_vlanid) < 0) in ieee802_1x_receive_auth()
1625 sta->session_timeout_set = !!session_timeout_set; in ieee802_1x_receive_auth()
1626 sta->session_timeout = session_timeout; in ieee802_1x_receive_auth()
1633 ap_sta_session_timeout(hapd, sta, session_timeout); in ieee802_1x_receive_auth()
1637 ieee802_1x_get_keys(hapd, sta, msg, req, shared_secret, in ieee802_1x_receive_auth()
1639 ieee802_1x_store_radius_class(hapd, sta, msg); in ieee802_1x_receive_auth()
1640 ieee802_1x_update_sta_identity(hapd, sta, msg); in ieee802_1x_receive_auth()
1641 ieee802_1x_update_sta_cui(hapd, sta, msg); in ieee802_1x_receive_auth()
1642 ieee802_1x_check_hs20(hapd, sta, msg, in ieee802_1x_receive_auth()
1645 if (sm->eap_if->eapKeyAvailable && !sta->remediation && in ieee802_1x_receive_auth()
1646 !sta->hs20_deauth_requested && in ieee802_1x_receive_auth()
1647 wpa_auth_pmksa_add(sta->wpa_sm, sm->eapol_key_crypt, in ieee802_1x_receive_auth()
1650 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_WPA, in ieee802_1x_receive_auth()
1680 ieee802_1x_decapsulate_radius(hapd, sta); in ieee802_1x_receive_auth()
1691 void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_abort_auth() argument
1693 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_abort_auth()
1697 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_abort_auth()
1712 MAC2STR(sta->addr)); in ieee802_1x_abort_auth()
1715 ap_sta_disconnect(hapd, sta, sta->addr, in ieee802_1x_abort_auth()
1748 struct sta_info *sta, void *ctx) in ieee802_1x_sta_key_available() argument
1750 if (sta->eapol_sm) { in ieee802_1x_sta_key_available()
1751 sta->eapol_sm->eap_if->eapKeyAvailable = TRUE; in ieee802_1x_sta_key_available()
1752 eapol_auth_step(sta->eapol_sm); in ieee802_1x_sta_key_available()
1809 struct sta_info *sta = sta_ctx; in ieee802_1x_eapol_send() local
1811 if ((sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS)) == in ieee802_1x_eapol_send()
1815 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_eapol_send()
1827 sta->flags |= WLAN_STA_WPS; in ieee802_1x_eapol_send()
1841 struct sta_info *sta = sta_ctx; in ieee802_1x_aaa_send() local
1843 ieee802_1x_encapsulate_radius(hapd, sta, data, datalen); in ieee802_1x_aaa_send()
1852 struct sta_info *sta = sta_ctx; in _ieee802_1x_finished() local
1854 rsn_preauth_finished(hapd, sta, success); in _ieee802_1x_finished()
1856 ieee802_1x_finished(hapd, sta, success, remediation); in _ieee802_1x_finished()
1900 struct sta_info *sta; in ieee802_1x_sta_entry_alive() local
1901 sta = ap_get_sta(hapd, addr); in ieee802_1x_sta_entry_alive()
1902 if (sta == NULL || sta->eapol_sm == NULL) in ieee802_1x_sta_entry_alive()
1938 struct sta_info *sta = sta_ctx; in ieee802_1x_set_port_authorized() local
1939 ieee802_1x_set_sta_authorized(hapd, sta, authorized); in ieee802_1x_set_port_authorized()
1946 struct sta_info *sta = sta_ctx; in _ieee802_1x_abort_auth() local
1947 ieee802_1x_abort_auth(hapd, sta); in _ieee802_1x_abort_auth()
1954 struct sta_info *sta = sta_ctx; in _ieee802_1x_tx_key() local
1955 ieee802_1x_tx_key(hapd, sta); in _ieee802_1x_tx_key()
1963 struct sta_info *sta = sta_ctx; in ieee802_1x_eapol_event() local
1966 wpa_auth_sm_notify(sta->wpa_sm); in ieee802_1x_eapol_event()
1969 wpa_auth_sm_event(sta->wpa_sm, WPA_REAUTH_EAPOL); in ieee802_1x_eapol_event()
2068 int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_tx_status() argument
2076 if (sta == NULL) in ieee802_1x_tx_status()
2090 return ieee802_1x_eapol_tx_status(hapd, sta, pos, buf + len - pos, in ieee802_1x_tx_status()
2095 int ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_eapol_tx_status() argument
2107 MAC2STR(sta->addr), xhdr->version, xhdr->type, in ieee802_1x_eapol_tx_status()
2119 sta->wpa_sm, ack); in ieee802_1x_eapol_tx_status()
2129 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_eapol_tx_status()
2234 int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_get_mib_sta() argument
2238 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_get_mib_sta()
2252 sta->aid, in ieee802_1x_get_mib_sta()
2356 os_reltime_age(&sta->acct_session_start, &diff); in ieee802_1x_get_mib_sta()
2367 sta->acct_session_id_hi, sta->acct_session_id_lo, in ieee802_1x_get_mib_sta()
2369 wpa_auth_sta_key_mgmt(sta->wpa_sm))) ? in ieee802_1x_get_mib_sta()
2395 struct sta_info *sta, int success, in ieee802_1x_finished() argument
2405 if (remediation && !sta->remediation) { in ieee802_1x_finished()
2406 sta->remediation = 1; in ieee802_1x_finished()
2407 os_free(sta->remediation_url); in ieee802_1x_finished()
2408 sta->remediation_url = in ieee802_1x_finished()
2410 sta->remediation_method = 1; /* SOAP-XML SPP */ in ieee802_1x_finished()
2414 if (sta->remediation) { in ieee802_1x_finished()
2418 MAC2STR(sta->addr)); in ieee802_1x_finished()
2419 hs20_send_wnm_notification(hapd, sta->addr, in ieee802_1x_finished()
2420 sta->remediation_method, in ieee802_1x_finished()
2421 sta->remediation_url); in ieee802_1x_finished()
2422 os_free(sta->remediation_url); in ieee802_1x_finished()
2423 sta->remediation_url = NULL; in ieee802_1x_finished()
2426 if (sta->hs20_deauth_req) { in ieee802_1x_finished()
2429 "deauthentication", MAC2STR(sta->addr)); in ieee802_1x_finished()
2431 hapd, sta->addr, sta->hs20_deauth_req); in ieee802_1x_finished()
2436 key = ieee802_1x_get_key(sta->eapol_sm, &len); in ieee802_1x_finished()
2437 if (sta->session_timeout_set) in ieee802_1x_finished()
2438 session_timeout = sta->session_timeout; in ieee802_1x_finished()
2441 if (success && key && len >= PMK_LEN && !sta->remediation && in ieee802_1x_finished()
2442 !sta->hs20_deauth_requested && in ieee802_1x_finished()
2443 wpa_auth_pmksa_add(sta->wpa_sm, key, session_timeout, in ieee802_1x_finished()
2444 sta->eapol_sm) == 0) { in ieee802_1x_finished()
2445 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_WPA, in ieee802_1x_finished()
2468 ap_sta_disconnect(hapd, sta, sta->addr, in ieee802_1x_finished()