Lines Matching refs:hapd

46 static bool ieee802_1x_finished(struct hostapd_data *hapd,
51 static void ieee802_1x_send(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_send() argument
68 xhdr->version = hapd->conf->eapol_version; in ieee802_1x_send()
70 if (xhdr->version > 2 && hapd->conf->macsec_policy == 0) in ieee802_1x_send()
82 if (hapd->ext_eapol_frame_io) { in ieee802_1x_send()
88 wpa_msg(hapd->msg_ctx, MSG_INFO, in ieee802_1x_send()
96 rsn_preauth_send(hapd, sta, buf, len); in ieee802_1x_send()
101 link_id = hapd->conf->mld_ap ? hapd->mld_link_id : -1; in ieee802_1x_send()
104 hapd, sta->addr, buf, len, in ieee802_1x_send()
112 static void ieee802_1x_set_authorized(struct hostapd_data *hapd, in ieee802_1x_set_authorized() argument
122 update = ap_sta_set_authorized_flag(hapd, sta, authorized); in ieee802_1x_set_authorized()
123 res = hostapd_set_authorized(hapd, sta, authorized); in ieee802_1x_set_authorized()
125 ap_sta_set_authorized_event(hapd, sta, authorized); in ieee802_1x_set_authorized()
126 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_set_authorized()
142 accounting_sta_start(hapd, sta); in ieee802_1x_set_authorized()
147 static void ieee802_1x_ml_set_sta_authorized(struct hostapd_data *hapd, in ieee802_1x_ml_set_sta_authorized() argument
154 if (!hostapd_is_mld_ap(hapd)) in ieee802_1x_ml_set_sta_authorized()
161 if (authorized && hapd->mld_link_id != sta->mld_assoc_link_id) in ieee802_1x_ml_set_sta_authorized()
170 for (i = 0; i < hapd->iface->interfaces->count; i++) { in ieee802_1x_ml_set_sta_authorized()
173 hapd->iface->interfaces->iface[i]->bss[0]; in ieee802_1x_ml_set_sta_authorized()
175 if (!hostapd_is_ml_partner(hapd, tmp_hapd)) in ieee802_1x_ml_set_sta_authorized()
197 void ieee802_1x_set_sta_authorized(struct hostapd_data *hapd, in ieee802_1x_set_sta_authorized() argument
200 ieee802_1x_set_authorized(hapd, sta, authorized, false); in ieee802_1x_set_sta_authorized()
201 ieee802_1x_ml_set_sta_authorized(hapd, sta, !!authorized); in ieee802_1x_set_sta_authorized()
209 static void ieee802_1x_tx_key_one(struct hostapd_data *hapd, in ieee802_1x_tx_key_one() argument
234 hapd->last_1x_eapol_key_replay_counter, in ieee802_1x_tx_key_one()
238 inc_byte_array(hapd->last_1x_eapol_key_replay_counter, in ieee802_1x_tx_key_one()
241 hapd->last_1x_eapol_key_replay_counter, in ieee802_1x_tx_key_one()
244 os_memcpy(hapd->last_1x_eapol_key_replay_counter, in ieee802_1x_tx_key_one()
256 if (hapd->conf->eapol_key_index_workaround) { in ieee802_1x_tx_key_one()
287 hdr->version = hapd->conf->eapol_version; in ieee802_1x_tx_key_one()
300 ieee802_1x_send(hapd, sta, IEEE802_1X_TYPE_EAPOL_KEY, (u8 *) key, len); in ieee802_1x_tx_key_one()
307 static void ieee802_1x_tx_key(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_tx_key() argument
309 struct eapol_authenticator *eapol = hapd->eapol_auth; in ieee802_1x_tx_key()
326 ieee802_1x_tx_key_one(hapd, sta, eapol->default_wep_key_idx, 1, in ieee802_1x_tx_key()
328 hapd->conf->default_wep_key_len); in ieee802_1x_tx_key()
331 if (hapd->conf->individual_wep_key_len > 0) { in ieee802_1x_tx_key()
334 ikey = os_malloc(hapd->conf->individual_wep_key_len); in ieee802_1x_tx_key()
336 random_get_bytes(ikey, hapd->conf->individual_wep_key_len)) in ieee802_1x_tx_key()
345 ikey, hapd->conf->individual_wep_key_len); in ieee802_1x_tx_key()
347 ieee802_1x_tx_key_one(hapd, sta, 0, 0, ikey, in ieee802_1x_tx_key()
348 hapd->conf->individual_wep_key_len); in ieee802_1x_tx_key()
352 if (hostapd_drv_set_key(hapd->conf->iface, hapd, WPA_ALG_WEP, in ieee802_1x_tx_key()
354 hapd->conf->individual_wep_key_len, in ieee802_1x_tx_key()
369 const char *radius_mode_txt(struct hostapd_data *hapd) in radius_mode_txt() argument
371 switch (hapd->iface->conf->hw_mode) { in radius_mode_txt()
385 int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta) in radius_sta_rate() argument
399 static void ieee802_1x_learn_identity(struct hostapd_data *hapd, in ieee802_1x_learn_identity() argument
430 hostapd_logger(hapd, sm->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_learn_identity()
436 static int add_common_radius_sta_attr_rsn(struct hostapd_data *hapd, in add_common_radius_sta_attr_rsn() argument
456 suite = wpa_cipher_to_suite(((hapd->conf->wpa & 0x2) || in add_common_radius_sta_attr_rsn()
457 hapd->conf->osen) ? in add_common_radius_sta_attr_rsn()
459 hapd->conf->wpa_group); in add_common_radius_sta_attr_rsn()
479 if (hapd->conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) { in add_common_radius_sta_attr_rsn()
481 hapd->conf->group_mgmt_cipher); in add_common_radius_sta_attr_rsn()
496 static int add_common_radius_sta_attr(struct hostapd_data *hapd, in add_common_radius_sta_attr() argument
533 radius_sta_rate(hapd, sta) / 2, in add_common_radius_sta_attr()
534 (radius_sta_rate(hapd, sta) & 1) ? ".5" : "", in add_common_radius_sta_attr()
535 radius_mode_txt(hapd)); in add_common_radius_sta_attr()
556 if ((hapd->conf->wpa & 2) && in add_common_radius_sta_attr()
557 !hapd->conf->disable_pmksa_caching && in add_common_radius_sta_attr()
572 if (hapd->conf->wpa && wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt) && in add_common_radius_sta_attr()
580 hapd->conf->mobility_domain))) { in add_common_radius_sta_attr()
586 if ((hapd->conf->wpa || hapd->conf->osen) && sta->wpa_sm && in add_common_radius_sta_attr()
587 add_common_radius_sta_attr_rsn(hapd, req_attr, sta, msg) < 0) in add_common_radius_sta_attr()
594 int add_common_radius_attr(struct hostapd_data *hapd, in add_common_radius_attr() argument
605 hapd->conf->own_ip_addr.af == AF_INET && in add_common_radius_attr()
607 (u8 *) &hapd->conf->own_ip_addr.u.v4, 4)) { in add_common_radius_attr()
615 hapd->conf->own_ip_addr.af == AF_INET6 && in add_common_radius_attr()
617 (u8 *) &hapd->conf->own_ip_addr.u.v6, 16)) { in add_common_radius_attr()
625 hapd->conf->nas_identifier && in add_common_radius_attr()
627 (u8 *) hapd->conf->nas_identifier, in add_common_radius_attr()
628 os_strlen(hapd->conf->nas_identifier))) { in add_common_radius_attr()
634 MAC2STR(hapd->own_addr)); in add_common_radius_attr()
635 os_memcpy(&buf[len], hapd->conf->ssid.ssid, in add_common_radius_attr()
636 hapd->conf->ssid.ssid_len); in add_common_radius_attr()
637 len += hapd->conf->ssid.ssid_len; in add_common_radius_attr()
655 if (hapd->conf->interworking && in add_common_radius_attr()
656 !is_zero_ether_addr(hapd->conf->hessid)) { in add_common_radius_attr()
658 MAC2STR(hapd->conf->hessid)); in add_common_radius_attr()
670 if (sta && add_common_radius_sta_attr(hapd, req_attr, sta, msg) < 0) in add_common_radius_attr()
686 int add_sqlite_radius_attr(struct hostapd_data *hapd, struct sta_info *sta, in add_sqlite_radius_attr() argument
695 if (!hapd->rad_attr_db) in add_sqlite_radius_attr()
701 if (sqlite3_prepare_v2(hapd->rad_attr_db, sql, os_strlen(sql), &stmt, in add_sqlite_radius_attr()
704 sqlite3_errmsg(hapd->rad_attr_db)); in add_sqlite_radius_attr()
743 void ieee802_1x_encapsulate_radius(struct hostapd_data *hapd, in ieee802_1x_encapsulate_radius() argument
753 ieee802_1x_learn_identity(hapd, sm, eap, len); in ieee802_1x_encapsulate_radius()
757 sm->radius_identifier = radius_client_get_id(hapd->radius); in ieee802_1x_encapsulate_radius()
780 if (add_common_radius_attr(hapd, hapd->conf->radius_auth_req_attr, sta, in ieee802_1x_encapsulate_radius()
784 if (sta && add_sqlite_radius_attr(hapd, sta, msg, 0) < 0) in ieee802_1x_encapsulate_radius()
790 if (!hostapd_config_get_radius_attr(hapd->conf->radius_auth_req_attr, in ieee802_1x_encapsulate_radius()
818 if (hapd->conf->radius_request_cui) { in ieee802_1x_encapsulate_radius()
838 if (hapd->conf->hs20) { in ieee802_1x_encapsulate_radius()
839 u8 ver = hapd->conf->hs20_release - 1; in ieee802_1x_encapsulate_radius()
882 if (hapd->conf->t_c_filename) { in ieee802_1x_encapsulate_radius()
888 (const u8 *) hapd->conf->t_c_filename, in ieee802_1x_encapsulate_radius()
889 os_strlen(hapd->conf->t_c_filename))) { in ieee802_1x_encapsulate_radius()
895 timestamp = host_to_be32(hapd->conf->t_c_timestamp); in ieee802_1x_encapsulate_radius()
909 if (radius_client_send(hapd->radius, msg, RADIUS_AUTH, sta->addr) < 0) in ieee802_1x_encapsulate_radius()
920 static void handle_eap_response(struct hostapd_data *hapd, in handle_eap_response() argument
939 hostapd_logger(hapd, sm->addr, HOSTAPD_MODULE_IEEE8021X, in handle_eap_response()
953 static void handle_eap_initiate(struct hostapd_data *hapd, in handle_eap_initiate() argument
972 hostapd_logger(hapd, sm->addr, HOSTAPD_MODULE_IEEE8021X, in handle_eap_initiate()
1009 static void handle_eap(struct hostapd_data *hapd, struct sta_info *sta, in handle_eap() argument
1041 handle_eap_response(hapd, sta, eap, eap_len); in handle_eap()
1044 handle_eap_initiate(hapd, sta, eap, eap_len); in handle_eap()
1051 ieee802_1x_alloc_eapol_sm(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_alloc_eapol_sm() argument
1062 return eapol_auth_alloc(hapd->eapol_auth, sta->addr, flags, in ieee802_1x_alloc_eapol_sm()
1118 void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf, in ieee802_1x_receive() argument
1128 if (!hapd->conf->ieee802_1x && !hapd->conf->wpa && !hapd->conf->osen && in ieee802_1x_receive()
1129 !hapd->conf->wps_state) in ieee802_1x_receive()
1135 sta = ap_get_sta(hapd, sa); in ieee802_1x_receive()
1137 !(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_WIRED))) { in ieee802_1x_receive()
1183 wpa_receive(hapd->wpa_auth, sta->wpa_sm, (u8 *) hdr, in ieee802_1x_receive()
1188 if (!hapd->conf->ieee802_1x && !hapd->conf->osen && in ieee802_1x_receive()
1211 sta->eapol_sm = ieee802_1x_alloc_eapol_sm(hapd, sta); in ieee802_1x_receive()
1216 if (!hapd->conf->ieee802_1x && hapd->conf->wps_state) { in ieee802_1x_receive()
1248 handle_eap(hapd, sta, (u8 *) (hdr + 1), datalen); in ieee802_1x_receive()
1252 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_receive()
1258 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_WPA, in ieee802_1x_receive()
1270 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_receive()
1275 accounting_sta_stop(hapd, sta); in ieee802_1x_receive()
1320 void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_new_station() argument
1328 if (hapd->conf->wps_state && in ieee802_1x_new_station()
1329 ((hapd->conf->wpa && (sta->flags & WLAN_STA_MAYBE_WPS)) || in ieee802_1x_new_station()
1340 if (!force_1x && !hapd->conf->ieee802_1x && !hapd->conf->osen) { in ieee802_1x_new_station()
1347 ieee802_1x_free_station(hapd, sta); in ieee802_1x_new_station()
1360 ieee802_1x_free_station(hapd, sta); in ieee802_1x_new_station()
1365 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1367 sta->eapol_sm = ieee802_1x_alloc_eapol_sm(hapd, sta); in ieee802_1x_new_station()
1369 hostapd_logger(hapd, sta->addr, in ieee802_1x_new_station()
1380 if (!hapd->conf->ieee802_1x && hapd->conf->wps_state && in ieee802_1x_new_station()
1397 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1411 ap_sta_bind_vlan(hapd, sta); in ieee802_1x_new_station()
1420 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1441 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_new_station()
1454 pmksa_cache_to_eapol_data(hapd, pmksa, sta->eapol_sm); in ieee802_1x_new_station()
1455 ap_sta_bind_vlan(hapd, sta); in ieee802_1x_new_station()
1470 void ieee802_1x_free_station(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_free_station() argument
1475 eloop_cancel_timeout(ieee802_1x_wnm_notif_send, hapd, sta); in ieee802_1x_free_station()
1499 static void ieee802_1x_decapsulate_radius(struct hostapd_data *hapd, in ieee802_1x_decapsulate_radius() argument
1522 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_decapsulate_radius()
1530 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_decapsulate_radius()
1564 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_decapsulate_radius()
1576 static void ieee802_1x_get_keys(struct hostapd_data *hapd, in ieee802_1x_get_keys() argument
1639 static void ieee802_1x_store_radius_class(struct hostapd_data *hapd, in ieee802_1x_store_radius_class() argument
1650 if (!hapd->conf->radius->acct_server || !hapd->radius || !sm) in ieee802_1x_store_radius_class()
1694 static void ieee802_1x_update_sta_identity(struct hostapd_data *hapd, in ieee802_1x_update_sta_identity() argument
1713 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_update_sta_identity()
1726 static void ieee802_1x_update_sta_cui(struct hostapd_data *hapd, in ieee802_1x_update_sta_cui() argument
1779 static void ieee802_1x_hs20_deauth_req(struct hostapd_data *hapd, in ieee802_1x_hs20_deauth_req() argument
1801 timeout = hapd->conf->hs20_deauth_req_timeout; in ieee802_1x_hs20_deauth_req()
1808 ap_sta_session_timeout(hapd, sta, timeout); in ieee802_1x_hs20_deauth_req()
1812 static void ieee802_1x_hs20_session_info(struct hostapd_data *hapd, in ieee802_1x_hs20_session_info() argument
1844 beacon_int = hapd->iconf->beacon_int; in ieee802_1x_hs20_session_info()
1851 ap_sta_session_warning_timeout(hapd, sta, warning_time); in ieee802_1x_hs20_session_info()
1855 static void ieee802_1x_hs20_t_c_filtering(struct hostapd_data *hapd, in ieee802_1x_hs20_t_c_filtering() argument
1864 hs20_t_c_filtering(hapd, sta, pos[0] & BIT(0)); in ieee802_1x_hs20_t_c_filtering()
1868 static void ieee802_1x_hs20_t_c_url(struct hostapd_data *hapd, in ieee802_1x_hs20_t_c_url() argument
1884 static void ieee802_1x_check_hs20(struct hostapd_data *hapd, in ieee802_1x_check_hs20() argument
1923 ieee802_1x_hs20_deauth_req(hapd, sta, pos, sublen); in ieee802_1x_check_hs20()
1926 ieee802_1x_hs20_session_info(hapd, sta, pos, sublen, in ieee802_1x_check_hs20()
1930 ieee802_1x_hs20_t_c_filtering(hapd, sta, pos, sublen); in ieee802_1x_check_hs20()
1933 ieee802_1x_hs20_t_c_url(hapd, sta, pos, sublen); in ieee802_1x_check_hs20()
1947 static int ieee802_1x_select_radius_identifier(struct hostapd_data *hapd, in ieee802_1x_select_radius_identifier() argument
1964 ieee802_1x_search_radius_identifier(struct hostapd_data *hapd, u8 identifier) in ieee802_1x_search_radius_identifier() argument
1970 ap_for_each_sta(hapd, ieee802_1x_select_radius_identifier, &id_search); in ieee802_1x_search_radius_identifier()
1977 struct hostapd_data *hapd, in ieee802_1x_update_vlan() argument
1988 !hostapd_vlan_valid(hapd->conf->vlan, &vlan_desc)) { in ieee802_1x_update_vlan()
1990 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS, in ieee802_1x_update_vlan()
1996 ap_sta_set_vlan(hapd, sta, &vlan_desc); in ieee802_1x_update_vlan()
2000 if (hapd->conf->ssid.dynamic_vlan == DYNAMIC_VLAN_REQUIRED && in ieee802_1x_update_vlan()
2003 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_update_vlan()
2009 return ap_sta_set_vlan(hapd, sta, &vlan_desc); in ieee802_1x_update_vlan()
2028 struct hostapd_data *hapd = data; in ieee802_1x_receive_auth() local
2037 sm = ieee802_1x_search_radius_identifier(hapd, hdr->identifier); in ieee802_1x_receive_auth()
2072 if (hapd->conf->acct_interim_interval == 0 && in ieee802_1x_receive_auth()
2077 hostapd_logger(hapd, sta->addr, in ieee802_1x_receive_auth()
2090 if (hapd->conf->ssid.dynamic_vlan != DYNAMIC_VLAN_DISABLED && in ieee802_1x_receive_auth()
2091 ieee802_1x_update_vlan(msg, hapd, sta) < 0) in ieee802_1x_receive_auth()
2095 hostapd_logger(hapd, sta->addr, in ieee802_1x_receive_auth()
2102 ap_sta_bind_vlan(hapd, sta) < 0) in ieee802_1x_receive_auth()
2115 ap_sta_session_timeout(hapd, sta, session_timeout); in ieee802_1x_receive_auth()
2117 ap_sta_no_session_timeout(hapd, sta); in ieee802_1x_receive_auth()
2121 ieee802_1x_get_keys(hapd, sta, msg, req, shared_secret, in ieee802_1x_receive_auth()
2123 ieee802_1x_store_radius_class(hapd, sta, msg); in ieee802_1x_receive_auth()
2124 ieee802_1x_update_sta_identity(hapd, sta, msg); in ieee802_1x_receive_auth()
2125 ieee802_1x_update_sta_cui(hapd, sta, msg); in ieee802_1x_receive_auth()
2126 ieee802_1x_check_hs20(hapd, sta, msg, in ieee802_1x_receive_auth()
2146 hostapd_logger(hapd, sm->addr, in ieee802_1x_receive_auth()
2161 ieee802_1x_decapsulate_radius(hapd, sta); in ieee802_1x_receive_auth()
2171 hapd, sta, hdr->code == RADIUS_CODE_ACCESS_ACCEPT, in ieee802_1x_receive_auth()
2186 void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta) in ieee802_1x_abort_auth() argument
2193 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_abort_auth()
2207 wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "EAP Timeout, STA " MACSTR, in ieee802_1x_abort_auth()
2211 ap_sta_disconnect(hapd, sta, sta->addr, in ieee802_1x_abort_auth()
2219 static int ieee802_1x_rekey_broadcast(struct hostapd_data *hapd) in ieee802_1x_rekey_broadcast() argument
2221 struct eapol_authenticator *eapol = hapd->eapol_auth; in ieee802_1x_rekey_broadcast()
2223 if (hapd->conf->default_wep_key_len < 1) in ieee802_1x_rekey_broadcast()
2227 eapol->default_wep_key = os_malloc(hapd->conf->default_wep_key_len); in ieee802_1x_rekey_broadcast()
2230 hapd->conf->default_wep_key_len)) { in ieee802_1x_rekey_broadcast()
2239 hapd->conf->default_wep_key_len); in ieee802_1x_rekey_broadcast()
2245 static int ieee802_1x_sta_key_available(struct hostapd_data *hapd, in ieee802_1x_sta_key_available() argument
2258 struct hostapd_data *hapd = eloop_ctx; in ieee802_1x_rekey() local
2259 struct eapol_authenticator *eapol = hapd->eapol_auth; in ieee802_1x_rekey()
2263 hapd->conf->individual_wep_key_len > 0 ? 1 : 0; in ieee802_1x_rekey()
2270 if (ieee802_1x_rekey_broadcast(hapd)) { in ieee802_1x_rekey()
2271 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_rekey()
2281 if (hostapd_drv_set_key(hapd->conf->iface, hapd, WPA_ALG_WEP, in ieee802_1x_rekey()
2285 hapd->conf->default_wep_key_len, in ieee802_1x_rekey()
2287 hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_rekey()
2295 ap_for_each_sta(hapd, ieee802_1x_sta_key_available, NULL); in ieee802_1x_rekey()
2297 if (hapd->conf->wep_rekeying_period > 0) { in ieee802_1x_rekey()
2298 eloop_register_timeout(hapd->conf->wep_rekeying_period, 0, in ieee802_1x_rekey()
2299 ieee802_1x_rekey, hapd, NULL); in ieee802_1x_rekey()
2341 struct hostapd_data *hapd = ctx; in ieee802_1x_aaa_send() local
2344 ieee802_1x_encapsulate_radius(hapd, sta, data, datalen); in ieee802_1x_aaa_send()
2352 struct hostapd_data *hapd = ctx; in _ieee802_1x_finished() local
2356 rsn_preauth_finished(hapd, sta, success); in _ieee802_1x_finished()
2360 return ieee802_1x_finished(hapd, sta, success, remediation, logoff); in _ieee802_1x_finished()
2368 struct hostapd_data *hapd = ctx; in ieee802_1x_get_eap_user() local
2373 eap_user = hostapd_get_eap_user(hapd, identity, identity_len, phase2); in ieee802_1x_get_eap_user()
2415 struct hostapd_data *hapd = ctx; in ieee802_1x_sta_entry_alive() local
2418 sta = ap_get_sta(hapd, addr); in ieee802_1x_sta_entry_alive()
2429 struct hostapd_data *hapd = ctx; in ieee802_1x_logger() local
2445 hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE8021X, hlevel, "%s", in ieee802_1x_logger()
2454 struct hostapd_data *hapd = ctx; in ieee802_1x_set_port_authorized() local
2457 ieee802_1x_set_sta_authorized(hapd, sta, authorized); in ieee802_1x_set_port_authorized()
2463 struct hostapd_data *hapd = ctx; in _ieee802_1x_abort_auth() local
2466 ieee802_1x_abort_auth(hapd, sta); in _ieee802_1x_abort_auth()
2475 struct hostapd_data *hapd = ctx; in _ieee802_1x_tx_key() local
2478 ieee802_1x_tx_key(hapd, sta); in _ieee802_1x_tx_key()
2507 struct hostapd_data *hapd = ctx; in ieee802_1x_erp_get_key() local
2510 dl_list_for_each(erp, &hapd->erp_keys, struct eap_server_erp_key, in ieee802_1x_erp_get_key()
2522 struct hostapd_data *hapd = ctx; in ieee802_1x_erp_add_key() local
2524 dl_list_add(&hapd->erp_keys, &erp->list); in ieee802_1x_erp_add_key()
2531 int ieee802_1x_init(struct hostapd_data *hapd) in ieee802_1x_init() argument
2537 if (!hostapd_mld_is_first_bss(hapd)) { in ieee802_1x_init()
2540 first = hostapd_mld_get_first_bss(hapd); in ieee802_1x_init()
2555 hapd->eapol_auth = first->eapol_auth; in ieee802_1x_init()
2560 dl_list_init(&hapd->erp_keys); in ieee802_1x_init()
2563 conf.eap_cfg = hapd->eap_cfg; in ieee802_1x_init()
2564 conf.ctx = hapd; in ieee802_1x_init()
2565 conf.eap_reauth_period = hapd->conf->eap_reauth_period; in ieee802_1x_init()
2566 conf.wpa = hapd->conf->wpa; in ieee802_1x_init()
2568 conf.individual_wep_key_len = hapd->conf->individual_wep_key_len; in ieee802_1x_init()
2570 conf.eap_req_id_text = hapd->conf->eap_req_id_text; in ieee802_1x_init()
2571 conf.eap_req_id_text_len = hapd->conf->eap_req_id_text_len; in ieee802_1x_init()
2572 conf.erp_send_reauth_start = hapd->conf->erp_send_reauth_start; in ieee802_1x_init()
2573 conf.erp_domain = hapd->conf->erp_domain; in ieee802_1x_init()
2575 conf.eap_skip_prot_success = hapd->conf->eap_skip_prot_success; in ieee802_1x_init()
2596 hapd->eapol_auth = eapol_auth_init(&conf, &cb); in ieee802_1x_init()
2597 if (!hapd->eapol_auth) in ieee802_1x_init()
2600 if ((hapd->conf->ieee802_1x || hapd->conf->wpa) && in ieee802_1x_init()
2601 hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 1)) in ieee802_1x_init()
2605 if (radius_client_register(hapd->radius, RADIUS_AUTH, in ieee802_1x_init()
2606 ieee802_1x_receive_auth, hapd)) in ieee802_1x_init()
2611 if (hapd->conf->default_wep_key_len) { in ieee802_1x_init()
2615 hostapd_drv_set_key(hapd->conf->iface, hapd, in ieee802_1x_init()
2619 ieee802_1x_rekey(hapd, NULL); in ieee802_1x_init()
2621 if (!hapd->eapol_auth->default_wep_key) in ieee802_1x_init()
2630 void ieee802_1x_erp_flush(struct hostapd_data *hapd) in ieee802_1x_erp_flush() argument
2634 while ((erp = dl_list_first(&hapd->erp_keys, struct eap_server_erp_key, in ieee802_1x_erp_flush()
2642 void ieee802_1x_deinit(struct hostapd_data *hapd) in ieee802_1x_deinit() argument
2645 if (!hostapd_mld_is_first_bss(hapd)) { in ieee802_1x_deinit()
2649 hapd->eapol_auth = NULL; in ieee802_1x_deinit()
2655 eloop_cancel_timeout(ieee802_1x_rekey, hapd, NULL); in ieee802_1x_deinit()
2658 if (hapd->driver && hapd->drv_priv && in ieee802_1x_deinit()
2659 (hapd->conf->ieee802_1x || hapd->conf->wpa)) in ieee802_1x_deinit()
2660 hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 0); in ieee802_1x_deinit()
2662 eapol_auth_deinit(hapd->eapol_auth); in ieee802_1x_deinit()
2663 hapd->eapol_auth = NULL; in ieee802_1x_deinit()
2665 ieee802_1x_erp_flush(hapd); in ieee802_1x_deinit()
2669 int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_tx_status() argument
2691 return ieee802_1x_eapol_tx_status(hapd, sta, pos, buf + len - pos, in ieee802_1x_tx_status()
2696 int ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_eapol_tx_status() argument
2714 ap_sta_pending_delayed_1x_auth_fail_disconnect(hapd, sta)) { in ieee802_1x_eapol_tx_status()
2717 hostapd_wps_eap_completed(hapd); in ieee802_1x_eapol_tx_status()
2730 wpa_auth_eapol_key_tx_status(hapd->wpa_auth, in ieee802_1x_eapol_tx_status()
2741 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, in ieee802_1x_eapol_tx_status()
2852 int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) in ieee802_1x_get_mib() argument
2859 int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, in ieee802_1x_get_mib_sta() argument
3041 struct hostapd_data *hapd = eloop_ctx; in ieee802_1x_wnm_notif_send() local
3048 hs20_send_wnm_notification(hapd, sta->addr, in ieee802_1x_wnm_notif_send()
3059 hs20_send_wnm_notification_deauth_req(hapd, sta->addr, in ieee802_1x_wnm_notif_send()
3067 hs20_send_wnm_notification_t_c(hapd, sta->addr, sta->t_c_url); in ieee802_1x_wnm_notif_send()
3075 static bool ieee802_1x_finished(struct hostapd_data *hapd, in ieee802_1x_finished() argument
3091 os_strdup(hapd->conf->subscr_remediation_url); in ieee802_1x_finished()
3099 eloop_cancel_timeout(ieee802_1x_wnm_notif_send, hapd, sta); in ieee802_1x_finished()
3101 hapd, sta); in ieee802_1x_finished()
3106 ieee802_1x_notify_create_actor_hapd(hapd, sta); in ieee802_1x_finished()
3121 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_WPA, in ieee802_1x_finished()
3137 ap_sta_delayed_1x_auth_fail_disconnect(hapd, sta, in ieee802_1x_finished()