Lines Matching refs:hapd
238 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_logger() local
254 hostapd_logger(hapd, addr, HOSTAPD_MODULE_WPA, hlevel, "%s", txt); in hostapd_wpa_auth_logger()
262 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_disconnect() local
266 ap_sta_disconnect(hapd, NULL, addr, reason); in hostapd_wpa_auth_disconnect()
272 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_mic_failure_report() local
273 return michael_mic_failure(hapd, addr, 0); in hostapd_wpa_auth_mic_failure_report()
279 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_psk_failure_report() local
280 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, in hostapd_wpa_auth_psk_failure_report()
288 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_set_eapol() local
289 struct sta_info *sta = ap_get_sta(hapd, addr); in hostapd_wpa_auth_set_eapol()
300 ieee802_1x_set_sta_authorized(hapd, sta, value); in hostapd_wpa_auth_set_eapol()
329 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_eapol() local
330 struct sta_info *sta = ap_get_sta(hapd, addr); in hostapd_wpa_auth_get_eapol()
349 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_psk() local
350 struct sta_info *sta = ap_get_sta(hapd, addr); in hostapd_wpa_auth_get_psk()
374 if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE) && in hostapd_wpa_auth_get_psk()
380 if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE) && sta) { in hostapd_wpa_auth_get_psk()
392 psk = hostapd_get_psk(hapd->conf, addr, p2p_dev_addr, prev_psk, in hostapd_wpa_auth_get_psk()
408 hapd->conf->ssid.ssid, in hostapd_wpa_auth_get_psk()
409 hapd->conf->ssid.ssid_len, 4096, in hostapd_wpa_auth_get_psk()
430 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_msk() local
435 sta = ap_get_sta(hapd, addr); in hostapd_wpa_auth_get_msk()
461 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_set_key() local
462 const char *ifname = hapd->conf->iface; in hostapd_wpa_auth_set_key()
465 ifname = hostapd_get_vlan_id_ifname(hapd->conf->vlan, vlan_id); in hostapd_wpa_auth_set_key()
467 if (!(hapd->iface->drv_flags & in hostapd_wpa_auth_set_key()
470 ifname = hapd->conf->iface; in hostapd_wpa_auth_set_key()
482 sta = ap_get_sta(hapd, addr); in hostapd_wpa_auth_set_key()
495 hapd->last_igtk_alg = alg; in hostapd_wpa_auth_set_key()
496 hapd->last_igtk_key_idx = idx; in hostapd_wpa_auth_set_key()
498 os_memcpy(hapd->last_igtk, key, key_len); in hostapd_wpa_auth_set_key()
499 hapd->last_igtk_len = key_len; in hostapd_wpa_auth_set_key()
501 hapd->last_bigtk_alg = alg; in hostapd_wpa_auth_set_key()
502 hapd->last_bigtk_key_idx = idx; in hostapd_wpa_auth_set_key()
504 os_memcpy(hapd->last_bigtk, key, key_len); in hostapd_wpa_auth_set_key()
505 hapd->last_bigtk_len = key_len; in hostapd_wpa_auth_set_key()
508 hapd->last_gtk_alg = alg; in hostapd_wpa_auth_set_key()
509 hapd->last_gtk_key_idx = idx; in hostapd_wpa_auth_set_key()
511 os_memcpy(hapd->last_gtk, key, key_len); in hostapd_wpa_auth_set_key()
512 hapd->last_gtk_len = key_len; in hostapd_wpa_auth_set_key()
515 return hostapd_drv_set_key(ifname, hapd, alg, addr, idx, vlan_id, 1, in hostapd_wpa_auth_set_key()
523 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_seqnum() local
527 if (hapd->conf->mld_ap && idx) in hostapd_wpa_auth_get_seqnum()
528 link_id = hapd->mld_link_id; in hostapd_wpa_auth_get_seqnum()
530 return hostapd_get_seqnum(hapd->conf->iface, hapd, addr, idx, link_id, in hostapd_wpa_auth_get_seqnum()
539 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_send_eapol() local
545 link_id = hapd->conf->mld_ap ? hapd->mld_link_id : -1; in hostapd_wpa_auth_send_eapol()
549 if (hapd->ext_eapol_frame_io) { in hostapd_wpa_auth_send_eapol()
556 wpa_msg(hapd->msg_ctx, MSG_INFO, "EAPOL-TX " MACSTR " %s", in hostapd_wpa_auth_send_eapol()
563 sta = ap_get_sta(hapd, addr); in hostapd_wpa_auth_send_eapol()
567 if (ap_sta_is_mld(hapd, sta) && in hostapd_wpa_auth_send_eapol()
573 return hostapd_drv_hapd_send_eapol(hapd, addr, data, data_len, in hostapd_wpa_auth_send_eapol()
580 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_sta_count() local
582 return hapd->num_sta; in hostapd_wpa_auth_get_sta_count()
590 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_for_each_sta() local
593 for (sta = hapd->sta_list; sta; sta = sta->next) { in hostapd_wpa_auth_for_each_sta()
623 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_for_each_auth() local
625 if (hapd->iface->interfaces == NULL || in hostapd_wpa_auth_for_each_auth()
626 hapd->iface->interfaces->for_each_interface == NULL) in hostapd_wpa_auth_for_each_auth()
630 return hapd->iface->interfaces->for_each_interface( in hostapd_wpa_auth_for_each_auth()
631 hapd->iface->interfaces, wpa_auth_iface_iter, &data); in hostapd_wpa_auth_for_each_auth()
646 struct hostapd_data *hapd = eloop_ctx; in hostapd_wpa_ft_rrb_rx_later() local
649 dl_list_for_each_safe(data, n, &hapd->l2_queue, in hostapd_wpa_ft_rrb_rx_later()
651 if (hapd->wpa_auth) { in hostapd_wpa_ft_rrb_rx_later()
652 wpa_ft_rrb_rx(hapd->wpa_auth, data->addr, in hostapd_wpa_ft_rrb_rx_later()
674 struct hostapd_data *hapd; in hostapd_wpa_auth_ft_iter() local
678 hapd = iface->bss[j]; in hostapd_wpa_auth_ft_iter()
679 if (hapd == idata->src_hapd || in hostapd_wpa_auth_ft_iter()
680 !hapd->wpa_auth || in hostapd_wpa_auth_ft_iter()
681 !ether_addr_equal(hapd->own_addr, idata->dst)) in hostapd_wpa_auth_ft_iter()
689 MAC2STR(hapd->own_addr), hapd->conf->iface); in hostapd_wpa_auth_ft_iter()
706 dl_list_add(&hapd->l2_queue, &data->list); in hostapd_wpa_auth_ft_iter()
709 hapd, NULL)) in hostapd_wpa_auth_ft_iter()
712 hapd, NULL); in hostapd_wpa_auth_ft_iter()
726 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_send_ether() local
731 if (hapd->ext_eapol_frame_io && proto == ETH_P_EAPOL) { in hostapd_wpa_auth_send_ether()
738 wpa_msg(hapd->msg_ctx, MSG_INFO, "EAPOL-TX " MACSTR " %s", in hostapd_wpa_auth_send_ether()
746 if (proto == ETH_P_RRB && hapd->iface->interfaces && in hostapd_wpa_auth_send_ether()
747 hapd->iface->interfaces->for_each_interface) { in hostapd_wpa_auth_send_ether()
750 idata.src_hapd = hapd; in hostapd_wpa_auth_send_ether()
754 res = hapd->iface->interfaces->for_each_interface( in hostapd_wpa_auth_send_ether()
755 hapd->iface->interfaces, hostapd_wpa_auth_ft_iter, in hostapd_wpa_auth_send_ether()
762 if (hapd->l2 == NULL) in hostapd_wpa_auth_send_ether()
769 os_memcpy(buf->h_source, hapd->own_addr, ETH_ALEN); in hostapd_wpa_auth_send_ether()
772 ret = l2_packet_send(hapd->l2, dst, proto, (u8 *) buf, in hostapd_wpa_auth_send_ether()
780 static struct eth_p_oui_ctx * hostapd_wpa_get_oui(struct hostapd_data *hapd, in hostapd_wpa_get_oui() argument
786 return hapd->oui_pull; in hostapd_wpa_get_oui()
788 return hapd->oui_resp; in hostapd_wpa_get_oui()
790 return hapd->oui_push; in hostapd_wpa_get_oui()
792 return hapd->oui_sreq; in hostapd_wpa_get_oui()
794 return hapd->oui_sresp; in hostapd_wpa_get_oui()
816 struct hostapd_data *hapd = eloop_ctx; in hostapd_oui_deliver_later() local
820 dl_list_for_each_safe(data, n, &hapd->l2_oui_queue, in hostapd_oui_deliver_later()
822 oui_ctx = hostapd_wpa_get_oui(hapd, data->oui_suffix); in hostapd_oui_deliver_later()
825 hapd->conf->iface, __func__, in hostapd_oui_deliver_later()
829 if (hapd->wpa_auth && oui_ctx) { in hostapd_oui_deliver_later()
853 struct hostapd_data *hapd, *src_hapd = idata->src_hapd; in hostapd_wpa_auth_oui_iter() local
857 hapd = iface->bss[j]; in hostapd_wpa_auth_oui_iter()
858 if (hapd == src_hapd) in hostapd_wpa_auth_oui_iter()
860 if (!wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt) || in hostapd_wpa_auth_oui_iter()
861 hapd->conf->ssid.ssid_len != in hostapd_wpa_auth_oui_iter()
863 os_memcmp(hapd->conf->ssid.ssid, in hostapd_wpa_auth_oui_iter()
865 hapd->conf->ssid.ssid_len) != 0 || in hostapd_wpa_auth_oui_iter()
866 os_memcmp(hapd->conf->mobility_domain, in hostapd_wpa_auth_oui_iter()
871 !ether_addr_equal(hapd->own_addr, idata->dst_addr)) in hostapd_wpa_auth_oui_iter()
887 src_hapd->conf->iface, hapd->conf->iface, in hostapd_wpa_auth_oui_iter()
897 dl_list_add_tail(&hapd->l2_oui_queue, &data->list); in hostapd_wpa_auth_oui_iter()
900 hapd, NULL)) in hostapd_wpa_auth_oui_iter()
903 hapd, NULL); in hostapd_wpa_auth_oui_iter()
922 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_send_oui() local
927 hapd->conf->iface, MAC2STR(dst), oui_suffix, in hostapd_wpa_auth_send_oui()
930 if (hapd->iface->interfaces && in hostapd_wpa_auth_send_oui()
931 hapd->iface->interfaces->for_each_interface) { in hostapd_wpa_auth_send_oui()
935 idata.src_hapd = hapd; in hostapd_wpa_auth_send_oui()
940 res = hapd->iface->interfaces->for_each_interface( in hostapd_wpa_auth_send_oui()
941 hapd->iface->interfaces, hostapd_wpa_auth_oui_iter, in hostapd_wpa_auth_send_oui()
948 oui_ctx = hostapd_wpa_get_oui(hapd, oui_suffix); in hostapd_wpa_auth_send_oui()
952 return eth_p_oui_send(oui_ctx, hapd->own_addr, dst, data, data_len); in hostapd_wpa_auth_send_oui()
961 struct hostapd_data *hapd = ctx; in hostapd_channel_info() local
963 return hostapd_drv_channel_info(hapd, ci); in hostapd_channel_info()
972 struct hostapd_data *hapd = ctx; in hostapd_store_ptksa() local
974 ptksa_cache_add(hapd->ptksa, hapd->own_addr, addr, cipher, life_time, in hostapd_store_ptksa()
981 struct hostapd_data *hapd = ctx; in hostapd_clear_ptksa() local
983 ptksa_cache_flush(hapd->ptksa, addr, cipher); in hostapd_clear_ptksa()
992 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_update_vlan() local
995 sta = ap_get_sta(hapd, addr); in hostapd_wpa_auth_update_vlan()
999 if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_VLAN_OFFLOAD)) { in hostapd_wpa_auth_update_vlan()
1005 if (!hostapd_vlan_valid(hapd->conf->vlan, &vlan_desc)) { in hostapd_wpa_auth_update_vlan()
1012 if (ap_sta_set_vlan(hapd, sta, &vlan_desc) < 0) { in hostapd_wpa_auth_update_vlan()
1026 ap_sta_bind_vlan(hapd, sta) < 0) in hostapd_wpa_auth_update_vlan()
1039 struct hostapd_data *hapd = ctx; in hostapd_get_sta_tx_params() local
1042 sta = ap_get_sta(hapd, addr); in hostapd_get_sta_tx_params()
1044 hostapd_wpa_auth_logger(hapd, addr, LOGGER_INFO, in hostapd_get_sta_tx_params()
1060 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_send_ft_action() local
1066 sta = ap_get_sta(hapd, dst); in hostapd_wpa_auth_send_ft_action()
1077 os_memcpy(m->sa, hapd->own_addr, ETH_ALEN); in hostapd_wpa_auth_send_ft_action()
1078 os_memcpy(m->bssid, hapd->own_addr, ETH_ALEN); in hostapd_wpa_auth_send_ft_action()
1081 res = hostapd_drv_send_mlme(hapd, (u8 *) m, mlen, 0, NULL, 0, 0); in hostapd_wpa_auth_send_ft_action()
1090 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_add_sta() local
1097 ret = hostapd_add_sta_node(hapd, sta_addr, WLAN_AUTH_FT); in hostapd_wpa_auth_add_sta()
1108 sta = ap_sta_add(hapd, sta_addr); in hostapd_wpa_auth_add_sta()
1120 sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, sta->addr, NULL); in hostapd_wpa_auth_add_sta()
1122 ap_free_sta(hapd, sta); in hostapd_wpa_auth_add_sta()
1133 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_add_sta_ft() local
1136 sta = ap_get_sta(hapd, sta_addr); in hostapd_wpa_auth_add_sta_ft()
1140 if (FULL_AP_CLIENT_STATE_SUPP(hapd->iface->drv_flags) && in hostapd_wpa_auth_add_sta_ft()
1142 !(hapd->conf->mesh & MESH_ENABLED) && !(sta->added_unassoc)) { in hostapd_wpa_auth_add_sta_ft()
1152 return ap_sta_re_add(hapd, sta); in hostapd_wpa_auth_add_sta_ft()
1162 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_set_vlan() local
1165 sta = ap_get_sta(hapd, sta_addr); in hostapd_wpa_auth_set_vlan()
1169 if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_VLAN_OFFLOAD)) { in hostapd_wpa_auth_set_vlan()
1171 !hostapd_vlan_valid(hapd->conf->vlan, vlan)) { in hostapd_wpa_auth_set_vlan()
1172 hostapd_logger(hapd, sta->addr, in hostapd_wpa_auth_set_vlan()
1181 if (ap_sta_set_vlan(hapd, sta, vlan) < 0) in hostapd_wpa_auth_set_vlan()
1190 ap_sta_bind_vlan(hapd, sta); in hostapd_wpa_auth_set_vlan()
1193 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, in hostapd_wpa_auth_set_vlan()
1203 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_vlan() local
1206 sta = ap_get_sta(hapd, sta_addr); in hostapd_wpa_auth_get_vlan()
1212 } else if ((hapd->iface->drv_flags & WPA_DRIVER_FLAGS_VLAN_OFFLOAD) && in hostapd_wpa_auth_get_vlan()
1228 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_set_identity() local
1231 sta = ap_get_sta(hapd, sta_addr); in hostapd_wpa_auth_set_identity()
1268 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_identity() local
1273 sta = ap_get_sta(hapd, sta_addr); in hostapd_wpa_auth_get_identity()
1298 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_set_radius_cui() local
1301 sta = ap_get_sta(hapd, sta_addr); in hostapd_wpa_auth_set_radius_cui()
1336 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_radius_cui() local
1342 sta = ap_get_sta(hapd, sta_addr); in hostapd_wpa_auth_get_radius_cui()
1369 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_set_session_timeout() local
1372 sta = ap_get_sta(hapd, sta_addr); in hostapd_wpa_auth_set_session_timeout()
1380 ap_sta_session_timeout(hapd, sta, session_timeout); in hostapd_wpa_auth_set_session_timeout()
1383 ap_sta_no_session_timeout(hapd, sta); in hostapd_wpa_auth_set_session_timeout()
1390 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_session_timeout() local
1394 sta = ap_get_sta(hapd, sta_addr); in hostapd_wpa_auth_get_session_timeout()
1413 struct hostapd_data *hapd = ctx; in hostapd_rrb_receive() local
1421 !ether_addr_equal(hapd->own_addr, ethhdr->h_dest)) in hostapd_rrb_receive()
1423 wpa_ft_rrb_rx(hapd->wpa_auth, ethhdr->h_source, buf + sizeof(*ethhdr), in hostapd_rrb_receive()
1432 struct hostapd_data *hapd = ctx; in hostapd_rrb_oui_receive() local
1437 !ether_addr_equal(hapd->own_addr, dst_addr)) in hostapd_rrb_oui_receive()
1439 wpa_ft_rrb_oui_rx(hapd->wpa_auth, src_addr, dst_addr, oui_suffix, buf, in hostapd_rrb_oui_receive()
1447 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_add_tspec() local
1448 return hostapd_add_tspec(hapd, sta_addr, tspec_ie, tspec_ielen); in hostapd_wpa_auth_add_tspec()
1453 static int hostapd_wpa_register_ft_oui(struct hostapd_data *hapd, in hostapd_wpa_register_ft_oui() argument
1456 hapd->oui_pull = eth_p_oui_register(hapd, ft_iface, in hostapd_wpa_register_ft_oui()
1458 hostapd_rrb_oui_receive, hapd); in hostapd_wpa_register_ft_oui()
1459 if (!hapd->oui_pull) in hostapd_wpa_register_ft_oui()
1462 hapd->oui_resp = eth_p_oui_register(hapd, ft_iface, in hostapd_wpa_register_ft_oui()
1464 hostapd_rrb_oui_receive, hapd); in hostapd_wpa_register_ft_oui()
1465 if (!hapd->oui_resp) in hostapd_wpa_register_ft_oui()
1468 hapd->oui_push = eth_p_oui_register(hapd, ft_iface, in hostapd_wpa_register_ft_oui()
1470 hostapd_rrb_oui_receive, hapd); in hostapd_wpa_register_ft_oui()
1471 if (!hapd->oui_push) in hostapd_wpa_register_ft_oui()
1474 hapd->oui_sreq = eth_p_oui_register(hapd, ft_iface, in hostapd_wpa_register_ft_oui()
1476 hostapd_rrb_oui_receive, hapd); in hostapd_wpa_register_ft_oui()
1477 if (!hapd->oui_sreq) in hostapd_wpa_register_ft_oui()
1480 hapd->oui_sresp = eth_p_oui_register(hapd, ft_iface, in hostapd_wpa_register_ft_oui()
1482 hostapd_rrb_oui_receive, hapd); in hostapd_wpa_register_ft_oui()
1483 if (!hapd->oui_sresp) in hostapd_wpa_register_ft_oui()
1490 static void hostapd_wpa_unregister_ft_oui(struct hostapd_data *hapd) in hostapd_wpa_unregister_ft_oui() argument
1492 eth_p_oui_unregister(hapd->oui_pull); in hostapd_wpa_unregister_ft_oui()
1493 hapd->oui_pull = NULL; in hostapd_wpa_unregister_ft_oui()
1494 eth_p_oui_unregister(hapd->oui_resp); in hostapd_wpa_unregister_ft_oui()
1495 hapd->oui_resp = NULL; in hostapd_wpa_unregister_ft_oui()
1496 eth_p_oui_unregister(hapd->oui_push); in hostapd_wpa_unregister_ft_oui()
1497 hapd->oui_push = NULL; in hostapd_wpa_unregister_ft_oui()
1498 eth_p_oui_unregister(hapd->oui_sreq); in hostapd_wpa_unregister_ft_oui()
1499 hapd->oui_sreq = NULL; in hostapd_wpa_unregister_ft_oui()
1500 eth_p_oui_unregister(hapd->oui_sresp); in hostapd_wpa_unregister_ft_oui()
1501 hapd->oui_sresp = NULL; in hostapd_wpa_unregister_ft_oui()
1511 struct hostapd_data *hapd = ctx; in hostapd_request_radius_psk() local
1517 hostapd_acl_req_radius_psk(hapd, addr, key_mgmt, anonce, eapol, in hostapd_request_radius_psk()
1528 struct hostapd_data *hapd = ctx; in hostapd_set_ltf_keyseed() local
1530 return hostapd_drv_set_secure_ranging_ctx(hapd, hapd->own_addr, in hostapd_set_ltf_keyseed()
1543 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_ml_key_info() local
1549 if (!hapd->conf->mld_ap || !hapd->iface || !hapd->iface->interfaces) in hostapd_wpa_auth_get_ml_key_info()
1561 if (hapd->mld_link_id == link_id) { in hostapd_wpa_auth_get_ml_key_info()
1562 wpa_auth_ml_get_key_info(hapd->wpa_auth, in hostapd_wpa_auth_get_ml_key_info()
1569 for_each_mld_link(bss, hapd) { in hostapd_wpa_auth_get_ml_key_info()
1570 if (bss == hapd || bss->mld_link_id != link_id) in hostapd_wpa_auth_get_ml_key_info()
1595 struct hostapd_data *hapd = ctx; in hostapd_wpa_auth_get_drv_flags() local
1598 *drv_flags = hapd->iface->drv_flags; in hostapd_wpa_auth_get_drv_flags()
1600 *drv_flags2 = hapd->iface->drv_flags2; in hostapd_wpa_auth_get_drv_flags()
1606 int hostapd_setup_wpa(struct hostapd_data *hapd) in hostapd_setup_wpa() argument
1665 hostapd_wpa_auth_conf(hapd->conf, hapd->iconf, &_conf); in hostapd_setup_wpa()
1666 _conf.msg_ctx = hapd->msg_ctx; in hostapd_setup_wpa()
1667 tx_bss = hostapd_mbssid_get_tx_bss(hapd); in hostapd_setup_wpa()
1668 if (tx_bss != hapd) in hostapd_setup_wpa()
1670 if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_EAPOL_TX_STATUS) in hostapd_setup_wpa()
1672 if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_MLME) in hostapd_setup_wpa()
1675 if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_WIRED) && in hostapd_setup_wpa()
1676 (hapd->conf->wpa_deny_ptk0_rekey == PTK0_REKEY_ALLOW_NEVER || in hostapd_setup_wpa()
1677 (hapd->conf->wpa_deny_ptk0_rekey == PTK0_REKEY_ALLOW_LOCAL_OK && in hostapd_setup_wpa()
1678 !(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_SAFE_PTK0_REKEYS)))) { in hostapd_setup_wpa()
1679 wpa_msg(hapd->msg_ctx, MSG_INFO, in hostapd_setup_wpa()
1685 (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_EXTENDED_KEY_ID)) in hostapd_setup_wpa()
1686 wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Extended Key ID supported"); in hostapd_setup_wpa()
1690 if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_BEACON_PROTECTION)) in hostapd_setup_wpa()
1694 if (!(hapd->iface->drv_flags2 & in hostapd_setup_wpa()
1700 !!(hapd->iface->drv_flags2 & WPA_DRIVER_FLAGS2_SEC_LTF_AP); in hostapd_setup_wpa()
1702 !!(hapd->iface->drv_flags2 & WPA_DRIVER_FLAGS2_SEC_RTT_AP); in hostapd_setup_wpa()
1704 !!(hapd->iface->drv_flags2 & in hostapd_setup_wpa()
1712 if (hapd->conf->mld_ap) { in hostapd_setup_wpa()
1715 _conf.mld_addr = hapd->mld->mld_addr; in hostapd_setup_wpa()
1716 _conf.link_id = hapd->mld_link_id; in hostapd_setup_wpa()
1718 for_each_mld_link(lhapd, hapd) { in hostapd_setup_wpa()
1719 if (lhapd == hapd) in hostapd_setup_wpa()
1728 hapd->wpa_auth = wpa_init(hapd->own_addr, &_conf, &cb, hapd); in hostapd_setup_wpa()
1729 if (hapd->wpa_auth == NULL) { in hostapd_setup_wpa()
1734 if (hostapd_set_privacy(hapd, 1)) { in hostapd_setup_wpa()
1736 "for interface %s", hapd->conf->iface); in hostapd_setup_wpa()
1740 wpa_ie = wpa_auth_get_wpa_ie(hapd->wpa_auth, &wpa_ie_len); in hostapd_setup_wpa()
1741 if (hostapd_set_generic_elem(hapd, wpa_ie, wpa_ie_len)) { in hostapd_setup_wpa()
1747 if (rsn_preauth_iface_init(hapd)) { in hostapd_setup_wpa()
1753 if (!hapd->ptksa) in hostapd_setup_wpa()
1754 hapd->ptksa = ptksa_cache_init(); in hostapd_setup_wpa()
1755 if (!hapd->ptksa) { in hostapd_setup_wpa()
1761 if (!hostapd_drv_none(hapd) && in hostapd_setup_wpa()
1762 wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) { in hostapd_setup_wpa()
1765 ft_iface = hapd->conf->bridge[0] ? hapd->conf->bridge : in hostapd_setup_wpa()
1766 hapd->conf->iface; in hostapd_setup_wpa()
1767 hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB, in hostapd_setup_wpa()
1768 hostapd_rrb_receive, hapd, 1); in hostapd_setup_wpa()
1769 if (!hapd->l2) { in hostapd_setup_wpa()
1775 if (hostapd_wpa_register_ft_oui(hapd, ft_iface)) { in hostapd_setup_wpa()
1788 void hostapd_reconfig_wpa(struct hostapd_data *hapd) in hostapd_reconfig_wpa() argument
1791 hostapd_wpa_auth_conf(hapd->conf, hapd->iconf, &wpa_auth_conf); in hostapd_reconfig_wpa()
1792 wpa_reconfig(hapd->wpa_auth, &wpa_auth_conf); in hostapd_reconfig_wpa()
1796 void hostapd_deinit_wpa(struct hostapd_data *hapd) in hostapd_deinit_wpa() argument
1798 ieee80211_tkip_countermeasures_deinit(hapd); in hostapd_deinit_wpa()
1799 ptksa_cache_deinit(hapd->ptksa); in hostapd_deinit_wpa()
1800 hapd->ptksa = NULL; in hostapd_deinit_wpa()
1802 rsn_preauth_iface_deinit(hapd); in hostapd_deinit_wpa()
1803 if (hapd->wpa_auth) { in hostapd_deinit_wpa()
1804 wpa_deinit(hapd->wpa_auth); in hostapd_deinit_wpa()
1805 hapd->wpa_auth = NULL; in hostapd_deinit_wpa()
1807 if (hapd->drv_priv && hostapd_set_privacy(hapd, 0)) { in hostapd_deinit_wpa()
1810 hapd->conf->iface); in hostapd_deinit_wpa()
1813 if (hapd->drv_priv && in hostapd_deinit_wpa()
1814 hostapd_set_generic_elem(hapd, (u8 *) "", 0)) { in hostapd_deinit_wpa()
1817 hapd->conf->iface); in hostapd_deinit_wpa()
1820 ieee802_1x_deinit(hapd); in hostapd_deinit_wpa()
1823 eloop_cancel_timeout(hostapd_wpa_ft_rrb_rx_later, hapd, ELOOP_ALL_CTX); in hostapd_deinit_wpa()
1824 hostapd_wpa_ft_rrb_rx_later(hapd, NULL); /* flush without delivering */ in hostapd_deinit_wpa()
1825 eloop_cancel_timeout(hostapd_oui_deliver_later, hapd, ELOOP_ALL_CTX); in hostapd_deinit_wpa()
1826 hostapd_oui_deliver_later(hapd, NULL); /* flush without delivering */ in hostapd_deinit_wpa()
1827 l2_packet_deinit(hapd->l2); in hostapd_deinit_wpa()
1828 hapd->l2 = NULL; in hostapd_deinit_wpa()
1829 hostapd_wpa_unregister_ft_oui(hapd); in hostapd_deinit_wpa()
1833 forced_memzero(hapd->last_gtk, WPA_GTK_MAX_LEN); in hostapd_deinit_wpa()
1834 forced_memzero(hapd->last_igtk, WPA_IGTK_MAX_LEN); in hostapd_deinit_wpa()
1835 forced_memzero(hapd->last_bigtk, WPA_BIGTK_MAX_LEN); in hostapd_deinit_wpa()