Lines Matching refs:sta
47 struct sta_info *sta, int success,
51 static void ieee802_1x_send(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_send() argument
79 if (wpa_auth_pairwise_set(sta->wpa_sm)) in ieee802_1x_send()
90 MAC2STR(sta->addr), hex); in ieee802_1x_send()
95 if (sta->flags & WLAN_STA_PREAUTH) { in ieee802_1x_send()
96 rsn_preauth_send(hapd, sta, buf, len); in ieee802_1x_send()
99 hapd, sta->addr, buf, len, in ieee802_1x_send()
100 encrypt, hostapd_sta_flags_to_drv(sta->flags)); in ieee802_1x_send()
108 struct sta_info *sta, int authorized) in ieee802_1x_set_sta_authorized() argument
112 if (sta->flags & WLAN_STA_PREAUTH) in ieee802_1x_set_sta_authorized()
116 ap_sta_set_authorized(hapd, sta, 1); in ieee802_1x_set_sta_authorized()
117 res = hostapd_set_authorized(hapd, sta, 1); in ieee802_1x_set_sta_authorized()
118 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_set_sta_authorized()
121 ap_sta_set_authorized(hapd, sta, 0); in ieee802_1x_set_sta_authorized()
122 res = hostapd_set_authorized(hapd, sta, 0); in ieee802_1x_set_sta_authorized()
123 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_set_sta_authorized()
130 MAC2STR(sta->addr), errno); in ieee802_1x_set_sta_authorized()
134 os_get_reltime(&sta->connected_time); in ieee802_1x_set_sta_authorized()
135 accounting_sta_start(hapd, sta); in ieee802_1x_set_sta_authorized()
145 struct sta_info *sta, in ieee802_1x_tx_key_one() argument
153 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_tx_key_one()
235 ieee802_1x_send(hapd, sta, IEEE802_1X_TYPE_EAPOL_KEY, (u8 *) key, len); in ieee802_1x_tx_key_one()
236 if (sta->eapol_sm) in ieee802_1x_tx_key_one()
237 sta->eapol_sm->dot1xAuthEapolFramesTx++; in ieee802_1x_tx_key_one()
242 static void ieee802_1x_tx_key(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_tx_key() argument
245 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_tx_key()
251 MAC2STR(sta->addr)); in ieee802_1x_tx_key()
254 if (sta->vlan_id > 0) { in ieee802_1x_tx_key()
261 ieee802_1x_tx_key_one(hapd, sta, eapol->default_wep_key_idx, 1, in ieee802_1x_tx_key()
282 ieee802_1x_tx_key_one(hapd, sta, 0, 0, ikey, in ieee802_1x_tx_key()
288 sta->addr, 0, 0, 1, NULL, 0, ikey, in ieee802_1x_tx_key()
320 int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta) in radius_sta_rate() argument
325 for (i = 0; i < sta->supported_rates_len; i++) in radius_sta_rate()
326 if ((sta->supported_rates[i] & 0x7f) > rate) in radius_sta_rate()
327 rate = sta->supported_rates[i] & 0x7f; in radius_sta_rate()
373 struct sta_info *sta, in add_common_radius_sta_attr_rsn() argument
379 ver = wpa_auth_sta_wpa_version(sta->wpa_sm); in add_common_radius_sta_attr_rsn()
380 val = wpa_auth_get_pairwise(sta->wpa_sm); in add_common_radius_sta_attr_rsn()
403 val = wpa_auth_sta_key_mgmt(sta->wpa_sm); in add_common_radius_sta_attr_rsn()
433 struct sta_info *sta, in add_common_radius_sta_attr() argument
448 sta->aid > 0 && in add_common_radius_sta_attr()
449 !radius_msg_add_attr_int32(msg, RADIUS_ATTR_NAS_PORT, sta->aid)) { in add_common_radius_sta_attr()
455 MAC2STR(sta->addr)); in add_common_radius_sta_attr()
463 if (sta->flags & WLAN_STA_PREAUTH) { in add_common_radius_sta_attr()
468 radius_sta_rate(hapd, sta) / 2, in add_common_radius_sta_attr()
469 (radius_sta_rate(hapd, sta) & 1) ? ".5" : "", in add_common_radius_sta_attr()
481 if (sta->acct_session_id) { in add_common_radius_sta_attr()
483 (unsigned long long) sta->acct_session_id); in add_common_radius_sta_attr()
493 sta->eapol_sm && sta->eapol_sm->acct_multi_session_id) { in add_common_radius_sta_attr()
496 sta->eapol_sm->acct_multi_session_id); in add_common_radius_sta_attr()
508 sta->wpa_sm && in add_common_radius_sta_attr()
509 (wpa_key_mgmt_ft(wpa_auth_sta_key_mgmt(sta->wpa_sm)) || in add_common_radius_sta_attr()
510 sta->auth_alg == WLAN_AUTH_FT) && in add_common_radius_sta_attr()
521 if ((hapd->conf->wpa || hapd->conf->osen) && sta->wpa_sm && in add_common_radius_sta_attr()
522 add_common_radius_sta_attr_rsn(hapd, req_attr, sta, msg) < 0) in add_common_radius_sta_attr()
531 struct sta_info *sta, in add_common_radius_attr() argument
605 if (sta && add_common_radius_sta_attr(hapd, req_attr, sta, msg) < 0) in add_common_radius_attr()
621 int add_sqlite_radius_attr(struct hostapd_data *hapd, struct sta_info *sta, in add_sqlite_radius_attr() argument
633 os_snprintf(addrtxt, sizeof(addrtxt), MACSTR, MAC2STR(sta->addr)); in add_sqlite_radius_attr()
679 struct sta_info *sta, in ieee802_1x_encapsulate_radius() argument
683 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_encapsulate_radius()
712 if (add_common_radius_attr(hapd, hapd->conf->radius_auth_req_attr, sta, in ieee802_1x_encapsulate_radius()
716 if (sta && add_sqlite_radius_attr(hapd, sta, msg, 0) < 0) in ieee802_1x_encapsulate_radius()
781 if (sta->hs20_ie && wpabuf_len(sta->hs20_ie) > 0) { in ieee802_1x_encapsulate_radius()
786 pos = wpabuf_head_u8(sta->hs20_ie); in ieee802_1x_encapsulate_radius()
789 wpabuf_len(sta->hs20_ie) >= 3) in ieee802_1x_encapsulate_radius()
804 if (sta->roaming_consortium && in ieee802_1x_encapsulate_radius()
807 wpabuf_head(sta->roaming_consortium), in ieee802_1x_encapsulate_radius()
808 wpabuf_len(sta->roaming_consortium))) { in ieee802_1x_encapsulate_radius()
841 if (radius_client_send(hapd->radius, msg, RADIUS_AUTH, sta->addr) < 0) in ieee802_1x_encapsulate_radius()
853 struct sta_info *sta, struct eap_hdr *eap, in handle_eap_response() argument
857 struct eapol_state_machine *sm = sta->eapol_sm; in handle_eap_response()
886 struct sta_info *sta, struct eap_hdr *eap, in handle_eap_initiate() argument
891 struct eapol_state_machine *sm = sta->eapol_sm; in handle_eap_initiate()
941 static void handle_eap(struct hostapd_data *hapd, struct sta_info *sta, in handle_eap() argument
973 handle_eap_response(hapd, sta, eap, eap_len); in handle_eap()
976 handle_eap_initiate(hapd, sta, eap, eap_len); in handle_eap()
983 ieee802_1x_alloc_eapol_sm(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_alloc_eapol_sm() argument
987 if (sta->flags & WLAN_STA_PREAUTH) in ieee802_1x_alloc_eapol_sm()
989 if (sta->wpa_sm) { in ieee802_1x_alloc_eapol_sm()
991 if (wpa_auth_sta_get_pmksa(sta->wpa_sm)) in ieee802_1x_alloc_eapol_sm()
994 return eapol_auth_alloc(hapd->eapol_auth, sta->addr, flags, in ieee802_1x_alloc_eapol_sm()
995 sta->wps_ie, sta->p2p_ie, sta, in ieee802_1x_alloc_eapol_sm()
996 sta->identity, sta->radius_cui); in ieee802_1x_alloc_eapol_sm()
1000 static void ieee802_1x_save_eapol(struct sta_info *sta, const u8 *buf, in ieee802_1x_save_eapol() argument
1003 if (sta->pending_eapol_rx) { in ieee802_1x_save_eapol()
1004 wpabuf_free(sta->pending_eapol_rx->buf); in ieee802_1x_save_eapol()
1006 sta->pending_eapol_rx = in ieee802_1x_save_eapol()
1007 os_malloc(sizeof(*sta->pending_eapol_rx)); in ieee802_1x_save_eapol()
1008 if (!sta->pending_eapol_rx) in ieee802_1x_save_eapol()
1012 sta->pending_eapol_rx->buf = wpabuf_alloc_copy(buf, len); in ieee802_1x_save_eapol()
1013 if (!sta->pending_eapol_rx->buf) { in ieee802_1x_save_eapol()
1014 os_free(sta->pending_eapol_rx); in ieee802_1x_save_eapol()
1015 sta->pending_eapol_rx = NULL; in ieee802_1x_save_eapol()
1019 os_get_reltime(&sta->pending_eapol_rx->rx_time); in ieee802_1x_save_eapol()
1035 struct sta_info *sta; in ieee802_1x_receive() local
1048 sta = ap_get_sta(hapd, sa); in ieee802_1x_receive()
1049 if (!sta || (!(sta->flags & (WLAN_STA_ASSOC | WLAN_STA_PREAUTH)) && in ieee802_1x_receive()
1054 if (sta && (sta->flags & WLAN_STA_AUTH)) { in ieee802_1x_receive()
1056 " for later use", MAC2STR(sta->addr)); in ieee802_1x_receive()
1057 ieee802_1x_save_eapol(sta, buf, len); in ieee802_1x_receive()
1076 if (sta->eapol_sm) in ieee802_1x_receive()
1077 sta->eapol_sm->dot1xAuthEapLengthErrorFramesRx++; in ieee802_1x_receive()
1086 if (sta->eapol_sm) { in ieee802_1x_receive()
1087 sta->eapol_sm->dot1xAuthLastEapolFrameVersion = hdr->version; in ieee802_1x_receive()
1088 sta->eapol_sm->dot1xAuthEapolFramesRx++; in ieee802_1x_receive()
1096 wpa_receive(hapd->wpa_auth, sta->wpa_sm, (u8 *) hdr, in ieee802_1x_receive()
1102 !(sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS))) { in ieee802_1x_receive()
1108 key_mgmt = wpa_auth_sta_key_mgmt(sta->wpa_sm); in ieee802_1x_receive()
1117 if (!sta->eapol_sm) { in ieee802_1x_receive()
1118 sta->eapol_sm = ieee802_1x_alloc_eapol_sm(hapd, sta); in ieee802_1x_receive()
1119 if (!sta->eapol_sm) in ieee802_1x_receive()
1124 u32 wflags = sta->flags & (WLAN_STA_WPS | in ieee802_1x_receive()
1138 sta->eapol_sm->flags |= EAPOL_SM_WAIT_START; in ieee802_1x_receive()
1143 sta->eapol_sm->eap_if->portEnabled = true; in ieee802_1x_receive()
1155 handle_eap(hapd, sta, (u8 *) (hdr + 1), datalen); in ieee802_1x_receive()
1159 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_receive()
1162 sta->eapol_sm->flags &= ~EAPOL_SM_WAIT_START; in ieee802_1x_receive()
1163 pmksa = wpa_auth_sta_get_pmksa(sta->wpa_sm); in ieee802_1x_receive()
1165 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_WPA, in ieee802_1x_receive()
1168 wpa_auth_sta_clear_pmksa(sta->wpa_sm, pmksa); in ieee802_1x_receive()
1170 sta->eapol_sm->eapolStart = true; in ieee802_1x_receive()
1171 sta->eapol_sm->dot1xAuthEapolStartFramesRx++; in ieee802_1x_receive()
1172 eap_server_clear_identity(sta->eapol_sm->eap); in ieee802_1x_receive()
1173 wpa_auth_sm_event(sta->wpa_sm, WPA_REAUTH_EAPOL); in ieee802_1x_receive()
1177 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_receive()
1180 sta->acct_terminate_cause = in ieee802_1x_receive()
1182 accounting_sta_stop(hapd, sta); in ieee802_1x_receive()
1183 sta->eapol_sm->eapolLogoff = true; in ieee802_1x_receive()
1184 sta->eapol_sm->dot1xAuthEapolLogoffFramesRx++; in ieee802_1x_receive()
1185 eap_server_clear_identity(sta->eapol_sm->eap); in ieee802_1x_receive()
1190 if (!ap_sta_is_authorized(sta)) { in ieee802_1x_receive()
1211 sta->eapol_sm->dot1xAuthInvalidEapolFramesRx++; in ieee802_1x_receive()
1215 eapol_auth_step(sta->eapol_sm); in ieee802_1x_receive()
1227 void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_new_station() argument
1236 ((hapd->conf->wpa && (sta->flags & WLAN_STA_MAYBE_WPS)) || in ieee802_1x_new_station()
1237 (sta->flags & WLAN_STA_WPS))) { in ieee802_1x_new_station()
1254 ieee802_1x_free_station(hapd, sta); in ieee802_1x_new_station()
1258 key_mgmt = wpa_auth_sta_key_mgmt(sta->wpa_sm); in ieee802_1x_new_station()
1267 ieee802_1x_free_station(hapd, sta); in ieee802_1x_new_station()
1271 if (!sta->eapol_sm) { in ieee802_1x_new_station()
1272 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1274 sta->eapol_sm = ieee802_1x_alloc_eapol_sm(hapd, sta); in ieee802_1x_new_station()
1275 if (!sta->eapol_sm) { in ieee802_1x_new_station()
1276 hostapd_logger(hapd, sta->addr, in ieee802_1x_new_station()
1286 sta->eapol_sm->flags &= ~EAPOL_SM_WAIT_START; in ieee802_1x_new_station()
1288 !(sta->flags & WLAN_STA_WPS2)) { in ieee802_1x_new_station()
1296 sta->eapol_sm->flags |= EAPOL_SM_WAIT_START; in ieee802_1x_new_station()
1300 sta->eapol_sm->eap_if->portEnabled = true; in ieee802_1x_new_station()
1303 if (sta->auth_alg == WLAN_AUTH_FT) { in ieee802_1x_new_station()
1304 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1309 sta->eapol_sm->keyRun = true; in ieee802_1x_new_station()
1310 sta->eapol_sm->eap_if->eapKeyAvailable = true; in ieee802_1x_new_station()
1311 sta->eapol_sm->auth_pae_state = AUTH_PAE_AUTHENTICATING; in ieee802_1x_new_station()
1312 sta->eapol_sm->be_auth_state = BE_AUTH_SUCCESS; in ieee802_1x_new_station()
1313 sta->eapol_sm->authSuccess = true; in ieee802_1x_new_station()
1314 sta->eapol_sm->authFail = false; in ieee802_1x_new_station()
1315 sta->eapol_sm->portValid = true; in ieee802_1x_new_station()
1316 if (sta->eapol_sm->eap) in ieee802_1x_new_station()
1317 eap_sm_notify_cached(sta->eapol_sm->eap); in ieee802_1x_new_station()
1318 ap_sta_bind_vlan(hapd, sta); in ieee802_1x_new_station()
1324 if (sta->auth_alg == WLAN_AUTH_FILS_SK || in ieee802_1x_new_station()
1325 sta->auth_alg == WLAN_AUTH_FILS_SK_PFS || in ieee802_1x_new_station()
1326 sta->auth_alg == WLAN_AUTH_FILS_PK) { in ieee802_1x_new_station()
1327 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1332 sta->eapol_sm->keyRun = true; in ieee802_1x_new_station()
1333 sta->eapol_sm->eap_if->eapKeyAvailable = true; in ieee802_1x_new_station()
1334 sta->eapol_sm->auth_pae_state = AUTH_PAE_AUTHENTICATING; in ieee802_1x_new_station()
1335 sta->eapol_sm->be_auth_state = BE_AUTH_SUCCESS; in ieee802_1x_new_station()
1336 sta->eapol_sm->authSuccess = true; in ieee802_1x_new_station()
1337 sta->eapol_sm->authFail = false; in ieee802_1x_new_station()
1338 sta->eapol_sm->portValid = true; in ieee802_1x_new_station()
1339 if (sta->eapol_sm->eap) in ieee802_1x_new_station()
1340 eap_sm_notify_cached(sta->eapol_sm->eap); in ieee802_1x_new_station()
1341 wpa_auth_set_ptk_rekey_timer(sta->wpa_sm); in ieee802_1x_new_station()
1346 pmksa = wpa_auth_sta_get_pmksa(sta->wpa_sm); in ieee802_1x_new_station()
1348 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1353 sta->eapol_sm->keyRun = true; in ieee802_1x_new_station()
1354 sta->eapol_sm->eap_if->eapKeyAvailable = true; in ieee802_1x_new_station()
1355 sta->eapol_sm->auth_pae_state = AUTH_PAE_AUTHENTICATING; in ieee802_1x_new_station()
1356 sta->eapol_sm->be_auth_state = BE_AUTH_SUCCESS; in ieee802_1x_new_station()
1357 sta->eapol_sm->authSuccess = true; in ieee802_1x_new_station()
1358 sta->eapol_sm->authFail = false; in ieee802_1x_new_station()
1359 if (sta->eapol_sm->eap) in ieee802_1x_new_station()
1360 eap_sm_notify_cached(sta->eapol_sm->eap); in ieee802_1x_new_station()
1361 pmksa_cache_to_eapol_data(hapd, pmksa, sta->eapol_sm); in ieee802_1x_new_station()
1362 ap_sta_bind_vlan(hapd, sta); in ieee802_1x_new_station()
1370 sta->eapol_sm->reAuthenticate = true; in ieee802_1x_new_station()
1372 eapol_auth_step(sta->eapol_sm); in ieee802_1x_new_station()
1377 void ieee802_1x_free_station(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_free_station() argument
1379 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_free_station()
1382 eloop_cancel_timeout(ieee802_1x_wnm_notif_send, hapd, sta); in ieee802_1x_free_station()
1385 if (sta->pending_eapol_rx) { in ieee802_1x_free_station()
1386 wpabuf_free(sta->pending_eapol_rx->buf); in ieee802_1x_free_station()
1387 os_free(sta->pending_eapol_rx); in ieee802_1x_free_station()
1388 sta->pending_eapol_rx = NULL; in ieee802_1x_free_station()
1394 sta->eapol_sm = NULL; in ieee802_1x_free_station()
1407 struct sta_info *sta) in ieee802_1x_decapsulate_radius() argument
1414 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_decapsulate_radius()
1429 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_decapsulate_radius()
1437 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_decapsulate_radius()
1471 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_decapsulate_radius()
1484 struct sta_info *sta, struct radius_msg *msg, in ieee802_1x_get_keys() argument
1492 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_get_keys()
1547 struct sta_info *sta, in ieee802_1x_store_radius_class() argument
1552 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_store_radius_class()
1596 MAC2STR(sta->addr)); in ieee802_1x_store_radius_class()
1602 struct sta_info *sta, in ieee802_1x_update_sta_identity() argument
1607 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_update_sta_identity()
1620 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_update_sta_identity()
1634 struct sta_info *sta, in ieee802_1x_update_sta_cui() argument
1637 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_update_sta_cui()
1660 static void ieee802_1x_hs20_sub_rem(struct sta_info *sta, u8 *pos, size_t len) in ieee802_1x_hs20_sub_rem() argument
1662 sta->remediation = 1; in ieee802_1x_hs20_sub_rem()
1663 os_free(sta->remediation_url); in ieee802_1x_hs20_sub_rem()
1665 sta->remediation_url = os_malloc(len); in ieee802_1x_hs20_sub_rem()
1666 if (!sta->remediation_url) in ieee802_1x_hs20_sub_rem()
1668 sta->remediation_method = pos[0]; in ieee802_1x_hs20_sub_rem()
1669 os_memcpy(sta->remediation_url, pos + 1, len - 1); in ieee802_1x_hs20_sub_rem()
1670 sta->remediation_url[len - 1] = '\0'; in ieee802_1x_hs20_sub_rem()
1674 MAC2STR(sta->addr), sta->remediation_method, in ieee802_1x_hs20_sub_rem()
1675 sta->remediation_url); in ieee802_1x_hs20_sub_rem()
1677 sta->remediation_url = NULL; in ieee802_1x_hs20_sub_rem()
1680 MACSTR, MAC2STR(sta->addr)); in ieee802_1x_hs20_sub_rem()
1687 struct sta_info *sta, u8 *pos, in ieee802_1x_hs20_deauth_req() argument
1692 sta->hs20_deauth_requested = 1; in ieee802_1x_hs20_deauth_req()
1696 wpabuf_free(sta->hs20_deauth_req); in ieee802_1x_hs20_deauth_req()
1697 sta->hs20_deauth_req = wpabuf_alloc(len + 1); in ieee802_1x_hs20_deauth_req()
1698 if (sta->hs20_deauth_req) { in ieee802_1x_hs20_deauth_req()
1699 wpabuf_put_data(sta->hs20_deauth_req, pos, 3); in ieee802_1x_hs20_deauth_req()
1700 wpabuf_put_u8(sta->hs20_deauth_req, len - 3); in ieee802_1x_hs20_deauth_req()
1701 wpabuf_put_data(sta->hs20_deauth_req, pos + 3, len - 3); in ieee802_1x_hs20_deauth_req()
1703 ap_sta_session_timeout(hapd, sta, hapd->conf->hs20_deauth_req_timeout); in ieee802_1x_hs20_deauth_req()
1708 struct sta_info *sta, u8 *pos, in ieee802_1x_hs20_session_info() argument
1716 os_free(sta->hs20_session_info_url); in ieee802_1x_hs20_session_info()
1717 sta->hs20_session_info_url = os_malloc(len); in ieee802_1x_hs20_session_info()
1718 if (!sta->hs20_session_info_url) in ieee802_1x_hs20_session_info()
1721 os_memcpy(sta->hs20_session_info_url, pos + 1, len - 1); in ieee802_1x_hs20_session_info()
1722 sta->hs20_session_info_url[len - 1] = '\0'; in ieee802_1x_hs20_session_info()
1725 sta->hs20_session_info_url, swt, session_timeout); in ieee802_1x_hs20_session_info()
1742 sta->hs20_disassoc_timer = swt * 60 * 1000 / beacon_int * 125 / 128; in ieee802_1x_hs20_session_info()
1743 if (sta->hs20_disassoc_timer > 65535) in ieee802_1x_hs20_session_info()
1744 sta->hs20_disassoc_timer = 65535; in ieee802_1x_hs20_session_info()
1746 ap_sta_session_warning_timeout(hapd, sta, warning_time); in ieee802_1x_hs20_session_info()
1751 struct sta_info *sta, u8 *pos, in ieee802_1x_hs20_t_c_filtering() argument
1759 hs20_t_c_filtering(hapd, sta, pos[0] & BIT(0)); in ieee802_1x_hs20_t_c_filtering()
1764 struct sta_info *sta, u8 *pos, size_t len) in ieee802_1x_hs20_t_c_url() argument
1766 os_free(sta->t_c_url); in ieee802_1x_hs20_t_c_url()
1767 sta->t_c_url = os_malloc(len + 1); in ieee802_1x_hs20_t_c_url()
1768 if (!sta->t_c_url) in ieee802_1x_hs20_t_c_url()
1770 os_memcpy(sta->t_c_url, pos, len); in ieee802_1x_hs20_t_c_url()
1771 sta->t_c_url[len] = '\0'; in ieee802_1x_hs20_t_c_url()
1773 "HS 2.0: Terms and Conditions URL %s", sta->t_c_url); in ieee802_1x_hs20_t_c_url()
1780 struct sta_info *sta, in ieee802_1x_check_hs20() argument
1789 sta->remediation = 0; in ieee802_1x_check_hs20()
1790 sta->hs20_deauth_requested = 0; in ieee802_1x_check_hs20()
1814 ieee802_1x_hs20_sub_rem(sta, pos, sublen); in ieee802_1x_check_hs20()
1817 ieee802_1x_hs20_deauth_req(hapd, sta, pos, sublen); in ieee802_1x_check_hs20()
1820 ieee802_1x_hs20_session_info(hapd, sta, pos, sublen, in ieee802_1x_check_hs20()
1824 ieee802_1x_hs20_t_c_filtering(hapd, sta, pos, sublen); in ieee802_1x_check_hs20()
1827 ieee802_1x_hs20_t_c_url(hapd, sta, pos, sublen); in ieee802_1x_check_hs20()
1842 struct sta_info *sta, in ieee802_1x_select_radius_identifier() argument
1846 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_select_radius_identifier()
1872 struct sta_info *sta) in ieee802_1x_update_vlan() argument
1883 sta->eapol_sm->authFail = true; in ieee802_1x_update_vlan()
1884 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS, in ieee802_1x_update_vlan()
1890 ap_sta_set_vlan(hapd, sta, &vlan_desc); in ieee802_1x_update_vlan()
1896 sta->eapol_sm->authFail = true; in ieee802_1x_update_vlan()
1897 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_update_vlan()
1903 return ap_sta_set_vlan(hapd, sta, &vlan_desc); in ieee802_1x_update_vlan()
1923 struct sta_info *sta; in ieee802_1x_receive_auth() local
1937 sta = sm->sta; in ieee802_1x_receive_auth()
1963 MAC2STR(sta->addr)); in ieee802_1x_receive_auth()
1980 hostapd_logger(hapd, sta->addr, in ieee802_1x_receive_auth()
1986 sta->acct_interim_interval = acct_interim_interval; in ieee802_1x_receive_auth()
1994 ieee802_1x_update_vlan(msg, hapd, sta) < 0) in ieee802_1x_receive_auth()
1997 if (sta->vlan_id > 0) { in ieee802_1x_receive_auth()
1998 hostapd_logger(hapd, sta->addr, in ieee802_1x_receive_auth()
2001 "VLAN ID %d", sta->vlan_id); in ieee802_1x_receive_auth()
2004 if ((sta->flags & WLAN_STA_ASSOC) && in ieee802_1x_receive_auth()
2005 ap_sta_bind_vlan(hapd, sta) < 0) in ieee802_1x_receive_auth()
2009 sta->session_timeout_set = !!session_timeout_set; in ieee802_1x_receive_auth()
2010 os_get_reltime(&sta->session_timeout); in ieee802_1x_receive_auth()
2011 sta->session_timeout.sec += session_timeout; in ieee802_1x_receive_auth()
2018 ap_sta_session_timeout(hapd, sta, session_timeout); in ieee802_1x_receive_auth()
2020 ap_sta_no_session_timeout(hapd, sta); in ieee802_1x_receive_auth()
2024 ieee802_1x_get_keys(hapd, sta, msg, req, shared_secret, in ieee802_1x_receive_auth()
2026 ieee802_1x_store_radius_class(hapd, sta, msg); in ieee802_1x_receive_auth()
2027 ieee802_1x_update_sta_identity(hapd, sta, msg); in ieee802_1x_receive_auth()
2028 ieee802_1x_update_sta_cui(hapd, sta, msg); in ieee802_1x_receive_auth()
2029 ieee802_1x_check_hs20(hapd, sta, msg, in ieee802_1x_receive_auth()
2040 MACSTR, reason_code, MAC2STR(sta->addr)); in ieee802_1x_receive_auth()
2041 sta->disconnect_reason_code = reason_code; in ieee802_1x_receive_auth()
2064 ieee802_1x_decapsulate_radius(hapd, sta); in ieee802_1x_receive_auth()
2070 if (sta->flags & WLAN_STA_PENDING_FILS_ERP) { in ieee802_1x_receive_auth()
2073 hapd, sta, hdr->code == RADIUS_CODE_ACCESS_ACCEPT, in ieee802_1x_receive_auth()
2088 void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_abort_auth() argument
2090 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_abort_auth()
2095 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_abort_auth()
2110 MAC2STR(sta->addr)); in ieee802_1x_abort_auth()
2113 ap_sta_disconnect(hapd, sta, sta->addr, in ieee802_1x_abort_auth()
2148 struct sta_info *sta, void *ctx) in ieee802_1x_sta_key_available() argument
2150 if (sta->eapol_sm) { in ieee802_1x_sta_key_available()
2151 sta->eapol_sm->eap_if->eapKeyAvailable = true; in ieee802_1x_sta_key_available()
2152 eapol_auth_step(sta->eapol_sm); in ieee802_1x_sta_key_available()
2212 struct sta_info *sta = sta_ctx; in ieee802_1x_eapol_send() local
2214 if ((sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS)) == in ieee802_1x_eapol_send()
2218 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_eapol_send()
2230 sta->flags |= WLAN_STA_WPS; in ieee802_1x_eapol_send()
2244 struct sta_info *sta = sta_ctx; in ieee802_1x_aaa_send() local
2246 ieee802_1x_encapsulate_radius(hapd, sta, data, datalen); in ieee802_1x_aaa_send()
2255 struct sta_info *sta = sta_ctx; in _ieee802_1x_finished() local
2258 rsn_preauth_finished(hapd, sta, success); in _ieee802_1x_finished()
2260 ieee802_1x_finished(hapd, sta, success, remediation); in _ieee802_1x_finished()
2316 struct sta_info *sta; in ieee802_1x_sta_entry_alive() local
2318 sta = ap_get_sta(hapd, addr); in ieee802_1x_sta_entry_alive()
2319 if (!sta || !sta->eapol_sm) in ieee802_1x_sta_entry_alive()
2355 struct sta_info *sta = sta_ctx; in ieee802_1x_set_port_authorized() local
2357 ieee802_1x_set_sta_authorized(hapd, sta, authorized); in ieee802_1x_set_port_authorized()
2364 struct sta_info *sta = sta_ctx; in _ieee802_1x_abort_auth() local
2366 ieee802_1x_abort_auth(hapd, sta); in _ieee802_1x_abort_auth()
2376 struct sta_info *sta = sta_ctx; in _ieee802_1x_tx_key() local
2378 ieee802_1x_tx_key(hapd, sta); in _ieee802_1x_tx_key()
2389 struct sta_info *sta = sta_ctx; in ieee802_1x_eapol_event() local
2393 wpa_auth_sm_notify(sta->wpa_sm); in ieee802_1x_eapol_event()
2396 wpa_auth_sm_event(sta->wpa_sm, WPA_REAUTH_EAPOL); in ieee802_1x_eapol_event()
2532 int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_tx_status() argument
2540 if (!sta) in ieee802_1x_tx_status()
2554 return ieee802_1x_eapol_tx_status(hapd, sta, pos, buf + len - pos, in ieee802_1x_tx_status()
2559 int ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_eapol_tx_status() argument
2571 MAC2STR(sta->addr), xhdr->version, xhdr->type, in ieee802_1x_eapol_tx_status()
2576 (sta->flags & WLAN_STA_WPS) && in ieee802_1x_eapol_tx_status()
2577 ap_sta_pending_delayed_1x_auth_fail_disconnect(hapd, sta)) { in ieee802_1x_eapol_tx_status()
2594 sta->wpa_sm, ack); in ieee802_1x_eapol_tx_status()
2604 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_eapol_tx_status()
2722 int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_get_mib_sta() argument
2726 struct eapol_state_machine *sm = sta->eapol_sm; in ieee802_1x_get_mib_sta()
2741 sta->aid, in ieee802_1x_get_mib_sta()
2845 os_reltime_age(&sta->acct_session_start, &diff); in ieee802_1x_get_mib_sta()
2864 (unsigned long long) sta->acct_session_id, in ieee802_1x_get_mib_sta()
2866 wpa_auth_sta_key_mgmt(sta->wpa_sm))) ? in ieee802_1x_get_mib_sta()
2905 struct sta_info *sta = timeout_ctx; in ieee802_1x_wnm_notif_send() local
2907 if (sta->remediation) { in ieee802_1x_wnm_notif_send()
2910 MAC2STR(sta->addr)); in ieee802_1x_wnm_notif_send()
2911 hs20_send_wnm_notification(hapd, sta->addr, in ieee802_1x_wnm_notif_send()
2912 sta->remediation_method, in ieee802_1x_wnm_notif_send()
2913 sta->remediation_url); in ieee802_1x_wnm_notif_send()
2914 os_free(sta->remediation_url); in ieee802_1x_wnm_notif_send()
2915 sta->remediation_url = NULL; in ieee802_1x_wnm_notif_send()
2918 if (sta->hs20_deauth_req) { in ieee802_1x_wnm_notif_send()
2921 MAC2STR(sta->addr)); in ieee802_1x_wnm_notif_send()
2922 hs20_send_wnm_notification_deauth_req(hapd, sta->addr, in ieee802_1x_wnm_notif_send()
2923 sta->hs20_deauth_req); in ieee802_1x_wnm_notif_send()
2926 if (sta->hs20_t_c_filtering) { in ieee802_1x_wnm_notif_send()
2929 MAC2STR(sta->addr)); in ieee802_1x_wnm_notif_send()
2930 hs20_send_wnm_notification_t_c(hapd, sta->addr, sta->t_c_url); in ieee802_1x_wnm_notif_send()
2931 os_free(sta->t_c_url); in ieee802_1x_wnm_notif_send()
2932 sta->t_c_url = NULL; in ieee802_1x_wnm_notif_send()
2939 struct sta_info *sta, int success, in ieee802_1x_finished() argument
2950 if (remediation && !sta->remediation) { in ieee802_1x_finished()
2951 sta->remediation = 1; in ieee802_1x_finished()
2952 os_free(sta->remediation_url); in ieee802_1x_finished()
2953 sta->remediation_url = in ieee802_1x_finished()
2955 sta->remediation_method = 1; /* SOAP-XML SPP */ in ieee802_1x_finished()
2958 if (success && (sta->remediation || sta->hs20_deauth_req || in ieee802_1x_finished()
2959 sta->hs20_t_c_filtering)) { in ieee802_1x_finished()
2961 MACSTR " in 100 ms", MAC2STR(sta->addr)); in ieee802_1x_finished()
2962 eloop_cancel_timeout(ieee802_1x_wnm_notif_send, hapd, sta); in ieee802_1x_finished()
2964 hapd, sta); in ieee802_1x_finished()
2969 ieee802_1x_notify_create_actor_hapd(hapd, sta); in ieee802_1x_finished()
2972 key = ieee802_1x_get_key(sta->eapol_sm, &len); in ieee802_1x_finished()
2973 if (sta->session_timeout_set) { in ieee802_1x_finished()
2975 os_reltime_sub(&sta->session_timeout, &now, &remaining); in ieee802_1x_finished()
2980 if (success && key && len >= PMK_LEN && !sta->remediation && in ieee802_1x_finished()
2981 !sta->hs20_deauth_requested && in ieee802_1x_finished()
2982 wpa_auth_pmksa_add(sta->wpa_sm, key, len, session_timeout, in ieee802_1x_finished()
2983 sta->eapol_sm) == 0) { in ieee802_1x_finished()
2984 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_WPA, in ieee802_1x_finished()
3000 ap_sta_delayed_1x_auth_fail_disconnect(hapd, sta); in ieee802_1x_finished()