Merge ~antoinelassagne/ubuntu/+source/wpa:plucky-sru-2117497 into ubuntu/+source/wpa:ubuntu/plucky
- Git
- lp:~antoinelassagne/ubuntu/+source/wpa
- plucky-sru-2117497
- Merge into ubuntu/plucky
Proposed by
Antoine Lassagne
| Status: | Needs review | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Proposed branch: | ~antoinelassagne/ubuntu/+source/wpa:plucky-sru-2117497 | ||||||||
| Merge into: | ubuntu/+source/wpa:ubuntu/plucky | ||||||||
| Diff against target: |
123627 lines (+66346/-12714) 368 files modified
CONTRIBUTIONS (+1/-1) README (+1/-1) debian/changelog (+12/-0) debian/control (+2/-1) debian/patches/0015-Revert-Mark-authorization-completed-on-driver-indica.patch (+45/-0) debian/patches/0019-Send-CTRL-EVENT-SIGNAL-CHANGE-message-to-control-int.patch (+5/-15) debian/patches/Bump-DEFAULT_BSS_MAX_COUNT-to-1000.patch (+25/-0) debian/patches/series (+2/-7) debian/patches/upstream-fixes/0002-AP-guard-FT-SAE-code-with-CONFIG_IEEE80211R_AP.patch (+14/-10) dev/null (+0/-36) hostapd/Android.mk (+27/-1) hostapd/ChangeLog (+37/-0) hostapd/Makefile (+28/-2) hostapd/README (+1/-1) hostapd/android.config (+6/-0) hostapd/config_file.c (+428/-53) hostapd/config_file.h (+2/-5) hostapd/ctrl_iface.c (+1020/-440) hostapd/defconfig (+18/-3) hostapd/hostapd.conf (+346/-10) hostapd/hostapd.eap_user (+2/-2) hostapd/hostapd_cli.c (+181/-36) hostapd/main.c (+136/-6) hs20/client/Android.mk (+10/-0) hs20/client/est.c (+5/-32) hs20/client/osu_client.c (+79/-36) hs20/client/spp_client.c (+0/-1) hs20/server/spp_server.c (+4/-1) src/Makefile (+1/-1) src/ap/acs.c (+471/-97) src/ap/acs.h (+3/-0) src/ap/airtime_policy.c (+1/-1) src/ap/ap_config.c (+173/-32) src/ap/ap_config.h (+214/-12) src/ap/ap_drv_ops.c (+306/-53) src/ap/ap_drv_ops.h (+73/-11) src/ap/ap_list.c (+3/-3) src/ap/ap_mlme.c (+2/-2) src/ap/authsrv.c (+94/-0) src/ap/beacon.c (+1020/-192) src/ap/beacon.h (+4/-0) src/ap/bss_load.c (+1/-1) src/ap/comeback_token.c (+139/-0) src/ap/comeback_token.h (+21/-0) src/ap/ctrl_iface_ap.c (+586/-13) src/ap/ctrl_iface_ap.h (+17/-0) src/ap/dfs.c (+452/-156) src/ap/dpp_hostapd.c (+1355/-62) src/ap/dpp_hostapd.h (+5/-0) src/ap/drv_callbacks.c (+781/-100) src/ap/fils_hlp.c (+5/-5) src/ap/gas_query_ap.c (+7/-3) src/ap/gas_serv.c (+6/-5) src/ap/gas_serv.h (+1/-1) src/ap/hostapd.c (+1311/-130) src/ap/hostapd.h (+163/-6) src/ap/hw_features.c (+206/-27) src/ap/hw_features.h (+12/-0) src/ap/ieee802_11.c (+2426/-1604) src/ap/ieee802_11.h (+75/-8) src/ap/ieee802_11_auth.c (+131/-31) src/ap/ieee802_11_auth.h (+4/-1) src/ap/ieee802_11_eht.c (+1405/-0) src/ap/ieee802_11_he.c (+68/-19) src/ap/ieee802_11_ht.c (+2/-3) src/ap/ieee802_11_shared.c (+174/-41) src/ap/ieee802_11_vht.c (+23/-9) src/ap/ieee802_1x.c (+187/-46) src/ap/ieee802_1x.h (+1/-1) src/ap/nan_usd_ap.c (+267/-0) src/ap/nan_usd_ap.h (+46/-0) src/ap/ndisc_snoop.c (+1/-0) src/ap/neighbor_db.c (+59/-15) src/ap/neighbor_db.h (+1/-0) src/ap/pmksa_cache_auth.c (+24/-8) src/ap/pmksa_cache_auth.h (+4/-0) src/ap/preauth_auth.c (+2/-2) src/ap/rrm.c (+121/-0) src/ap/rrm.h (+2/-0) src/ap/sta_info.c (+395/-74) src/ap/sta_info.h (+65/-31) src/ap/utils.c (+13/-1) src/ap/wmm.c (+0/-7) src/ap/wnm_ap.c (+204/-12) src/ap/wpa_auth.c (+2012/-447) src/ap/wpa_auth.h (+93/-10) src/ap/wpa_auth_ft.c (+400/-215) src/ap/wpa_auth_glue.c (+236/-33) src/ap/wpa_auth_i.h (+42/-5) src/ap/wpa_auth_ie.c (+81/-14) src/ap/wpa_auth_kay.c (+9/-36) src/ap/wps_hostapd.c (+3/-2) src/ap/x_snoop.c (+5/-0) src/build.rules (+1/-1) src/common/brcm_vendor.h (+4/-4) src/common/common_module_tests.c (+1/-1) src/common/defs.h (+62/-5) src/common/dpp.c (+827/-56) src/common/dpp.h (+124/-8) src/common/dpp_crypto.c (+201/-38) src/common/dpp_i.h (+14/-5) src/common/dpp_pkex.c (+37/-22) src/common/dpp_reconfig.c (+17/-1) src/common/dpp_tcp.c (+875/-41) src/common/dragonfly.c (+6/-3) src/common/gas_server.c (+61/-18) src/common/gas_server.h (+4/-1) src/common/hw_features_common.c (+266/-37) src/common/hw_features_common.h (+9/-3) src/common/ieee802_11_common.c (+895/-195) src/common/ieee802_11_common.h (+60/-29) src/common/ieee802_11_defs.h (+642/-80) src/common/nan.h (+98/-0) src/common/nan_de.c (+1395/-0) src/common/nan_de.h (+145/-0) src/common/ocv.c (+2/-3) src/common/ptksa_cache.c (+70/-4) src/common/ptksa_cache.h (+9/-38) src/common/qca-vendor.h (+6164/-159) src/common/sae.c (+125/-14) src/common/sae.h (+11/-3) src/common/version.h (+1/-1) src/common/wpa_common.c (+760/-235) src/common/wpa_common.h (+123/-11) src/common/wpa_ctrl.c (+13/-3) src/common/wpa_ctrl.h (+36/-0) src/crypto/crypto.h (+114/-3) src/crypto/crypto_gnutls.c (+5/-0) src/crypto/crypto_internal.c (+5/-0) src/crypto/crypto_libtomcrypt.c (+5/-0) src/crypto/crypto_linux.c (+5/-0) src/crypto/crypto_module_tests.c (+281/-0) src/crypto/crypto_nettle.c (+5/-0) src/crypto/crypto_none.c (+5/-0) src/crypto/crypto_openssl.c (+2481/-141) src/crypto/crypto_wolfssl.c (+1889/-154) src/crypto/fips_prf_internal.c (+4/-7) src/crypto/fips_prf_openssl.c (+15/-0) src/crypto/sha1-pbkdf2.c (+3/-0) src/crypto/sha256-internal.c (+0/-3) src/crypto/sha256.c (+15/-6) src/crypto/sha384.c (+3/-3) src/crypto/sha512-internal.c (+0/-3) src/crypto/sha512.c (+3/-3) src/crypto/tls.h (+12/-6) src/crypto/tls_gnutls.c (+1/-0) src/crypto/tls_internal.c (+2/-9) src/crypto/tls_none.c (+1/-0) src/crypto/tls_openssl.c (+409/-155) src/crypto/tls_openssl_ocsp.c (+11/-15) src/crypto/tls_wolfssl.c (+195/-89) src/drivers/driver.h (+900/-64) src/drivers/driver_atheros.c (+16/-15) src/drivers/driver_bsd.c (+9/-7) src/drivers/driver_common.c (+44/-0) src/drivers/driver_hostap.c (+11/-9) src/drivers/driver_macsec_linux.c (+72/-4) src/drivers/driver_macsec_qca.c (+2/-2) src/drivers/driver_ndis.c (+4/-4) src/drivers/driver_nl80211.c (+2673/-770) src/drivers/driver_nl80211.h (+95/-18) src/drivers/driver_nl80211_capa.c (+286/-68) src/drivers/driver_nl80211_event.c (+1180/-111) src/drivers/driver_nl80211_scan.c (+90/-37) src/drivers/driver_roboswitch.c (+1/-1) src/drivers/driver_wext.c (+6/-5) src/drivers/driver_wired.c (+1/-1) src/drivers/linux_ioctl.c (+10/-1) src/drivers/ndis_events.c (+3/-2) src/drivers/netlink.c (+4/-2) src/drivers/nl80211_copy.h (+598/-28) src/eap_common/eap_defs.h (+1/-1) src/eap_common/eap_pwd_common.c (+19/-4) src/eap_common/eap_sake_common.c (+13/-6) src/eap_peer/eap.c (+44/-0) src/eap_peer/eap_aka.c (+154/-44) src/eap_peer/eap_config.h (+28/-18) src/eap_peer/eap_fast.c (+2/-12) src/eap_peer/eap_i.h (+9/-0) src/eap_peer/eap_mschapv2.c (+25/-5) src/eap_peer/eap_peap.c (+37/-3) src/eap_peer/eap_pwd.c (+26/-7) src/eap_peer/eap_sim.c (+158/-44) src/eap_peer/eap_teap.c (+34/-27) src/eap_peer/eap_tls.c (+11/-4) src/eap_peer/eap_tls_common.c (+18/-9) src/eap_peer/eap_tls_common.h (+5/-0) src/eap_peer/eap_ttls.c (+29/-3) src/eap_peer/eap_wsc.c (+12/-2) src/eap_server/eap.h (+12/-0) src/eap_server/eap_i.h (+7/-0) src/eap_server/eap_server_aka.c (+117/-9) src/eap_server/eap_server_eke.c (+1/-0) src/eap_server/eap_server_fast.c (+2/-12) src/eap_server/eap_server_mschapv2.c (+25/-3) src/eap_server/eap_server_peap.c (+18/-0) src/eap_server/eap_server_pwd.c (+26/-7) src/eap_server/eap_server_sim.c (+127/-6) src/eap_server/eap_server_teap.c (+36/-3) src/eap_server/eap_server_tls.c (+9/-1) src/eap_server/eap_server_tls_common.c (+15/-3) src/eap_server/eap_server_ttls.c (+2/-1) src/eap_server/eap_tls_common.h (+2/-0) src/eapol_auth/eapol_auth_sm.c (+19/-7) src/eapol_auth/eapol_auth_sm.h (+3/-2) src/eapol_auth/eapol_auth_sm_i.h (+4/-0) src/eapol_supp/eapol_supp_sm.c (+16/-1) src/eapol_supp/eapol_supp_sm.h (+16/-2) src/fst/fst_group.c (+8/-4) src/fst/fst_iface.c (+1/-1) src/fst/fst_session.c (+2/-4) src/l2_packet/l2_packet_freebsd.c (+13/-2) src/l2_packet/l2_packet_linux.c (+2/-2) src/p2p/p2p.c (+80/-43) src/p2p/p2p.h (+9/-3) src/p2p/p2p_build.c (+13/-7) src/p2p/p2p_dev_disc.c (+5/-5) src/p2p/p2p_go_neg.c (+94/-27) src/p2p/p2p_group.c (+7/-7) src/p2p/p2p_i.h (+15/-4) src/p2p/p2p_invitation.c (+23/-8) src/p2p/p2p_parse.c (+24/-3) src/p2p/p2p_pd.c (+29/-14) src/p2p/p2p_sd.c (+15/-8) src/p2p/p2p_utils.c (+80/-4) src/pae/ieee802_1x_cp.c (+11/-4) src/pae/ieee802_1x_kay.c (+58/-16) src/pae/ieee802_1x_kay.h (+4/-1) src/pae/ieee802_1x_secy_ops.c (+20/-0) src/pae/ieee802_1x_secy_ops.h (+1/-0) src/pasn/Makefile (+16/-0) src/pasn/pasn_common.c (+232/-0) src/pasn/pasn_common.h (+228/-0) src/pasn/pasn_initiator.c (+1406/-0) src/pasn/pasn_responder.c (+1032/-0) src/radius/radius.c (+238/-59) src/radius/radius.h (+33/-2) src/radius/radius_client.c (+580/-209) src/radius/radius_client.h (+26/-1) src/radius/radius_das.c (+10/-0) src/radius/radius_server.c (+15/-0) src/rsn_supp/pmksa_cache.c (+231/-29) src/rsn_supp/pmksa_cache.h (+17/-88) src/rsn_supp/preauth.c (+11/-8) src/rsn_supp/tdls.c (+259/-73) src/rsn_supp/wpa.c (+1817/-373) src/rsn_supp/wpa.h (+75/-13) src/rsn_supp/wpa_ft.c (+189/-139) src/rsn_supp/wpa_i.h (+54/-11) src/rsn_supp/wpa_ie.c (+28/-8) src/tls/libtommath.c (+0/-8) src/tls/pkcs1.c (+4/-2) src/tls/tlsv1_client_read.c (+2/-1) src/tls/tlsv1_common.c (+4/-2) src/tls/tlsv1_common.h (+2/-1) src/tls/tlsv1_server_write.c (+1/-1) src/utils/browser.c (+10/-0) src/utils/common.c (+14/-1) src/utils/common.h (+38/-0) src/utils/crc32.c (+1/-1) src/utils/crc32.h (+1/-1) src/utils/http-utils.h (+1/-0) src/utils/http_curl.c (+28/-45) src/utils/ip_addr.c (+19/-0) src/utils/ip_addr.h (+2/-0) src/utils/os.h (+36/-6) src/utils/os_unix.c (+107/-88) src/utils/trace.c (+3/-3) src/utils/wpa_debug.c (+9/-1) src/utils/wpa_debug.h (+1/-0) src/utils/wpabuf.h (+6/-0) src/wps/ndef.c (+6/-0) src/wps/wps.c (+3/-2) src/wps/wps.h (+5/-0) src/wps/wps_attr_parse.c (+12/-1) src/wps/wps_enrollee.c (+2/-4) src/wps/wps_er.c (+2/-2) src/wps/wps_i.h (+1/-0) src/wps/wps_registrar.c (+7/-8) wpa_supplicant/Android.mk (+217/-11) wpa_supplicant/ChangeLog (+50/-0) wpa_supplicant/Makefile (+288/-20) wpa_supplicant/README (+3/-1) wpa_supplicant/README-HS20 (+32/-1) wpa_supplicant/README-NAN-USD (+147/-0) wpa_supplicant/README-WPS (+9/-15) wpa_supplicant/android.config (+15/-0) wpa_supplicant/ap.c (+266/-27) wpa_supplicant/ap.h (+22/-2) wpa_supplicant/bgscan.h (+1/-1) wpa_supplicant/bgscan_learn.c (+5/-5) wpa_supplicant/bgscan_simple.c (+61/-3) wpa_supplicant/bss.c (+523/-40) wpa_supplicant/bss.h (+29/-0) wpa_supplicant/bssid_ignore.c (+15/-15) wpa_supplicant/config.c (+409/-78) wpa_supplicant/config.h (+127/-23) wpa_supplicant/config_file.c (+89/-19) wpa_supplicant/config_none.c (+2/-1) wpa_supplicant/config_ssid.h (+110/-4) wpa_supplicant/config_winreg.c (+2/-3) wpa_supplicant/ctrl_iface.c (+1451/-256) wpa_supplicant/ctrl_iface.h (+2/-0) wpa_supplicant/ctrl_iface_unix.c (+3/-0) wpa_supplicant/dbus/dbus_dict_helpers.c (+100/-0) wpa_supplicant/dbus/dbus_dict_helpers.h (+9/-0) wpa_supplicant/dbus/dbus_new.c (+141/-1) wpa_supplicant/dbus/dbus_new.h (+24/-0) wpa_supplicant/dbus/dbus_new_handlers.c (+660/-124) wpa_supplicant/dbus/dbus_new_handlers.h (+7/-0) wpa_supplicant/dbus/dbus_new_handlers_p2p.c (+73/-21) wpa_supplicant/dbus/dbus_new_helpers.c (+193/-16) wpa_supplicant/dbus/dbus_new_helpers.h (+5/-0) wpa_supplicant/dbus/dbus_new_introspect.c (+1/-1) wpa_supplicant/defconfig (+53/-0) wpa_supplicant/doc/docbook/wpa_supplicant.sgml (+35/-13) wpa_supplicant/dpp_supplicant.c (+1992/-192) wpa_supplicant/dpp_supplicant.h (+5/-0) wpa_supplicant/driver_i.h (+91/-33) wpa_supplicant/eapol_test.c (+109/-37) wpa_supplicant/events.c (+1464/-277) wpa_supplicant/examples/dpp-nfc.py (+8/-2) wpa_supplicant/gas_query.c (+36/-20) wpa_supplicant/hs20_supplicant.c (+8/-9) wpa_supplicant/ibss_rsn.c (+18/-14) wpa_supplicant/ibss_rsn.h (+2/-1) wpa_supplicant/interworking.c (+79/-45) wpa_supplicant/main.c (+2/-0) wpa_supplicant/mbo.c (+21/-4) wpa_supplicant/mesh.c (+11/-5) wpa_supplicant/mesh_mpm.c (+55/-19) wpa_supplicant/mesh_rsn.c (+23/-4) wpa_supplicant/nan_usd.c (+513/-0) wpa_supplicant/nan_usd.h (+46/-0) wpa_supplicant/notify.c (+94/-9) wpa_supplicant/notify.h (+13/-1) wpa_supplicant/offchannel.c (+5/-5) wpa_supplicant/op_classes.c (+130/-20) wpa_supplicant/p2p_supplicant.c (+310/-173) wpa_supplicant/p2p_supplicant.h (+6/-7) wpa_supplicant/p2p_supplicant_sd.c (+12/-2) wpa_supplicant/pasn_supplicant.c (+489/-1219) wpa_supplicant/preauth_test.c (+5/-3) wpa_supplicant/robust_av.c (+296/-45) wpa_supplicant/rrm.c (+94/-38) wpa_supplicant/scan.c (+631/-143) wpa_supplicant/scan.h (+21/-9) wpa_supplicant/sme.c (+811/-137) wpa_supplicant/sme.h (+4/-10) wpa_supplicant/systemd/wpa_supplicant-nl80211.service.arg.in (+1/-1) wpa_supplicant/systemd/wpa_supplicant.service.arg.in (+1/-1) wpa_supplicant/utils/log2pcap.py (+5/-4) wpa_supplicant/wmm_ac.c (+3/-3) wpa_supplicant/wnm_sta.c (+312/-220) wpa_supplicant/wnm_sta.h (+28/-2) wpa_supplicant/wpa_cli.c (+129/-15) wpa_supplicant/wpa_passphrase.c (+24/-1) wpa_supplicant/wpa_priv.c (+8/-3) wpa_supplicant/wpa_supplicant.c (+1272/-407) wpa_supplicant/wpa_supplicant.conf (+99/-10) wpa_supplicant/wpa_supplicant_i.h (+205/-81) wpa_supplicant/wpa_supplicant_template.conf (+2/-0) wpa_supplicant/wpas_glue.c (+115/-44) wpa_supplicant/wpas_glue.h (+2/-0) wpa_supplicant/wpas_kay.c (+16/-37) wpa_supplicant/wpas_module_tests.c (+3/-0) wpa_supplicant/wps_supplicant.c (+122/-44) wpa_supplicant/wps_supplicant.h (+13/-0) |
||||||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Nick Rosbrook (community) | Needs Information | ||
| git-ubuntu import | Pending | ||
|
Review via email:
|
|||
Commit message
Description of the change
To post a comment you must log in.
Unmerged commits
- 5a2ab65... by Antoine Lassagne
-
Changelog update
- 827a47a... by Tobias Heider
-
Changelog
- 0f7ffd1... by Tobias Heider
-
Revert commit breaking authentication on brcmfmac
- 13c020a... by Mitchell Augustin
-
Bump DEFAULT_
BSS_MAX_ COUNT to 1000 (LP: #2117180) - e8728b7... by Antoine Lassagne
-
2:2.11-0ubuntu1 (patches unapplied)
Imported using git-ubuntu import.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
| 1 | diff --git a/CONTRIBUTIONS b/CONTRIBUTIONS | |||
| 2 | index b2064dc..6c8187c 100644 | |||
| 3 | --- a/CONTRIBUTIONS | |||
| 4 | +++ b/CONTRIBUTIONS | |||
| 5 | @@ -37,7 +37,7 @@ without moderation. You can subscribe to the list at this address: | |||
| 6 | 37 | http://lists.infradead.org/mailman/listinfo/hostap | 37 | http://lists.infradead.org/mailman/listinfo/hostap |
| 7 | 38 | 38 | ||
| 8 | 39 | The message should contain an inlined patch against the current | 39 | The message should contain an inlined patch against the current |
| 10 | 40 | development branch (i.e., the master branch of | 40 | development branch (i.e., the main branch of |
| 11 | 41 | git://w1.fi/hostap.git). Please make sure the software you use for | 41 | git://w1.fi/hostap.git). Please make sure the software you use for |
| 12 | 42 | sending the patch does not corrupt whitespace. If that cannot be fixed | 42 | sending the patch does not corrupt whitespace. If that cannot be fixed |
| 13 | 43 | for some reason, it is better to include an attached version of the | 43 | for some reason, it is better to include an attached version of the |
| 14 | diff --git a/README b/README | |||
| 15 | index 1470c4f..8392bb3 100644 | |||
| 16 | --- a/README | |||
| 17 | +++ b/README | |||
| 18 | @@ -1,7 +1,7 @@ | |||
| 19 | 1 | wpa_supplicant and hostapd | 1 | wpa_supplicant and hostapd |
| 20 | 2 | -------------------------- | 2 | -------------------------- |
| 21 | 3 | 3 | ||
| 23 | 4 | Copyright (c) 2002-2022, Jouni Malinen <j@w1.fi> and contributors | 4 | Copyright (c) 2002-2024, Jouni Malinen <j@w1.fi> and contributors |
| 24 | 5 | All Rights Reserved. | 5 | All Rights Reserved. |
| 25 | 6 | 6 | ||
| 26 | 7 | These programs are licensed under the BSD license (the one with | 7 | These programs are licensed under the BSD license (the one with |
| 27 | diff --git a/debian/.gitignore b/debian/.gitignore | |||
| 28 | 8 | deleted file mode 100644 | 8 | deleted file mode 100644 |
| 29 | index 66fe32a..0000000 | |||
| 30 | --- a/debian/.gitignore | |||
| 31 | +++ /dev/null | |||
| 32 | @@ -1,11 +0,0 @@ | |||
| 33 | 1 | *.debhelper | ||
| 34 | 2 | *.substvars | ||
| 35 | 3 | .debhelper/ | ||
| 36 | 4 | debhelper-build-stamp | ||
| 37 | 5 | eapoltest/ | ||
| 38 | 6 | files | ||
| 39 | 7 | hostapd/ | ||
| 40 | 8 | libwpa-client-dev/ | ||
| 41 | 9 | wpagui/ | ||
| 42 | 10 | wpasupplicant-udeb/ | ||
| 43 | 11 | wpasupplicant/ | ||
| 44 | diff --git a/debian/changelog b/debian/changelog | |||
| 45 | index 6eff64f..9630d1e 100644 | |||
| 46 | --- a/debian/changelog | |||
| 47 | +++ b/debian/changelog | |||
| 48 | @@ -1,3 +1,15 @@ | |||
| 49 | 1 | wpa (2:2.11-0ubuntu3~25.04.1) plucky; urgency=medium | ||
| 50 | 2 | |||
| 51 | 3 | * Backport of Questing's version to Plucky | ||
| 52 | 4 | |||
| 53 | 5 | -- Antoine Lassagne <antoine.lassagne@canonical.com> Thu, 25 Sep 2025 12:21:04 +0200 | ||
| 54 | 6 | |||
| 55 | 7 | wpa (2:2.10-24ubuntu0.1) plucky; urgency=medium | ||
| 56 | 8 | |||
| 57 | 9 | * Bump DEFAULT_BSS_MAX_COUNT to 1000 (LP: #2117180) | ||
| 58 | 10 | |||
| 59 | 11 | -- Mitchell Augustin <mitchell.augustin@canonical.com> Mon, 21 Jul 2025 18:13:31 -0500 | ||
| 60 | 12 | |||
| 61 | 1 | wpa (2:2.10-24) unstable; urgency=medium | 13 | wpa (2:2.10-24) unstable; urgency=medium |
| 62 | 2 | 14 | ||
| 63 | 3 | [ Hlib Korzhynskyy ] | 15 | [ Hlib Korzhynskyy ] |
| 64 | diff --git a/debian/control b/debian/control | |||
| 65 | index 803df6b..3be6d04 100644 | |||
| 66 | --- a/debian/control | |||
| 67 | +++ b/debian/control | |||
| 68 | @@ -1,5 +1,6 @@ | |||
| 69 | 1 | Source: wpa | 1 | Source: wpa |
| 71 | 2 | Maintainer: Debian wpasupplicant Maintainers <wpa@packages.debian.org> | 2 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
| 72 | 3 | XSBC-Original-Maintainer: Debian wpasupplicant Maintainers <wpa@packages.debian.org> | ||
| 73 | 3 | Uploaders: | 4 | Uploaders: |
| 74 | 4 | Andrej Shadura <andrewsh@debian.org> | 5 | Andrej Shadura <andrewsh@debian.org> |
| 75 | 5 | Section: net | 6 | Section: net |
| 76 | diff --git a/debian/patches/0015-Revert-Mark-authorization-completed-on-driver-indica.patch b/debian/patches/0015-Revert-Mark-authorization-completed-on-driver-indica.patch | |||
| 77 | 6 | new file mode 100644 | 7 | new file mode 100644 |
| 78 | index 0000000..09b239f | |||
| 79 | --- /dev/null | |||
| 80 | +++ b/debian/patches/0015-Revert-Mark-authorization-completed-on-driver-indica.patch | |||
| 81 | @@ -0,0 +1,45 @@ | |||
| 82 | 1 | From: Tobias Heider <me@tobhe.de> | ||
| 83 | 2 | Date: Mon, 1 Sep 2025 22:18:55 +0200 | ||
| 84 | 3 | Subject: Revert "Mark authorization completed on driver indication during | ||
| 85 | 4 | 4-way HS offload" | ||
| 86 | 5 | |||
| 87 | 6 | --- | ||
| 88 | 7 | wpa_supplicant/events.c | 25 ++++++++----------------- | ||
| 89 | 8 | 1 file changed, 8 insertions(+), 17 deletions(-) | ||
| 90 | 9 | |||
| 91 | 10 | diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c | ||
| 92 | 11 | index 7a6133c..56a9b81 100644 | ||
| 93 | 12 | --- a/wpa_supplicant/events.c | ||
| 94 | 13 | +++ b/wpa_supplicant/events.c | ||
| 95 | 14 | @@ -4327,23 +4327,14 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s, | ||
| 96 | 15 | eapol_sm_notify_eap_success(wpa_s->eapol, true); | ||
| 97 | 16 | } else if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK) && | ||
| 98 | 17 | wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt)) { | ||
| 99 | 18 | - if (already_authorized) { | ||
| 100 | 19 | - /* | ||
| 101 | 20 | - * We are done; the driver will take care of RSN 4-way | ||
| 102 | 21 | - * handshake. | ||
| 103 | 22 | - */ | ||
| 104 | 23 | - wpa_supplicant_cancel_auth_timeout(wpa_s); | ||
| 105 | 24 | - wpa_supplicant_set_state(wpa_s, WPA_COMPLETED); | ||
| 106 | 25 | - eapol_sm_notify_portValid(wpa_s->eapol, true); | ||
| 107 | 26 | - eapol_sm_notify_eap_success(wpa_s->eapol, true); | ||
| 108 | 27 | - } else { | ||
| 109 | 28 | - /* Update port, WPA_COMPLETED state from the | ||
| 110 | 29 | - * EVENT_PORT_AUTHORIZED handler when the driver is done | ||
| 111 | 30 | - * with the 4-way handshake. | ||
| 112 | 31 | - */ | ||
| 113 | 32 | - wpa_msg(wpa_s, MSG_DEBUG, | ||
| 114 | 33 | - "ASSOC INFO: wait for driver port authorized indication"); | ||
| 115 | 34 | - } | ||
| 116 | 35 | + /* | ||
| 117 | 36 | + * We are done; the driver will take care of RSN 4-way | ||
| 118 | 37 | + * handshake. | ||
| 119 | 38 | + */ | ||
| 120 | 39 | + wpa_supplicant_cancel_auth_timeout(wpa_s); | ||
| 121 | 40 | + wpa_supplicant_set_state(wpa_s, WPA_COMPLETED); | ||
| 122 | 41 | + eapol_sm_notify_portValid(wpa_s->eapol, true); | ||
| 123 | 42 | + eapol_sm_notify_eap_success(wpa_s->eapol, true); | ||
| 124 | 43 | } else if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X) && | ||
| 125 | 44 | wpa_key_mgmt_wpa_ieee8021x(wpa_s->key_mgmt)) { | ||
| 126 | 45 | /* | ||
| 127 | diff --git a/debian/patches/0017-CVE-2023-52160-PEAP-client-Update-Phase-2-authentica.patch b/debian/patches/0017-CVE-2023-52160-PEAP-client-Update-Phase-2-authentica.patch | |||
| 128 | 0 | deleted file mode 100644 | 46 | deleted file mode 100644 |
| 129 | index 19abe4e..0000000 | |||
| 130 | --- a/debian/patches/0017-CVE-2023-52160-PEAP-client-Update-Phase-2-authentica.patch | |||
| 131 | +++ /dev/null | |||
| 132 | @@ -1,211 +0,0 @@ | |||
| 133 | 1 | From: Jouni Malinen <j@w1.fi> | ||
| 134 | 2 | Date: Sat, 8 Jul 2023 19:55:32 +0300 | ||
| 135 | 3 | Subject: CVE-2023-52160 PEAP client: Update Phase 2 authentication | ||
| 136 | 4 | requirements | ||
| 137 | 5 | |||
| 138 | 6 | The previous PEAP client behavior allowed the server to skip Phase 2 | ||
| 139 | 7 | authentication with the expectation that the server was authenticated | ||
| 140 | 8 | during Phase 1 through TLS server certificate validation. Various PEAP | ||
| 141 | 9 | specifications are not exactly clear on what the behavior on this front | ||
| 142 | 10 | is supposed to be and as such, this ended up being more flexible than | ||
| 143 | 11 | the TTLS/FAST/TEAP cases. However, this is not really ideal when | ||
| 144 | 12 | unfortunately common misconfiguration of PEAP is used in deployed | ||
| 145 | 13 | devices where the server trust root (ca_cert) is not configured or the | ||
| 146 | 14 | user has an easy option for allowing this validation step to be skipped. | ||
| 147 | 15 | |||
| 148 | 16 | Change the default PEAP client behavior to be to require Phase 2 | ||
| 149 | 17 | authentication to be successfully completed for cases where TLS session | ||
| 150 | 18 | resumption is not used and the client certificate has not been | ||
| 151 | 19 | configured. Those two exceptions are the main cases where a deployed | ||
| 152 | 20 | authentication server might skip Phase 2 and as such, where a more | ||
| 153 | 21 | strict default behavior could result in undesired interoperability | ||
| 154 | 22 | issues. Requiring Phase 2 authentication will end up disabling TLS | ||
| 155 | 23 | session resumption automatically to avoid interoperability issues. | ||
| 156 | 24 | |||
| 157 | 25 | Allow Phase 2 authentication behavior to be configured with a new phase1 | ||
| 158 | 26 | configuration parameter option: | ||
| 159 | 27 | 'phase2_auth' option can be used to control Phase 2 (i.e., within TLS | ||
| 160 | 28 | tunnel) behavior for PEAP: | ||
| 161 | 29 | * 0 = do not require Phase 2 authentication | ||
| 162 | 30 | * 1 = require Phase 2 authentication when client certificate | ||
| 163 | 31 | (private_key/client_cert) is no used and TLS session resumption was | ||
| 164 | 32 | not used (default) | ||
| 165 | 33 | * 2 = require Phase 2 authentication in all cases | ||
| 166 | 34 | |||
| 167 | 35 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 168 | 36 | origin: https://w1.fi/cgit/hostap/commit/?id=8e6485a1bcb0baffdea9e55255a81270b768439c | ||
| 169 | 37 | bug: https://www.top10vpn.com/research/wifi-vulnerabilities/ | ||
| 170 | 38 | bug-debian-security: https://security-tracker.debian.org/tracker/CVE-2023-52160 | ||
| 171 | 39 | bug-debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1064061 | ||
| 172 | 40 | --- | ||
| 173 | 41 | src/eap_peer/eap_config.h | 8 ++++++++ | ||
| 174 | 42 | src/eap_peer/eap_peap.c | 40 +++++++++++++++++++++++++++++++++++--- | ||
| 175 | 43 | src/eap_peer/eap_tls_common.c | 6 ++++++ | ||
| 176 | 44 | src/eap_peer/eap_tls_common.h | 5 +++++ | ||
| 177 | 45 | wpa_supplicant/wpa_supplicant.conf | 7 +++++++ | ||
| 178 | 46 | 5 files changed, 63 insertions(+), 3 deletions(-) | ||
| 179 | 47 | |||
| 180 | 48 | diff --git a/src/eap_peer/eap_config.h b/src/eap_peer/eap_config.h | ||
| 181 | 49 | index 3238f74..047eec2 100644 | ||
| 182 | 50 | --- a/src/eap_peer/eap_config.h | ||
| 183 | 51 | +++ b/src/eap_peer/eap_config.h | ||
| 184 | 52 | @@ -469,6 +469,14 @@ struct eap_peer_config { | ||
| 185 | 53 | * 1 = use cryptobinding if server supports it | ||
| 186 | 54 | * 2 = require cryptobinding | ||
| 187 | 55 | * | ||
| 188 | 56 | + * phase2_auth option can be used to control Phase 2 (i.e., within TLS | ||
| 189 | 57 | + * tunnel) behavior for PEAP: | ||
| 190 | 58 | + * 0 = do not require Phase 2 authentication | ||
| 191 | 59 | + * 1 = require Phase 2 authentication when client certificate | ||
| 192 | 60 | + * (private_key/client_cert) is no used and TLS session resumption was | ||
| 193 | 61 | + * not used (default) | ||
| 194 | 62 | + * 2 = require Phase 2 authentication in all cases | ||
| 195 | 63 | + * | ||
| 196 | 64 | * EAP-WSC (WPS) uses following options: pin=Device_Password and | ||
| 197 | 65 | * uuid=Device_UUID | ||
| 198 | 66 | * | ||
| 199 | 67 | diff --git a/src/eap_peer/eap_peap.c b/src/eap_peer/eap_peap.c | ||
| 200 | 68 | index 12e30df..6080697 100644 | ||
| 201 | 69 | --- a/src/eap_peer/eap_peap.c | ||
| 202 | 70 | +++ b/src/eap_peer/eap_peap.c | ||
| 203 | 71 | @@ -67,6 +67,7 @@ struct eap_peap_data { | ||
| 204 | 72 | u8 cmk[20]; | ||
| 205 | 73 | int soh; /* Whether IF-TNCCS-SOH (Statement of Health; Microsoft NAP) | ||
| 206 | 74 | * is enabled. */ | ||
| 207 | 75 | + enum { NO_AUTH, FOR_INITIAL, ALWAYS } phase2_auth; | ||
| 208 | 76 | }; | ||
| 209 | 77 | |||
| 210 | 78 | |||
| 211 | 79 | @@ -114,6 +115,19 @@ static void eap_peap_parse_phase1(struct eap_peap_data *data, | ||
| 212 | 80 | wpa_printf(MSG_DEBUG, "EAP-PEAP: Require cryptobinding"); | ||
| 213 | 81 | } | ||
| 214 | 82 | |||
| 215 | 83 | + if (os_strstr(phase1, "phase2_auth=0")) { | ||
| 216 | 84 | + data->phase2_auth = NO_AUTH; | ||
| 217 | 85 | + wpa_printf(MSG_DEBUG, | ||
| 218 | 86 | + "EAP-PEAP: Do not require Phase 2 authentication"); | ||
| 219 | 87 | + } else if (os_strstr(phase1, "phase2_auth=1")) { | ||
| 220 | 88 | + data->phase2_auth = FOR_INITIAL; | ||
| 221 | 89 | + wpa_printf(MSG_DEBUG, | ||
| 222 | 90 | + "EAP-PEAP: Require Phase 2 authentication for initial connection"); | ||
| 223 | 91 | + } else if (os_strstr(phase1, "phase2_auth=2")) { | ||
| 224 | 92 | + data->phase2_auth = ALWAYS; | ||
| 225 | 93 | + wpa_printf(MSG_DEBUG, | ||
| 226 | 94 | + "EAP-PEAP: Require Phase 2 authentication for all cases"); | ||
| 227 | 95 | + } | ||
| 228 | 96 | #ifdef EAP_TNC | ||
| 229 | 97 | if (os_strstr(phase1, "tnc=soh2")) { | ||
| 230 | 98 | data->soh = 2; | ||
| 231 | 99 | @@ -142,6 +156,7 @@ static void * eap_peap_init(struct eap_sm *sm) | ||
| 232 | 100 | data->force_peap_version = -1; | ||
| 233 | 101 | data->peap_outer_success = 2; | ||
| 234 | 102 | data->crypto_binding = OPTIONAL_BINDING; | ||
| 235 | 103 | + data->phase2_auth = FOR_INITIAL; | ||
| 236 | 104 | |||
| 237 | 105 | if (config && config->phase1) | ||
| 238 | 106 | eap_peap_parse_phase1(data, config->phase1); | ||
| 239 | 107 | @@ -454,6 +469,20 @@ static int eap_tlv_validate_cryptobinding(struct eap_sm *sm, | ||
| 240 | 108 | } | ||
| 241 | 109 | |||
| 242 | 110 | |||
| 243 | 111 | +static bool peap_phase2_sufficient(struct eap_sm *sm, | ||
| 244 | 112 | + struct eap_peap_data *data) | ||
| 245 | 113 | +{ | ||
| 246 | 114 | + if ((data->phase2_auth == ALWAYS || | ||
| 247 | 115 | + (data->phase2_auth == FOR_INITIAL && | ||
| 248 | 116 | + !tls_connection_resumed(sm->ssl_ctx, data->ssl.conn) && | ||
| 249 | 117 | + !data->ssl.client_cert_conf) || | ||
| 250 | 118 | + data->phase2_eap_started) && | ||
| 251 | 119 | + !data->phase2_eap_success) | ||
| 252 | 120 | + return false; | ||
| 253 | 121 | + return true; | ||
| 254 | 122 | +} | ||
| 255 | 123 | + | ||
| 256 | 124 | + | ||
| 257 | 125 | /** | ||
| 258 | 126 | * eap_tlv_process - Process a received EAP-TLV message and generate a response | ||
| 259 | 127 | * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init() | ||
| 260 | 128 | @@ -568,6 +597,11 @@ static int eap_tlv_process(struct eap_sm *sm, struct eap_peap_data *data, | ||
| 261 | 129 | " - force failed Phase 2"); | ||
| 262 | 130 | resp_status = EAP_TLV_RESULT_FAILURE; | ||
| 263 | 131 | ret->decision = DECISION_FAIL; | ||
| 264 | 132 | + } else if (!peap_phase2_sufficient(sm, data)) { | ||
| 265 | 133 | + wpa_printf(MSG_INFO, | ||
| 266 | 134 | + "EAP-PEAP: Server indicated Phase 2 success, but sufficient Phase 2 authentication has not been completed"); | ||
| 267 | 135 | + resp_status = EAP_TLV_RESULT_FAILURE; | ||
| 268 | 136 | + ret->decision = DECISION_FAIL; | ||
| 269 | 137 | } else { | ||
| 270 | 138 | resp_status = EAP_TLV_RESULT_SUCCESS; | ||
| 271 | 139 | ret->decision = DECISION_UNCOND_SUCC; | ||
| 272 | 140 | @@ -887,8 +921,7 @@ continue_req: | ||
| 273 | 141 | /* EAP-Success within TLS tunnel is used to indicate | ||
| 274 | 142 | * shutdown of the TLS channel. The authentication has | ||
| 275 | 143 | * been completed. */ | ||
| 276 | 144 | - if (data->phase2_eap_started && | ||
| 277 | 145 | - !data->phase2_eap_success) { | ||
| 278 | 146 | + if (!peap_phase2_sufficient(sm, data)) { | ||
| 279 | 147 | wpa_printf(MSG_DEBUG, "EAP-PEAP: Phase 2 " | ||
| 280 | 148 | "Success used to indicate success, " | ||
| 281 | 149 | "but Phase 2 EAP was not yet " | ||
| 282 | 150 | @@ -1199,8 +1232,9 @@ static struct wpabuf * eap_peap_process(struct eap_sm *sm, void *priv, | ||
| 283 | 151 | static bool eap_peap_has_reauth_data(struct eap_sm *sm, void *priv) | ||
| 284 | 152 | { | ||
| 285 | 153 | struct eap_peap_data *data = priv; | ||
| 286 | 154 | + | ||
| 287 | 155 | return tls_connection_established(sm->ssl_ctx, data->ssl.conn) && | ||
| 288 | 156 | - data->phase2_success; | ||
| 289 | 157 | + data->phase2_success && data->phase2_auth != ALWAYS; | ||
| 290 | 158 | } | ||
| 291 | 159 | |||
| 292 | 160 | |||
| 293 | 161 | diff --git a/src/eap_peer/eap_tls_common.c b/src/eap_peer/eap_tls_common.c | ||
| 294 | 162 | index c1837db..a53eeb1 100644 | ||
| 295 | 163 | --- a/src/eap_peer/eap_tls_common.c | ||
| 296 | 164 | +++ b/src/eap_peer/eap_tls_common.c | ||
| 297 | 165 | @@ -239,6 +239,12 @@ static int eap_tls_params_from_conf(struct eap_sm *sm, | ||
| 298 | 166 | |||
| 299 | 167 | sm->ext_cert_check = !!(params->flags & TLS_CONN_EXT_CERT_CHECK); | ||
| 300 | 168 | |||
| 301 | 169 | + if (!phase2) | ||
| 302 | 170 | + data->client_cert_conf = params->client_cert || | ||
| 303 | 171 | + params->client_cert_blob || | ||
| 304 | 172 | + params->private_key || | ||
| 305 | 173 | + params->private_key_blob; | ||
| 306 | 174 | + | ||
| 307 | 175 | return 0; | ||
| 308 | 176 | } | ||
| 309 | 177 | |||
| 310 | 178 | diff --git a/src/eap_peer/eap_tls_common.h b/src/eap_peer/eap_tls_common.h | ||
| 311 | 179 | index 9ac0012..3348634 100644 | ||
| 312 | 180 | --- a/src/eap_peer/eap_tls_common.h | ||
| 313 | 181 | +++ b/src/eap_peer/eap_tls_common.h | ||
| 314 | 182 | @@ -79,6 +79,11 @@ struct eap_ssl_data { | ||
| 315 | 183 | * tls_v13 - Whether TLS v1.3 or newer is used | ||
| 316 | 184 | */ | ||
| 317 | 185 | int tls_v13; | ||
| 318 | 186 | + | ||
| 319 | 187 | + /** | ||
| 320 | 188 | + * client_cert_conf: Whether client certificate has been configured | ||
| 321 | 189 | + */ | ||
| 322 | 190 | + bool client_cert_conf; | ||
| 323 | 191 | }; | ||
| 324 | 192 | |||
| 325 | 193 | |||
| 326 | 194 | diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf | ||
| 327 | 195 | index 6619d6b..d63f73c 100644 | ||
| 328 | 196 | --- a/wpa_supplicant/wpa_supplicant.conf | ||
| 329 | 197 | +++ b/wpa_supplicant/wpa_supplicant.conf | ||
| 330 | 198 | @@ -1321,6 +1321,13 @@ fast_reauth=1 | ||
| 331 | 199 | # * 0 = do not use cryptobinding (default) | ||
| 332 | 200 | # * 1 = use cryptobinding if server supports it | ||
| 333 | 201 | # * 2 = require cryptobinding | ||
| 334 | 202 | +# 'phase2_auth' option can be used to control Phase 2 (i.e., within TLS | ||
| 335 | 203 | +# tunnel) behavior for PEAP: | ||
| 336 | 204 | +# * 0 = do not require Phase 2 authentication | ||
| 337 | 205 | +# * 1 = require Phase 2 authentication when client certificate | ||
| 338 | 206 | +# (private_key/client_cert) is no used and TLS session resumption was | ||
| 339 | 207 | +# not used (default) | ||
| 340 | 208 | +# * 2 = require Phase 2 authentication in all cases | ||
| 341 | 209 | # EAP-WSC (WPS) uses following options: pin=<Device Password> or | ||
| 342 | 210 | # pbc=1. | ||
| 343 | 211 | # | ||
| 344 | diff --git a/debian/patches/0019-Send-CTRL-EVENT-SIGNAL-CHANGE-message-to-control-int.patch b/debian/patches/0019-Send-CTRL-EVENT-SIGNAL-CHANGE-message-to-control-int.patch | |||
| 345 | index 0cbb7dd..6a982e6 100644 | |||
| 346 | --- a/debian/patches/0019-Send-CTRL-EVENT-SIGNAL-CHANGE-message-to-control-int.patch | |||
| 347 | +++ b/debian/patches/0019-Send-CTRL-EVENT-SIGNAL-CHANGE-message-to-control-int.patch | |||
| 348 | @@ -24,22 +24,12 @@ diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c | |||
| 349 | 24 | index f55e184..25b0c24 100644 | 24 | index f55e184..25b0c24 100644 |
| 350 | 25 | --- a/wpa_supplicant/events.c | 25 | --- a/wpa_supplicant/events.c |
| 351 | 26 | +++ b/wpa_supplicant/events.c | 26 | +++ b/wpa_supplicant/events.c |
| 354 | 27 | @@ -5447,12 +5447,12 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, | 27 | @@ -6590,7 +6590,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, |
| 355 | 28 | data->eapol_rx.data_len); | 28 | data->eapol_rx.encrypted); |
| 356 | 29 | break; | 29 | break; |
| 357 | 30 | case EVENT_SIGNAL_CHANGE: | 30 | case EVENT_SIGNAL_CHANGE: |
| 358 | 31 | - wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SIGNAL_CHANGE | 31 | - wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SIGNAL_CHANGE |
| 359 | 32 | - "above=%d signal=%d noise=%d txrate=%d", | ||
| 360 | 33 | - data->signal_change.above_threshold, | ||
| 361 | 34 | - data->signal_change.current_signal, | ||
| 362 | 35 | - data->signal_change.current_noise, | ||
| 363 | 36 | - data->signal_change.current_txrate); | ||
| 364 | 37 | + wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SIGNAL_CHANGE | 32 | + wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SIGNAL_CHANGE |
| 373 | 38 | + "above=%d signal=%d noise=%d txrate=%d", | 33 | "above=%d signal=%d noise=%d txrate=%lu", |
| 374 | 39 | + data->signal_change.above_threshold, | 34 | data->signal_change.above_threshold, |
| 375 | 40 | + data->signal_change.current_signal, | 35 | data->signal_change.data.signal, |
| 368 | 41 | + data->signal_change.current_noise, | ||
| 369 | 42 | + data->signal_change.current_txrate); | ||
| 370 | 43 | wpa_bss_update_level(wpa_s->current_bss, | ||
| 371 | 44 | data->signal_change.current_signal); | ||
| 372 | 45 | bgscan_notify_signal_change( | ||
| 376 | diff --git a/debian/patches/Bump-DEFAULT_BSS_MAX_COUNT-to-1000.patch b/debian/patches/Bump-DEFAULT_BSS_MAX_COUNT-to-1000.patch | |||
| 377 | 46 | new file mode 100644 | 36 | new file mode 100644 |
| 378 | index 0000000..688a343 | |||
| 379 | --- /dev/null | |||
| 380 | +++ b/debian/patches/Bump-DEFAULT_BSS_MAX_COUNT-to-1000.patch | |||
| 381 | @@ -0,0 +1,25 @@ | |||
| 382 | 1 | Description: Bump DEFAULT_BSS_MAX_COUNT to 1000 | ||
| 383 | 2 | Many congested areas have more than 200 APs in range | ||
| 384 | 3 | of a typical device. When the number of APs exceeds | ||
| 385 | 4 | BSS_MAX_COUNT, even nearby APs can be absent from | ||
| 386 | 5 | the scanning device's AP list. | ||
| 387 | 6 | This patch bumps the default to 1000 to be more in | ||
| 388 | 7 | line with a realistic modern max number of APs | ||
| 389 | 8 | in a given area. | ||
| 390 | 9 | Author: Mitchell Augustin <mitchell.augustin@canonical.com> | ||
| 391 | 10 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/2117180 | ||
| 392 | 11 | |||
| 393 | 12 | --- | ||
| 394 | 13 | Last-Update: 2025-07-21 | ||
| 395 | 14 | |||
| 396 | 15 | --- wpa-2.10.orig/wpa_supplicant/config.h | ||
| 397 | 16 | +++ wpa-2.10/wpa_supplicant/config.h | ||
| 398 | 17 | @@ -29,7 +29,7 @@ | ||
| 399 | 18 | #define DEFAULT_P2P_INTRA_BSS 1 | ||
| 400 | 19 | #define DEFAULT_P2P_GO_MAX_INACTIVITY (5 * 60) | ||
| 401 | 20 | #define DEFAULT_P2P_OPTIMIZE_LISTEN_CHAN 0 | ||
| 402 | 21 | -#define DEFAULT_BSS_MAX_COUNT 200 | ||
| 403 | 22 | +#define DEFAULT_BSS_MAX_COUNT 1000 | ||
| 404 | 23 | #define DEFAULT_BSS_EXPIRATION_AGE 180 | ||
| 405 | 24 | #define DEFAULT_BSS_EXPIRATION_SCAN_COUNT 2 | ||
| 406 | 25 | #define DEFAULT_MAX_NUM_STA 128 | ||
| 407 | diff --git a/debian/patches/CVE-2022-37660.patch b/debian/patches/CVE-2022-37660.patch | |||
| 408 | 0 | deleted file mode 100644 | 26 | deleted file mode 100644 |
| 409 | index e95c20f..0000000 | |||
| 410 | --- a/debian/patches/CVE-2022-37660.patch | |||
| 411 | +++ /dev/null | |||
| 412 | @@ -1,122 +0,0 @@ | |||
| 413 | 1 | [Ubuntu note: hostapd_dpp_pkex_done() in dpp_hostapd.c and | ||
| 414 | 2 | wpas_dpp_pkex_done() in dpp_supplicant.c were introduced in 2.11 | ||
| 415 | 3 | --Hlib Korzhynskyy] | ||
| 416 | 4 | |||
| 417 | 5 | Backport of: | ||
| 418 | 6 | |||
| 419 | 7 | From 15af83cf1846870873a011ed4d714732f01cd2e4 Mon Sep 17 00:00:00 2001 | ||
| 420 | 8 | From: Jouni Malinen <quic_jouni@quicinc.com> | ||
| 421 | 9 | Date: Tue, 19 Jul 2022 21:23:04 +0300 | ||
| 422 | 10 | Subject: DPP: Delete PKEX code and identifier on success completion of PKEX | ||
| 423 | 11 | |||
| 424 | 12 | We are not supposed to reuse these without being explicitly requested to | ||
| 425 | 13 | perform PKEX again. There is not a strong use case for being able to | ||
| 426 | 14 | provision an Enrollee multiple times with PKEX, so this should have no | ||
| 427 | 15 | issues on the Enrollee. For a Configurator, there might be some use | ||
| 428 | 16 | cases that would benefit from being able to use the same code with | ||
| 429 | 17 | multiple Enrollee devices, e.g., for guess access with a laptop and a | ||
| 430 | 18 | smart phone. That case will now require a new DPP_PKEX_ADD command on | ||
| 431 | 19 | the Configurator after each completion of the provisioning exchange. | ||
| 432 | 20 | |||
| 433 | 21 | Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com> | ||
| 434 | 22 | --- | ||
| 435 | 23 | src/ap/dpp_hostapd.c | 22 +++++++++++++++++++++- | ||
| 436 | 24 | wpa_supplicant/dpp_supplicant.c | 21 ++++++++++++++++++++- | ||
| 437 | 25 | 2 files changed, 41 insertions(+), 2 deletions(-) | ||
| 438 | 26 | |||
| 439 | 27 | Index: wpa-2.10/src/ap/dpp_hostapd.c | ||
| 440 | 28 | =================================================================== | ||
| 441 | 29 | --- wpa-2.10.orig/src/ap/dpp_hostapd.c | ||
| 442 | 30 | +++ wpa-2.10/src/ap/dpp_hostapd.c | ||
| 443 | 31 | @@ -216,6 +216,22 @@ static void hostapd_dpp_auth_resp_retry( | ||
| 444 | 32 | } | ||
| 445 | 33 | |||
| 446 | 34 | |||
| 447 | 35 | +static void hostapd_dpp_pkex_clear_code(struct hostapd_data *hapd) | ||
| 448 | 36 | +{ | ||
| 449 | 37 | + if (!hapd->dpp_pkex_code && !hapd->dpp_pkex_identifier) | ||
| 450 | 38 | + return; | ||
| 451 | 39 | + | ||
| 452 | 40 | + /* Delete PKEX code and identifier on successful completion of | ||
| 453 | 41 | + * PKEX. We are not supposed to reuse these without being | ||
| 454 | 42 | + * explicitly requested to perform PKEX again. */ | ||
| 455 | 43 | + wpa_printf(MSG_DEBUG, "DPP: Delete PKEX code/identifier"); | ||
| 456 | 44 | + os_free(hapd->dpp_pkex_code); | ||
| 457 | 45 | + hapd->dpp_pkex_code = NULL; | ||
| 458 | 46 | + os_free(hapd->dpp_pkex_identifier); | ||
| 459 | 47 | + hapd->dpp_pkex_identifier = NULL; | ||
| 460 | 48 | +} | ||
| 461 | 49 | + | ||
| 462 | 50 | + | ||
| 463 | 51 | void hostapd_dpp_tx_status(struct hostapd_data *hapd, const u8 *dst, | ||
| 464 | 52 | const u8 *data, size_t data_len, int ok) | ||
| 465 | 53 | { | ||
| 466 | 54 | @@ -1842,6 +1858,7 @@ hostapd_dpp_rx_pkex_commit_reveal_req(st | ||
| 467 | 55 | wpabuf_head(msg), wpabuf_len(msg)); | ||
| 468 | 56 | wpabuf_free(msg); | ||
| 469 | 57 | |||
| 470 | 58 | + hostapd_dpp_pkex_clear_code(hapd); | ||
| 471 | 59 | bi = dpp_pkex_finish(hapd->iface->interfaces->dpp, pkex, src, freq); | ||
| 472 | 60 | if (!bi) | ||
| 473 | 61 | return; | ||
| 474 | 62 | @@ -1873,6 +1890,7 @@ hostapd_dpp_rx_pkex_commit_reveal_resp(s | ||
| 475 | 63 | return; | ||
| 476 | 64 | } | ||
| 477 | 65 | |||
| 478 | 66 | + hostapd_dpp_pkex_clear_code(hapd); | ||
| 479 | 67 | bi = dpp_pkex_finish(hapd->iface->interfaces->dpp, pkex, src, freq); | ||
| 480 | 68 | if (!bi) | ||
| 481 | 69 | return; | ||
| 482 | 70 | @@ -2215,7 +2233,7 @@ int hostapd_dpp_pkex_remove(struct hosta | ||
| 483 | 71 | return -1; | ||
| 484 | 72 | } | ||
| 485 | 73 | |||
| 486 | 74 | - if ((id_val != 0 && id_val != 1) || !hapd->dpp_pkex_code) | ||
| 487 | 75 | + if ((id_val != 0 && id_val != 1)) | ||
| 488 | 76 | return -1; | ||
| 489 | 77 | |||
| 490 | 78 | /* TODO: Support multiple PKEX entries */ | ||
| 491 | 79 | Index: wpa-2.10/wpa_supplicant/dpp_supplicant.c | ||
| 492 | 80 | =================================================================== | ||
| 493 | 81 | --- wpa-2.10.orig/wpa_supplicant/dpp_supplicant.c | ||
| 494 | 82 | +++ wpa-2.10/wpa_supplicant/dpp_supplicant.c | ||
| 495 | 83 | @@ -2557,6 +2557,22 @@ static int wpas_dpp_pkex_next_channel(st | ||
| 496 | 84 | } | ||
| 497 | 85 | |||
| 498 | 86 | |||
| 499 | 87 | +static void wpas_dpp_pkex_clear_code(struct wpa_supplicant *wpa_s) | ||
| 500 | 88 | +{ | ||
| 501 | 89 | + if (!wpa_s->dpp_pkex_code && !wpa_s->dpp_pkex_identifier) | ||
| 502 | 90 | + return; | ||
| 503 | 91 | + | ||
| 504 | 92 | + /* Delete PKEX code and identifier on successful completion of | ||
| 505 | 93 | + * PKEX. We are not supposed to reuse these without being | ||
| 506 | 94 | + * explicitly requested to perform PKEX again. */ | ||
| 507 | 95 | + os_free(wpa_s->dpp_pkex_code); | ||
| 508 | 96 | + wpa_s->dpp_pkex_code = NULL; | ||
| 509 | 97 | + os_free(wpa_s->dpp_pkex_identifier); | ||
| 510 | 98 | + wpa_s->dpp_pkex_identifier = NULL; | ||
| 511 | 99 | + | ||
| 512 | 100 | +} | ||
| 513 | 101 | + | ||
| 514 | 102 | + | ||
| 515 | 103 | static void wpas_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx) | ||
| 516 | 104 | { | ||
| 517 | 105 | struct wpa_supplicant *wpa_s = eloop_ctx; | ||
| 518 | 106 | @@ -2739,6 +2755,7 @@ wpas_dpp_pkex_finish(struct wpa_supplica | ||
| 519 | 107 | { | ||
| 520 | 108 | struct dpp_bootstrap_info *bi; | ||
| 521 | 109 | |||
| 522 | 110 | + wpas_dpp_pkex_clear_code(wpa_s); | ||
| 523 | 111 | bi = dpp_pkex_finish(wpa_s->dpp, wpa_s->dpp_pkex, peer, freq); | ||
| 524 | 112 | if (!bi) | ||
| 525 | 113 | return NULL; | ||
| 526 | 114 | @@ -3369,7 +3386,7 @@ int wpas_dpp_pkex_remove(struct wpa_supp | ||
| 527 | 115 | return -1; | ||
| 528 | 116 | } | ||
| 529 | 117 | |||
| 530 | 118 | - if ((id_val != 0 && id_val != 1) || !wpa_s->dpp_pkex_code) | ||
| 531 | 119 | + if ((id_val != 0 && id_val != 1)) | ||
| 532 | 120 | return -1; | ||
| 533 | 121 | |||
| 534 | 122 | /* TODO: Support multiple PKEX entries */ | ||
| 535 | diff --git a/debian/patches/series b/debian/patches/series | |||
| 536 | index 4a7edee..96640f3 100644 | |||
| 537 | --- a/debian/patches/series | |||
| 538 | +++ b/debian/patches/series | |||
| 539 | @@ -7,14 +7,9 @@ systemd-add-reload-support.patch | |||
| 540 | 7 | manpage-replace-wheel-with-netdev.patch | 7 | manpage-replace-wheel-with-netdev.patch |
| 541 | 8 | upstream-fixes/0001-nl80211-add-extra-ies-only-if-allowed-by-driver.patch | 8 | upstream-fixes/0001-nl80211-add-extra-ies-only-if-allowed-by-driver.patch |
| 542 | 9 | upstream-fixes/0002-AP-guard-FT-SAE-code-with-CONFIG_IEEE80211R_AP.patch | 9 | upstream-fixes/0002-AP-guard-FT-SAE-code-with-CONFIG_IEEE80211R_AP.patch |
| 543 | 10 | upstream-fixes/0003-OpenSSL-Drop-security-level-to-0-with-OpenSSL-3.0-wh.patch | ||
| 544 | 11 | allow-legacy-renegotiation.patch | 10 | allow-legacy-renegotiation.patch |
| 545 | 12 | wpa_service_netdev.patch | 11 | wpa_service_netdev.patch |
| 546 | 13 | upstream-fixes/0013-wnm-Choose-best-available-bss-not-just-first-one.patch | ||
| 547 | 14 | upstream-fixes/0014-wpa_supplicant-Fix-wpa_supplicant-configuration-pars.patch | ||
| 548 | 15 | upstream-fixes/0015-Abort-ongoing-scan.patch | ||
| 549 | 16 | upstream-fixes/0016-Override-ieee80211w-from-pmf-for-AP-mode-in-wpa_supp.patch | ||
| 550 | 17 | 0017-CVE-2023-52160-PEAP-client-Update-Phase-2-authentica.patch | ||
| 551 | 18 | CVE-2022-37660.patch | ||
| 552 | 19 | CVE-2024-5290-lib_engine_trusted_path.patch | 12 | CVE-2024-5290-lib_engine_trusted_path.patch |
| 553 | 20 | 0019-Send-CTRL-EVENT-SIGNAL-CHANGE-message-to-control-int.patch | 13 | 0019-Send-CTRL-EVENT-SIGNAL-CHANGE-message-to-control-int.patch |
| 554 | 14 | Bump-DEFAULT_BSS_MAX_COUNT-to-1000.patch | ||
| 555 | 15 | 0015-Revert-Mark-authorization-completed-on-driver-indica.patch | ||
| 556 | diff --git a/debian/patches/upstream-fixes/0002-AP-guard-FT-SAE-code-with-CONFIG_IEEE80211R_AP.patch b/debian/patches/upstream-fixes/0002-AP-guard-FT-SAE-code-with-CONFIG_IEEE80211R_AP.patch | |||
| 557 | index 6509bcd..8748cf6 100644 | |||
| 558 | --- a/debian/patches/upstream-fixes/0002-AP-guard-FT-SAE-code-with-CONFIG_IEEE80211R_AP.patch | |||
| 559 | +++ b/debian/patches/upstream-fixes/0002-AP-guard-FT-SAE-code-with-CONFIG_IEEE80211R_AP.patch | |||
| 560 | @@ -14,11 +14,9 @@ Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> | |||
| 561 | 14 | src/ap/wpa_auth_ie.c | 6 ++++++ | 14 | src/ap/wpa_auth_ie.c | 6 ++++++ |
| 562 | 15 | 1 file changed, 6 insertions(+) | 15 | 1 file changed, 6 insertions(+) |
| 563 | 16 | 16 | ||
| 564 | 17 | diff --git a/src/ap/wpa_auth_ie.c b/src/ap/wpa_auth_ie.c | ||
| 565 | 18 | index 524922e..d63cbeb 100644 | ||
| 566 | 19 | --- a/src/ap/wpa_auth_ie.c | 17 | --- a/src/ap/wpa_auth_ie.c |
| 567 | 20 | +++ b/src/ap/wpa_auth_ie.c | 18 | +++ b/src/ap/wpa_auth_ie.c |
| 569 | 21 | @@ -228,11 +228,13 @@ int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len, | 19 | @@ -241,6 +241,7 @@ |
| 570 | 22 | pos += RSN_SELECTOR_LEN; | 20 | pos += RSN_SELECTOR_LEN; |
| 571 | 23 | num_suites++; | 21 | num_suites++; |
| 572 | 24 | } | 22 | } |
| 573 | @@ -26,31 +24,37 @@ index 524922e..d63cbeb 100644 | |||
| 574 | 26 | if (conf->wpa_key_mgmt & WPA_KEY_MGMT_FT_SAE) { | 24 | if (conf->wpa_key_mgmt & WPA_KEY_MGMT_FT_SAE) { |
| 575 | 27 | RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FT_SAE); | 25 | RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FT_SAE); |
| 576 | 28 | pos += RSN_SELECTOR_LEN; | 26 | pos += RSN_SELECTOR_LEN; |
| 577 | 27 | @@ -251,6 +252,7 @@ | ||
| 578 | 28 | pos += RSN_SELECTOR_LEN; | ||
| 579 | 29 | num_suites++; | 29 | num_suites++; |
| 580 | 30 | } | 30 | } |
| 581 | 31 | +#endif /* CONFIG_IEEE80211R_AP */ | 31 | +#endif /* CONFIG_IEEE80211R_AP */ |
| 582 | 32 | #endif /* CONFIG_SAE */ | 32 | #endif /* CONFIG_SAE */ |
| 583 | 33 | if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X_SUITE_B) { | 33 | if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X_SUITE_B) { |
| 584 | 34 | RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_802_1X_SUITE_B); | 34 | RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_802_1X_SUITE_B); |
| 588 | 35 | @@ -670,8 +672,10 @@ wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth, | 35 | @@ -700,10 +702,12 @@ |
| 586 | 36 | #ifdef CONFIG_SAE | ||
| 587 | 37 | else if (data.key_mgmt & WPA_KEY_MGMT_SAE) | ||
| 589 | 38 | selector = RSN_AUTH_KEY_MGMT_SAE; | 36 | selector = RSN_AUTH_KEY_MGMT_SAE; |
| 590 | 37 | else if (data.key_mgmt & WPA_KEY_MGMT_SAE_EXT_KEY) | ||
| 591 | 38 | selector = RSN_AUTH_KEY_MGMT_SAE_EXT_KEY; | ||
| 592 | 39 | +#ifdef CONFIG_IEEE80211R_AP | 39 | +#ifdef CONFIG_IEEE80211R_AP |
| 593 | 40 | else if (data.key_mgmt & WPA_KEY_MGMT_FT_SAE) | 40 | else if (data.key_mgmt & WPA_KEY_MGMT_FT_SAE) |
| 594 | 41 | selector = RSN_AUTH_KEY_MGMT_FT_SAE; | 41 | selector = RSN_AUTH_KEY_MGMT_FT_SAE; |
| 595 | 42 | else if (data.key_mgmt & WPA_KEY_MGMT_FT_SAE_EXT_KEY) | ||
| 596 | 43 | selector = RSN_AUTH_KEY_MGMT_FT_SAE_EXT_KEY; | ||
| 597 | 42 | +#endif /* CONFIG_IEEE80211R_AP */ | 44 | +#endif /* CONFIG_IEEE80211R_AP */ |
| 598 | 43 | #endif /* CONFIG_SAE */ | 45 | #endif /* CONFIG_SAE */ |
| 599 | 44 | else if (data.key_mgmt & WPA_KEY_MGMT_IEEE8021X) | 46 | else if (data.key_mgmt & WPA_KEY_MGMT_IEEE8021X) |
| 600 | 45 | selector = RSN_AUTH_KEY_MGMT_UNSPEC_802_1X; | 47 | selector = RSN_AUTH_KEY_MGMT_UNSPEC_802_1X; |
| 604 | 46 | @@ -778,8 +782,10 @@ wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth, | 48 | @@ -820,10 +824,12 @@ |
| 602 | 47 | #ifdef CONFIG_SAE | ||
| 603 | 48 | else if (key_mgmt & WPA_KEY_MGMT_SAE) | ||
| 605 | 49 | sm->wpa_key_mgmt = WPA_KEY_MGMT_SAE; | 49 | sm->wpa_key_mgmt = WPA_KEY_MGMT_SAE; |
| 606 | 50 | else if (key_mgmt & WPA_KEY_MGMT_SAE_EXT_KEY) | ||
| 607 | 51 | sm->wpa_key_mgmt = WPA_KEY_MGMT_SAE_EXT_KEY; | ||
| 608 | 50 | +#ifdef CONFIG_IEEE80211R_AP | 52 | +#ifdef CONFIG_IEEE80211R_AP |
| 609 | 51 | else if (key_mgmt & WPA_KEY_MGMT_FT_SAE) | 53 | else if (key_mgmt & WPA_KEY_MGMT_FT_SAE) |
| 610 | 52 | sm->wpa_key_mgmt = WPA_KEY_MGMT_FT_SAE; | 54 | sm->wpa_key_mgmt = WPA_KEY_MGMT_FT_SAE; |
| 612 | 53 | +#endif /* CONFIG_IEEE80211R_AP */ | 55 | else if (key_mgmt & WPA_KEY_MGMT_FT_SAE_EXT_KEY) |
| 613 | 56 | sm->wpa_key_mgmt = WPA_KEY_MGMT_FT_SAE_EXT_KEY; | ||
| 614 | 57 | +#endif /* CONFIG_IEEE80211R_AP */ | ||
| 615 | 54 | #endif /* CONFIG_SAE */ | 58 | #endif /* CONFIG_SAE */ |
| 616 | 55 | else if (key_mgmt & WPA_KEY_MGMT_IEEE8021X) | 59 | else if (key_mgmt & WPA_KEY_MGMT_IEEE8021X) |
| 617 | 56 | sm->wpa_key_mgmt = WPA_KEY_MGMT_IEEE8021X; | 60 | sm->wpa_key_mgmt = WPA_KEY_MGMT_IEEE8021X; |
| 618 | diff --git a/debian/patches/upstream-fixes/0003-OpenSSL-Drop-security-level-to-0-with-OpenSSL-3.0-wh.patch b/debian/patches/upstream-fixes/0003-OpenSSL-Drop-security-level-to-0-with-OpenSSL-3.0-wh.patch | |||
| 619 | 57 | deleted file mode 100644 | 61 | deleted file mode 100644 |
| 620 | index 18f879c..0000000 | |||
| 621 | --- a/debian/patches/upstream-fixes/0003-OpenSSL-Drop-security-level-to-0-with-OpenSSL-3.0-wh.patch | |||
| 622 | +++ /dev/null | |||
| 623 | @@ -1,57 +0,0 @@ | |||
| 624 | 1 | From: Jouni Malinen <j@w1.fi> | ||
| 625 | 2 | Date: Sun, 22 May 2022 17:01:35 +0300 | ||
| 626 | 3 | Subject: OpenSSL: Drop security level to 0 with OpenSSL 3.0 when using TLS 1.0/1.1 | ||
| 627 | 4 | |||
| 628 | 5 | Commit 9afb68b03976 ("OpenSSL: Allow systemwide secpolicy overrides for | ||
| 629 | 6 | TLS version") with commit 58bbcfa31b18 ("OpenSSL: Update security level | ||
| 630 | 7 | drop for TLS 1.0/1.1 with OpenSSL 3.0") allow this workaround to be | ||
| 631 | 8 | enabled with an explicit network configuration parameter. However, the | ||
| 632 | 9 | default settings are still allowing TLS 1.0 and 1.1 to be negotiated | ||
| 633 | 10 | just to see them fail immediately when using OpenSSL 3.0. This is not | ||
| 634 | 11 | exactly helpful especially when the OpenSSL error message for this | ||
| 635 | 12 | particular case is "internal error" which does not really say anything | ||
| 636 | 13 | about the reason for the error. | ||
| 637 | 14 | |||
| 638 | 15 | It is is a bit inconvenient to update the security policy for this | ||
| 639 | 16 | particular issue based on the negotiated TLS version since that happens | ||
| 640 | 17 | in the middle of processing for the first message from the server. | ||
| 641 | 18 | However, this can be done by using the debug callback for printing out | ||
| 642 | 19 | the received TLS messages during processing. | ||
| 643 | 20 | |||
| 644 | 21 | Drop the OpenSSL security level to 0 if that is the only option to | ||
| 645 | 22 | continue the TLS negotiation, i.e., when TLS 1.0/1.1 are still allowed | ||
| 646 | 23 | in wpa_supplicant default configuration and OpenSSL 3.0 with the | ||
| 647 | 24 | constraint on MD5-SHA1 use. | ||
| 648 | 25 | |||
| 649 | 26 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 650 | 27 | |||
| 651 | 28 | Bug-Debian: https://bugs.debian.org/1011121 | ||
| 652 | 29 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/1958267 | ||
| 653 | 30 | Origin: upstream, commit:bc99366f9b960150aa2e369048bbc2218c1d414e | ||
| 654 | 31 | --- | ||
| 655 | 32 | src/crypto/tls_openssl.c | 9 +++++++++ | ||
| 656 | 33 | 1 file changed, 9 insertions(+) | ||
| 657 | 34 | |||
| 658 | 35 | diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c | ||
| 659 | 36 | index 6602ac64f591..78621d926dab 100644 | ||
| 660 | 37 | --- a/src/crypto/tls_openssl.c | ||
| 661 | 38 | +++ b/src/crypto/tls_openssl.c | ||
| 662 | 39 | @@ -1557,6 +1557,15 @@ static void tls_msg_cb(int write_p, int version, int content_type, | ||
| 663 | 40 | struct tls_connection *conn = arg; | ||
| 664 | 41 | const u8 *pos = buf; | ||
| 665 | 42 | |||
| 666 | 43 | +#if OPENSSL_VERSION_NUMBER >= 0x30000000L | ||
| 667 | 44 | + if ((SSL_version(ssl) == TLS1_VERSION || | ||
| 668 | 45 | + SSL_version(ssl) == TLS1_1_VERSION) && | ||
| 669 | 46 | + SSL_get_security_level(ssl) > 0) { | ||
| 670 | 47 | + wpa_printf(MSG_DEBUG, | ||
| 671 | 48 | + "OpenSSL: Drop security level to 0 to allow TLS 1.0/1.1 use of MD5-SHA1 signature algorithm"); | ||
| 672 | 49 | + SSL_set_security_level(ssl, 0); | ||
| 673 | 50 | + } | ||
| 674 | 51 | +#endif /* OpenSSL version >= 3.0 */ | ||
| 675 | 52 | if (write_p == 2) { | ||
| 676 | 53 | wpa_printf(MSG_DEBUG, | ||
| 677 | 54 | "OpenSSL: session ver=0x%x content_type=%d", | ||
| 678 | 55 | -- | ||
| 679 | 56 | 2.39.0 | ||
| 680 | 57 | |||
| 681 | diff --git a/debian/patches/upstream-fixes/0013-wnm-Choose-best-available-bss-not-just-first-one.patch b/debian/patches/upstream-fixes/0013-wnm-Choose-best-available-bss-not-just-first-one.patch | |||
| 682 | 58 | deleted file mode 100644 | 0 | deleted file mode 100644 |
| 683 | index d36a6e5..0000000 | |||
| 684 | --- a/debian/patches/upstream-fixes/0013-wnm-Choose-best-available-bss-not-just-first-one.patch | |||
| 685 | +++ /dev/null | |||
| 686 | @@ -1,117 +0,0 @@ | |||
| 687 | 1 | From: Ben Greear <greearb@candelatech.com> | ||
| 688 | 2 | Date: Thu, 27 Jul 2023 09:02:11 -0700 | ||
| 689 | 3 | Subject: wnm: Choose best available bss, not just first one. | ||
| 690 | 4 | |||
| 691 | 5 | This should allow STA to make better choice about which | ||
| 692 | 6 | BSS to roam to. | ||
| 693 | 7 | |||
| 694 | 8 | Use estimated-throughput as comparison value. Can improve | ||
| 695 | 9 | the est-tput measurement to improve this selection criteria | ||
| 696 | 10 | if wanted in the future. | ||
| 697 | 11 | |||
| 698 | 12 | Signed-off-by: Ben Greear <greearb@candelatech.com> | ||
| 699 | 13 | --- | ||
| 700 | 14 | wpa_supplicant/wnm_sta.c | 55 ++++++++++++++++++++++++++++++------------------ | ||
| 701 | 15 | 1 file changed, 34 insertions(+), 21 deletions(-) | ||
| 702 | 16 | |||
| 703 | 17 | diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c | ||
| 704 | 18 | index 96160dc..36cc8e4 100644 | ||
| 705 | 19 | --- a/wpa_supplicant/wnm_sta.c | ||
| 706 | 20 | +++ b/wpa_supplicant/wnm_sta.c | ||
| 707 | 21 | @@ -609,22 +609,6 @@ static void wnm_clear_acceptable(struct wpa_supplicant *wpa_s) | ||
| 708 | 22 | wpa_s->wnm_neighbor_report_elements[i].acceptable = 0; | ||
| 709 | 23 | } | ||
| 710 | 24 | |||
| 711 | 25 | - | ||
| 712 | 26 | -static struct wpa_bss * get_first_acceptable(struct wpa_supplicant *wpa_s) | ||
| 713 | 27 | -{ | ||
| 714 | 28 | - unsigned int i; | ||
| 715 | 29 | - struct neighbor_report *nei; | ||
| 716 | 30 | - | ||
| 717 | 31 | - for (i = 0; i < wpa_s->wnm_num_neighbor_report; i++) { | ||
| 718 | 32 | - nei = &wpa_s->wnm_neighbor_report_elements[i]; | ||
| 719 | 33 | - if (nei->acceptable) | ||
| 720 | 34 | - return wpa_bss_get_bssid(wpa_s, nei->bssid); | ||
| 721 | 35 | - } | ||
| 722 | 36 | - | ||
| 723 | 37 | - return NULL; | ||
| 724 | 38 | -} | ||
| 725 | 39 | - | ||
| 726 | 40 | - | ||
| 727 | 41 | #ifdef CONFIG_MBO | ||
| 728 | 42 | static struct wpa_bss * | ||
| 729 | 43 | get_mbo_transition_candidate(struct wpa_supplicant *wpa_s, | ||
| 730 | 44 | @@ -718,6 +702,19 @@ end: | ||
| 731 | 45 | } | ||
| 732 | 46 | #endif /* CONFIG_MBO */ | ||
| 733 | 47 | |||
| 734 | 48 | +struct wpa_bss* find_best_target(struct wpa_bss* a, struct wpa_bss* b) | ||
| 735 | 49 | +{ | ||
| 736 | 50 | + if (a->est_throughput > b->est_throughput) { | ||
| 737 | 51 | + wpa_printf(MSG_DEBUG, "WNM: A is best: " MACSTR " est-tput: %d B: " MACSTR " est-tput: %d", | ||
| 738 | 52 | + MAC2STR(a->bssid), a->est_throughput, | ||
| 739 | 53 | + MAC2STR(b->bssid), b->est_throughput); | ||
| 740 | 54 | + return a; | ||
| 741 | 55 | + } | ||
| 742 | 56 | + wpa_printf(MSG_DEBUG, "WNM: B is best, A: " MACSTR " est-tput: %d B: " MACSTR " est-tput: %d", | ||
| 743 | 57 | + MAC2STR(a->bssid), a->est_throughput, | ||
| 744 | 58 | + MAC2STR(b->bssid), b->est_throughput); | ||
| 745 | 59 | + return b; | ||
| 746 | 60 | +} | ||
| 747 | 61 | |||
| 748 | 62 | static struct wpa_bss * | ||
| 749 | 63 | compare_scan_neighbor_results(struct wpa_supplicant *wpa_s, os_time_t age_secs, | ||
| 750 | 64 | @@ -726,6 +723,9 @@ compare_scan_neighbor_results(struct wpa_supplicant *wpa_s, os_time_t age_secs, | ||
| 751 | 65 | u8 i; | ||
| 752 | 66 | struct wpa_bss *bss = wpa_s->current_bss; | ||
| 753 | 67 | struct wpa_bss *target; | ||
| 754 | 68 | + struct wpa_bss *best_target = bss; | ||
| 755 | 69 | + struct wpa_bss *bss_in_list = NULL; | ||
| 756 | 70 | + long diff; | ||
| 757 | 71 | |||
| 758 | 72 | if (!bss) | ||
| 759 | 73 | return NULL; | ||
| 760 | 74 | @@ -812,25 +812,38 @@ compare_scan_neighbor_results(struct wpa_supplicant *wpa_s, os_time_t age_secs, | ||
| 761 | 75 | } | ||
| 762 | 76 | |||
| 763 | 77 | nei->acceptable = 1; | ||
| 764 | 78 | + | ||
| 765 | 79 | + best_target = find_best_target(target, best_target); | ||
| 766 | 80 | + if (target == bss) | ||
| 767 | 81 | + bss_in_list = bss; | ||
| 768 | 82 | } | ||
| 769 | 83 | |||
| 770 | 84 | #ifdef CONFIG_MBO | ||
| 771 | 85 | if (wpa_s->wnm_mbo_trans_reason_present) | ||
| 772 | 86 | target = get_mbo_transition_candidate(wpa_s, reason); | ||
| 773 | 87 | else | ||
| 774 | 88 | - target = get_first_acceptable(wpa_s); | ||
| 775 | 89 | + target = best_target; | ||
| 776 | 90 | #else /* CONFIG_MBO */ | ||
| 777 | 91 | - target = get_first_acceptable(wpa_s); | ||
| 778 | 92 | + target = best_target; | ||
| 779 | 93 | #endif /* CONFIG_MBO */ | ||
| 780 | 94 | |||
| 781 | 95 | if (target) { | ||
| 782 | 96 | wpa_printf(MSG_DEBUG, | ||
| 783 | 97 | "WNM: Found an acceptable preferred transition candidate BSS " | ||
| 784 | 98 | - MACSTR " (RSSI %d)", | ||
| 785 | 99 | - MAC2STR(target->bssid), target->level); | ||
| 786 | 100 | + MACSTR " (RSSI %d, tput: %d bss-tput: %d)", | ||
| 787 | 101 | + MAC2STR(target->bssid), target->level, target->est_throughput, | ||
| 788 | 102 | + bss->est_throughput); | ||
| 789 | 103 | } | ||
| 790 | 104 | |||
| 791 | 105 | - return target; | ||
| 792 | 106 | + if (!bss_in_list) | ||
| 793 | 107 | + return target; | ||
| 794 | 108 | + | ||
| 795 | 109 | + diff = target->est_throughput - bss_in_list->est_throughput; | ||
| 796 | 110 | + if (diff > bss_in_list->est_throughput >> 4) { | ||
| 797 | 111 | + /* It is more than 100/16 percent better, so switch. */ | ||
| 798 | 112 | + return target; | ||
| 799 | 113 | + } | ||
| 800 | 114 | + return bss_in_list; /* stay with our existing bss, not enough change in est rate to switch. */ | ||
| 801 | 115 | } | ||
| 802 | 116 | |||
| 803 | 117 | |||
| 804 | diff --git a/debian/patches/upstream-fixes/0014-wpa_supplicant-Fix-wpa_supplicant-configuration-pars.patch b/debian/patches/upstream-fixes/0014-wpa_supplicant-Fix-wpa_supplicant-configuration-pars.patch | |||
| 805 | 118 | deleted file mode 100644 | 0 | deleted file mode 100644 |
| 806 | index 841d0d8..0000000 | |||
| 807 | --- a/debian/patches/upstream-fixes/0014-wpa_supplicant-Fix-wpa_supplicant-configuration-pars.patch | |||
| 808 | +++ /dev/null | |||
| 809 | @@ -1,28 +0,0 @@ | |||
| 810 | 1 | From: Michael Lee <michael-cy.lee@mediatek.com> | ||
| 811 | 2 | Date: Thu, 27 Jul 2023 16:29:22 +0800 | ||
| 812 | 3 | Subject: wpa_supplicant: Fix wpa_supplicant configuration parsing error | ||
| 813 | 4 | |||
| 814 | 5 | In the original flow, after hostapd_config_tx_queue successfully | ||
| 815 | 6 | parses a tx_queue variable, it would not return immediately. Then it | ||
| 816 | 7 | would print out "unknow global field" later and set return val to -1. | ||
| 817 | 8 | |||
| 818 | 9 | This patch returns immediately after hostapd_config_tx_queue | ||
| 819 | 10 | successfully parses a tx_queue variable. | ||
| 820 | 11 | |||
| 821 | 12 | Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com> | ||
| 822 | 13 | --- | ||
| 823 | 14 | wpa_supplicant/config.c | 1 + | ||
| 824 | 15 | 1 file changed, 1 insertion(+) | ||
| 825 | 16 | |||
| 826 | 17 | diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c | ||
| 827 | 18 | index bf062b0..de08fff 100644 | ||
| 828 | 19 | --- a/wpa_supplicant/config.c | ||
| 829 | 20 | +++ b/wpa_supplicant/config.c | ||
| 830 | 21 | @@ -5397,6 +5397,7 @@ int wpa_config_process_global(struct wpa_config *config, char *pos, int line) | ||
| 831 | 22 | line); | ||
| 832 | 23 | return -1; | ||
| 833 | 24 | } | ||
| 834 | 25 | + return ret; | ||
| 835 | 26 | } | ||
| 836 | 27 | |||
| 837 | 28 | if (os_strncmp(pos, "wmm_ac_", 7) == 0) { | ||
| 838 | diff --git a/debian/patches/upstream-fixes/0015-Abort-ongoing-scan.patch b/debian/patches/upstream-fixes/0015-Abort-ongoing-scan.patch | |||
| 839 | 29 | deleted file mode 100644 | 0 | deleted file mode 100644 |
| 840 | index 671af84..0000000 | |||
| 841 | --- a/debian/patches/upstream-fixes/0015-Abort-ongoing-scan.patch | |||
| 842 | +++ /dev/null | |||
| 843 | @@ -1,25 +0,0 @@ | |||
| 844 | 1 | From: Chaitanya Tata <chaitanya.mgit@gmail.com> | ||
| 845 | 2 | Date: Tue, 18 Jul 2023 01:21:37 +0530 | ||
| 846 | 3 | Subject: Abort ongoing scan | ||
| 847 | 4 | |||
| 848 | 5 | Along with canceling queued scan, abort ongoing scan if any, this | ||
| 849 | 6 | ensures Wi-Fi interface is in usable state after disconnect is issued, | ||
| 850 | 7 | else subsequent scan after disconnect might fail with EBUSY. | ||
| 851 | 8 | |||
| 852 | 9 | Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no> | ||
| 853 | 10 | --- | ||
| 854 | 11 | wpa_supplicant/wpa_supplicant.c | 1 + | ||
| 855 | 12 | 1 file changed, 1 insertion(+) | ||
| 856 | 13 | |||
| 857 | 14 | diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c | ||
| 858 | 15 | index d37a994..917aca4 100644 | ||
| 859 | 16 | --- a/wpa_supplicant/wpa_supplicant.c | ||
| 860 | 17 | +++ b/wpa_supplicant/wpa_supplicant.c | ||
| 861 | 18 | @@ -8181,6 +8181,7 @@ void wpas_request_disconnection(struct wpa_supplicant *wpa_s) | ||
| 862 | 19 | wpa_s->disconnected = 1; | ||
| 863 | 20 | wpa_supplicant_cancel_sched_scan(wpa_s); | ||
| 864 | 21 | wpa_supplicant_cancel_scan(wpa_s); | ||
| 865 | 22 | + wpas_abort_ongoing_scan(wpa_s); | ||
| 866 | 23 | wpa_supplicant_deauthenticate(wpa_s, WLAN_REASON_DEAUTH_LEAVING); | ||
| 867 | 24 | eloop_cancel_timeout(wpas_network_reenabled, wpa_s, NULL); | ||
| 868 | 25 | radio_remove_works(wpa_s, "connect", 0); | ||
| 869 | diff --git a/debian/patches/upstream-fixes/0016-Override-ieee80211w-from-pmf-for-AP-mode-in-wpa_supp.patch b/debian/patches/upstream-fixes/0016-Override-ieee80211w-from-pmf-for-AP-mode-in-wpa_supp.patch | |||
| 870 | 26 | deleted file mode 100644 | 0 | deleted file mode 100644 |
| 871 | index 2b432d6..0000000 | |||
| 872 | --- a/debian/patches/upstream-fixes/0016-Override-ieee80211w-from-pmf-for-AP-mode-in-wpa_supp.patch | |||
| 873 | +++ /dev/null | |||
| 874 | @@ -1,36 +0,0 @@ | |||
| 875 | 1 | From 5f3cdc06489ff1ec16d75c3ff41f5ac7c2f62c7c Mon Sep 17 00:00:00 2001 | ||
| 876 | 2 | From: Chaoli Zhou <quic_zchaoli@quicinc.com> | ||
| 877 | 3 | Date: Thu, 8 Sep 2022 17:43:32 +0800 | ||
| 878 | 4 | Subject: [PATCH] Override ieee80211w from pmf for AP mode in wpa_supplicant | ||
| 879 | 5 | |||
| 880 | 6 | Since NetworkManager doesn't support setting ieee80211w to | ||
| 881 | 7 | wpa_supplicant and only support pmf, so override ieee80211w from pmf for | ||
| 882 | 8 | AP mode if ieee80211w not configurated. Do not change behavior for the | ||
| 883 | 9 | P2P GO cases. | ||
| 884 | 10 | |||
| 885 | 11 | Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com> | ||
| 886 | 12 | --- | ||
| 887 | 13 | wpa_supplicant/ap.c | 6 +++++- | ||
| 888 | 14 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
| 889 | 15 | |||
| 890 | 16 | diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c | ||
| 891 | 17 | index 67f2d8ac1..653f15f54 100644 | ||
| 892 | 18 | --- a/wpa_supplicant/ap.c | ||
| 893 | 19 | +++ b/wpa_supplicant/ap.c | ||
| 894 | 20 | @@ -701,8 +701,12 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s, | ||
| 895 | 21 | bss->wpa_group_rekey = 86400; | ||
| 896 | 22 | } | ||
| 897 | 23 | |||
| 898 | 24 | - if (ssid->ieee80211w != MGMT_FRAME_PROTECTION_DEFAULT) | ||
| 899 | 25 | + if (ssid->ieee80211w != MGMT_FRAME_PROTECTION_DEFAULT) { | ||
| 900 | 26 | bss->ieee80211w = ssid->ieee80211w; | ||
| 901 | 27 | + } else if (wpa_s->conf->pmf != MGMT_FRAME_PROTECTION_DEFAULT) { | ||
| 902 | 28 | + if (ssid->mode == WPAS_MODE_AP) | ||
| 903 | 29 | + bss->ieee80211w = wpa_s->conf->pmf; | ||
| 904 | 30 | + } | ||
| 905 | 31 | |||
| 906 | 32 | #ifdef CONFIG_OCV | ||
| 907 | 33 | bss->ocv = ssid->ocv; | ||
| 908 | 34 | -- | ||
| 909 | 35 | 2.42.0 | ||
| 910 | 36 | |||
| 911 | diff --git a/hostapd/Android.mk b/hostapd/Android.mk | |||
| 912 | index bf26e41..573564d 100644 | |||
| 913 | --- a/hostapd/Android.mk | |||
| 914 | +++ b/hostapd/Android.mk | |||
| 915 | @@ -154,6 +154,7 @@ OBJS += src/utils/crc32.c | |||
| 916 | 154 | OBJS += src/common/ieee802_11_common.c | 154 | OBJS += src/common/ieee802_11_common.c |
| 917 | 155 | OBJS += src/common/wpa_common.c | 155 | OBJS += src/common/wpa_common.c |
| 918 | 156 | OBJS += src/common/hw_features_common.c | 156 | OBJS += src/common/hw_features_common.c |
| 919 | 157 | OBJS += src/common/ptksa_cache.c | ||
| 920 | 157 | 158 | ||
| 921 | 158 | OBJS += src/eapol_auth/eapol_auth_sm.c | 159 | OBJS += src/eapol_auth/eapol_auth_sm.c |
| 922 | 159 | 160 | ||
| 923 | @@ -237,6 +238,8 @@ L_CFLAGS += -DCONFIG_OCV | |||
| 924 | 237 | OBJS += src/common/ocv.c | 238 | OBJS += src/common/ocv.c |
| 925 | 238 | endif | 239 | endif |
| 926 | 239 | 240 | ||
| 927 | 241 | NEED_AES_UNWRAP=y | ||
| 928 | 242 | |||
| 929 | 240 | ifdef CONFIG_IEEE80211R | 243 | ifdef CONFIG_IEEE80211R |
| 930 | 241 | L_CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP | 244 | L_CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP |
| 931 | 242 | OBJS += src/ap/wpa_auth_ft.c | 245 | OBJS += src/ap/wpa_auth_ft.c |
| 932 | @@ -256,6 +259,7 @@ L_CFLAGS += -DCONFIG_SAE | |||
| 933 | 256 | OBJS += src/common/sae.c | 259 | OBJS += src/common/sae.c |
| 934 | 257 | ifdef CONFIG_SAE_PK | 260 | ifdef CONFIG_SAE_PK |
| 935 | 258 | L_CFLAGS += -DCONFIG_SAE_PK | 261 | L_CFLAGS += -DCONFIG_SAE_PK |
| 936 | 262 | NEED_AES_SIV=y | ||
| 937 | 259 | OBJS += src/common/sae_pk.c | 263 | OBJS += src/common/sae_pk.c |
| 938 | 260 | endif | 264 | endif |
| 939 | 261 | NEED_ECC=y | 265 | NEED_ECC=y |
| 940 | @@ -294,6 +298,12 @@ ifdef CONFIG_IEEE80211AC | |||
| 941 | 294 | L_CFLAGS += -DCONFIG_IEEE80211AC | 298 | L_CFLAGS += -DCONFIG_IEEE80211AC |
| 942 | 295 | endif | 299 | endif |
| 943 | 296 | 300 | ||
| 944 | 301 | ifdef CONFIG_IEEE80211BE | ||
| 945 | 302 | CONFIG_IEEE80211AX=y | ||
| 946 | 303 | L_CFLAGS += -DCONFIG_IEEE80211BE | ||
| 947 | 304 | OBJS += src/ap/ieee802_11_eht.c | ||
| 948 | 305 | endif | ||
| 949 | 306 | |||
| 950 | 297 | ifdef CONFIG_IEEE80211AX | 307 | ifdef CONFIG_IEEE80211AX |
| 951 | 298 | L_CFLAGS += -DCONFIG_IEEE80211AX | 308 | L_CFLAGS += -DCONFIG_IEEE80211AX |
| 952 | 299 | endif | 309 | endif |
| 953 | @@ -572,6 +582,12 @@ L_CFLAGS += -DCONFIG_DPP3 | |||
| 954 | 572 | endif | 582 | endif |
| 955 | 573 | endif | 583 | endif |
| 956 | 574 | 584 | ||
| 957 | 585 | ifdef CONFIG_NAN_USD | ||
| 958 | 586 | OBJS += src/common/nan_de.c | ||
| 959 | 587 | OBJS += src/ap/nan_usd_ap.c | ||
| 960 | 588 | L_CFLAGS += -DCONFIG_NAN_USD | ||
| 961 | 589 | endif | ||
| 962 | 590 | |||
| 963 | 575 | ifdef CONFIG_PASN | 591 | ifdef CONFIG_PASN |
| 964 | 576 | L_CFLAGS += -DCONFIG_PASN | 592 | L_CFLAGS += -DCONFIG_PASN |
| 965 | 577 | L_CFLAGS += -DCONFIG_PTKSA_CACHE | 593 | L_CFLAGS += -DCONFIG_PTKSA_CACHE |
| 966 | @@ -579,7 +595,6 @@ NEED_HMAC_SHA256_KDF=y | |||
| 967 | 579 | NEED_HMAC_SHA384_KDF=y | 595 | NEED_HMAC_SHA384_KDF=y |
| 968 | 580 | NEED_SHA256=y | 596 | NEED_SHA256=y |
| 969 | 581 | NEED_SHA384=y | 597 | NEED_SHA384=y |
| 970 | 582 | OBJS += src/common/ptksa_cache.c | ||
| 971 | 583 | endif | 598 | endif |
| 972 | 584 | 599 | ||
| 973 | 585 | ifdef CONFIG_EAP_IKEV2 | 600 | ifdef CONFIG_EAP_IKEV2 |
| 974 | @@ -632,6 +647,11 @@ ifdef CHAP | |||
| 975 | 632 | OBJS += src/eap_common/chap.c | 647 | OBJS += src/eap_common/chap.c |
| 976 | 633 | endif | 648 | endif |
| 977 | 634 | 649 | ||
| 978 | 650 | ifdef CONFIG_RADIUS_TLS | ||
| 979 | 651 | TLS_FUNCS=y | ||
| 980 | 652 | L_CFLAGS += -DCONFIG_RADIUS_TLS | ||
| 981 | 653 | endif | ||
| 982 | 654 | |||
| 983 | 635 | ifdef TLS_FUNCS | 655 | ifdef TLS_FUNCS |
| 984 | 636 | NEED_DES=y | 656 | NEED_DES=y |
| 985 | 637 | # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS) | 657 | # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS) |
| 986 | @@ -653,6 +673,7 @@ L_CFLAGS += -DCONFIG_TLSV12 | |||
| 987 | 653 | endif | 673 | endif |
| 988 | 654 | 674 | ||
| 989 | 655 | ifeq ($(CONFIG_TLS), openssl) | 675 | ifeq ($(CONFIG_TLS), openssl) |
| 990 | 676 | L_CFLAGS += -DCRYPTO_RSA_OAEP_SHA256 | ||
| 991 | 656 | ifdef TLS_FUNCS | 677 | ifdef TLS_FUNCS |
| 992 | 657 | OBJS += src/crypto/tls_openssl.c | 678 | OBJS += src/crypto/tls_openssl.c |
| 993 | 658 | OBJS += src/crypto/tls_openssl_ocsp.c | 679 | OBJS += src/crypto/tls_openssl_ocsp.c |
| 994 | @@ -825,7 +846,9 @@ endif | |||
| 995 | 825 | ifdef NEED_AES_ENCBLOCK | 846 | ifdef NEED_AES_ENCBLOCK |
| 996 | 826 | AESOBJS += src/crypto/aes-encblock.c | 847 | AESOBJS += src/crypto/aes-encblock.c |
| 997 | 827 | endif | 848 | endif |
| 998 | 849 | ifneq ($(CONFIG_TLS), openssl) | ||
| 999 | 828 | AESOBJS += src/crypto/aes-omac1.c | 850 | AESOBJS += src/crypto/aes-omac1.c |
| 1000 | 851 | endif | ||
| 1001 | 829 | ifdef NEED_AES_UNWRAP | 852 | ifdef NEED_AES_UNWRAP |
| 1002 | 830 | ifneq ($(CONFIG_TLS), openssl) | 853 | ifneq ($(CONFIG_TLS), openssl) |
| 1003 | 831 | NEED_AES_DEC=y | 854 | NEED_AES_DEC=y |
| 1004 | @@ -1026,6 +1049,9 @@ endif | |||
| 1005 | 1026 | ifdef NEED_AP_MLME | 1049 | ifdef NEED_AP_MLME |
| 1006 | 1027 | OBJS += src/ap/wmm.c | 1050 | OBJS += src/ap/wmm.c |
| 1007 | 1028 | OBJS += src/ap/ap_list.c | 1051 | OBJS += src/ap/ap_list.c |
| 1008 | 1052 | OBJS += src/ap/comeback_token.c | ||
| 1009 | 1053 | OBJS += src/pasn/pasn_responder.c | ||
| 1010 | 1054 | OBJS += src/pasn/pasn_common.c | ||
| 1011 | 1029 | OBJS += src/ap/ieee802_11.c | 1055 | OBJS += src/ap/ieee802_11.c |
| 1012 | 1030 | OBJS += src/ap/hw_features.c | 1056 | OBJS += src/ap/hw_features.c |
| 1013 | 1031 | OBJS += src/ap/dfs.c | 1057 | OBJS += src/ap/dfs.c |
| 1014 | diff --git a/hostapd/ChangeLog b/hostapd/ChangeLog | |||
| 1015 | index 279298e..1c8240d 100644 | |||
| 1016 | --- a/hostapd/ChangeLog | |||
| 1017 | +++ b/hostapd/ChangeLog | |||
| 1018 | @@ -1,5 +1,42 @@ | |||
| 1019 | 1 | ChangeLog for hostapd | 1 | ChangeLog for hostapd |
| 1020 | 2 | 2 | ||
| 1021 | 3 | 2024-07-20 - v2.11 | ||
| 1022 | 4 | * Wi-Fi Easy Connect | ||
| 1023 | 5 | - add support for DPP release 3 | ||
| 1024 | 6 | - allow Configurator parameters to be provided during config exchange | ||
| 1025 | 7 | * HE/IEEE 802.11ax/Wi-Fi 6 | ||
| 1026 | 8 | - various fixes | ||
| 1027 | 9 | * EHT/IEEE 802.11be/Wi-Fi 7 | ||
| 1028 | 10 | - add preliminary support | ||
| 1029 | 11 | * SAE: add support for fetching the password from a RADIUS server | ||
| 1030 | 12 | * support OpenSSL 3.0 API changes | ||
| 1031 | 13 | * support background radar detection and CAC with some additional | ||
| 1032 | 14 | drivers | ||
| 1033 | 15 | * support RADIUS ACL/PSK check during 4-way handshake (wpa_psk_radius=3) | ||
| 1034 | 16 | * EAP-SIM/AKA: support IMSI privacy | ||
| 1035 | 17 | * improve 4-way handshake operations | ||
| 1036 | 18 | - use Secure=1 in message 3 during PTK rekeying | ||
| 1037 | 19 | * OCV: do not check Frequency Segment 1 Channel Number for 160 MHz cases | ||
| 1038 | 20 | to avoid interoperability issues | ||
| 1039 | 21 | * support new SAE AKM suites with variable length keys | ||
| 1040 | 22 | * support new AKM for 802.1X/EAP with SHA384 | ||
| 1041 | 23 | * extend PASN support for secure ranging | ||
| 1042 | 24 | * FT: Use SHA256 to derive PMKID for AKM 00-0F-AC:3 (FT-EAP) | ||
| 1043 | 25 | - this is based on additional details being added in the IEEE 802.11 | ||
| 1044 | 26 | standard | ||
| 1045 | 27 | - the new implementation is not backwards compatible | ||
| 1046 | 28 | * improved ACS to cover additional channel types/bandwidths | ||
| 1047 | 29 | * extended Multiple BSSID support | ||
| 1048 | 30 | * fix beacon protection with FT protocol (incorrect BIGTK was provided) | ||
| 1049 | 31 | * support unsynchronized service discovery (USD) | ||
| 1050 | 32 | * add preliminary support for RADIUS/TLS | ||
| 1051 | 33 | * add support for explicit SSID protection in 4-way handshake | ||
| 1052 | 34 | (a mitigation for CVE-2023-52424; disabled by default for now, can be | ||
| 1053 | 35 | enabled with ssid_protection=1) | ||
| 1054 | 36 | * fix SAE H2E rejected groups validation to avoid downgrade attacks | ||
| 1055 | 37 | * use stricter validation for some RADIUS messages | ||
| 1056 | 38 | * a large number of other fixes, cleanup, and extensions | ||
| 1057 | 39 | |||
| 1058 | 3 | 2022-01-16 - v2.10 | 40 | 2022-01-16 - v2.10 |
| 1059 | 4 | * SAE changes | 41 | * SAE changes |
| 1060 | 5 | - improved protection against side channel attacks | 42 | - improved protection against side channel attacks |
| 1061 | diff --git a/hostapd/Makefile b/hostapd/Makefile | |||
| 1062 | index e37c13b..ca44392 100644 | |||
| 1063 | --- a/hostapd/Makefile | |||
| 1064 | +++ b/hostapd/Makefile | |||
| 1065 | @@ -84,6 +84,7 @@ OBJS += ../src/ap/beacon.o | |||
| 1066 | 84 | OBJS += ../src/ap/bss_load.o | 84 | OBJS += ../src/ap/bss_load.o |
| 1067 | 85 | OBJS += ../src/ap/neighbor_db.o | 85 | OBJS += ../src/ap/neighbor_db.o |
| 1068 | 86 | OBJS += ../src/ap/rrm.o | 86 | OBJS += ../src/ap/rrm.o |
| 1069 | 87 | OBJS += ../src/common/ptksa_cache.o | ||
| 1070 | 87 | 88 | ||
| 1071 | 88 | OBJS_c = hostapd_cli.o | 89 | OBJS_c = hostapd_cli.o |
| 1072 | 89 | OBJS_c += ../src/common/wpa_ctrl.o | 90 | OBJS_c += ../src/common/wpa_ctrl.o |
| 1073 | @@ -167,7 +168,7 @@ OBJS += ../src/eapol_auth/eapol_auth_sm.o | |||
| 1074 | 167 | 168 | ||
| 1075 | 168 | 169 | ||
| 1076 | 169 | ifdef CONFIG_CODE_COVERAGE | 170 | ifdef CONFIG_CODE_COVERAGE |
| 1078 | 170 | CFLAGS += -O0 -fprofile-arcs -ftest-coverage | 171 | CFLAGS += -O0 -fprofile-arcs -ftest-coverage -U_FORTIFY_SOURCE |
| 1079 | 171 | LIBS += -lgcov | 172 | LIBS += -lgcov |
| 1080 | 172 | LIBS_c += -lgcov | 173 | LIBS_c += -lgcov |
| 1081 | 173 | LIBS_h += -lgcov | 174 | LIBS_h += -lgcov |
| 1082 | @@ -276,6 +277,8 @@ CFLAGS += -DCONFIG_OCV | |||
| 1083 | 276 | OBJS += ../src/common/ocv.o | 277 | OBJS += ../src/common/ocv.o |
| 1084 | 277 | endif | 278 | endif |
| 1085 | 278 | 279 | ||
| 1086 | 280 | NEED_AES_UNWRAP=y | ||
| 1087 | 281 | |||
| 1088 | 279 | ifdef CONFIG_IEEE80211R | 282 | ifdef CONFIG_IEEE80211R |
| 1089 | 280 | CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP | 283 | CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP |
| 1090 | 281 | OBJS += ../src/ap/wpa_auth_ft.o | 284 | OBJS += ../src/ap/wpa_auth_ft.o |
| 1091 | @@ -295,6 +298,7 @@ CFLAGS += -DCONFIG_SAE | |||
| 1092 | 295 | OBJS += ../src/common/sae.o | 298 | OBJS += ../src/common/sae.o |
| 1093 | 296 | ifdef CONFIG_SAE_PK | 299 | ifdef CONFIG_SAE_PK |
| 1094 | 297 | CFLAGS += -DCONFIG_SAE_PK | 300 | CFLAGS += -DCONFIG_SAE_PK |
| 1095 | 301 | NEED_AES_SIV=y | ||
| 1096 | 298 | OBJS += ../src/common/sae_pk.o | 302 | OBJS += ../src/common/sae_pk.o |
| 1097 | 299 | endif | 303 | endif |
| 1098 | 300 | NEED_ECC=y | 304 | NEED_ECC=y |
| 1099 | @@ -339,6 +343,12 @@ ifdef CONFIG_IEEE80211AC | |||
| 1100 | 339 | CFLAGS += -DCONFIG_IEEE80211AC | 343 | CFLAGS += -DCONFIG_IEEE80211AC |
| 1101 | 340 | endif | 344 | endif |
| 1102 | 341 | 345 | ||
| 1103 | 346 | ifdef CONFIG_IEEE80211BE | ||
| 1104 | 347 | CONFIG_IEEE80211AX=y | ||
| 1105 | 348 | CFLAGS += -DCONFIG_IEEE80211BE | ||
| 1106 | 349 | OBJS += ../src/ap/ieee802_11_eht.o | ||
| 1107 | 350 | endif | ||
| 1108 | 351 | |||
| 1109 | 342 | ifdef CONFIG_IEEE80211AX | 352 | ifdef CONFIG_IEEE80211AX |
| 1110 | 343 | CFLAGS += -DCONFIG_IEEE80211AX | 353 | CFLAGS += -DCONFIG_IEEE80211AX |
| 1111 | 344 | OBJS += ../src/ap/ieee802_11_he.o | 354 | OBJS += ../src/ap/ieee802_11_he.o |
| 1112 | @@ -598,6 +608,12 @@ CFLAGS += -DCONFIG_DPP3 | |||
| 1113 | 598 | endif | 608 | endif |
| 1114 | 599 | endif | 609 | endif |
| 1115 | 600 | 610 | ||
| 1116 | 611 | ifdef CONFIG_NAN_USD | ||
| 1117 | 612 | OBJS += ../src/common/nan_de.o | ||
| 1118 | 613 | OBJS += ../src/ap/nan_usd_ap.o | ||
| 1119 | 614 | CFLAGS += -DCONFIG_NAN_USD | ||
| 1120 | 615 | endif | ||
| 1121 | 616 | |||
| 1122 | 601 | ifdef CONFIG_PASN | 617 | ifdef CONFIG_PASN |
| 1123 | 602 | CFLAGS += -DCONFIG_PASN | 618 | CFLAGS += -DCONFIG_PASN |
| 1124 | 603 | CFLAGS += -DCONFIG_PTKSA_CACHE | 619 | CFLAGS += -DCONFIG_PTKSA_CACHE |
| 1125 | @@ -605,7 +621,6 @@ NEED_HMAC_SHA256_KDF=y | |||
| 1126 | 605 | NEED_HMAC_SHA384_KDF=y | 621 | NEED_HMAC_SHA384_KDF=y |
| 1127 | 606 | NEED_SHA256=y | 622 | NEED_SHA256=y |
| 1128 | 607 | NEED_SHA384=y | 623 | NEED_SHA384=y |
| 1129 | 608 | OBJS += ../src/common/ptksa_cache.o | ||
| 1130 | 609 | endif | 624 | endif |
| 1131 | 610 | 625 | ||
| 1132 | 611 | ifdef CONFIG_EAP_IKEV2 | 626 | ifdef CONFIG_EAP_IKEV2 |
| 1133 | @@ -667,6 +682,11 @@ ifdef CHAP | |||
| 1134 | 667 | OBJS += ../src/eap_common/chap.o | 682 | OBJS += ../src/eap_common/chap.o |
| 1135 | 668 | endif | 683 | endif |
| 1136 | 669 | 684 | ||
| 1137 | 685 | ifdef CONFIG_RADIUS_TLS | ||
| 1138 | 686 | TLS_FUNCS=y | ||
| 1139 | 687 | CFLAGS += -DCONFIG_RADIUS_TLS | ||
| 1140 | 688 | endif | ||
| 1141 | 689 | |||
| 1142 | 670 | ifdef TLS_FUNCS | 690 | ifdef TLS_FUNCS |
| 1143 | 671 | NEED_DES=y | 691 | NEED_DES=y |
| 1144 | 672 | # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS) | 692 | # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS) |
| 1145 | @@ -708,6 +728,7 @@ endif | |||
| 1146 | 708 | endif | 728 | endif |
| 1147 | 709 | 729 | ||
| 1148 | 710 | ifeq ($(CONFIG_TLS), openssl) | 730 | ifeq ($(CONFIG_TLS), openssl) |
| 1149 | 731 | CFLAGS += -DCRYPTO_RSA_OAEP_SHA256 | ||
| 1150 | 711 | CONFIG_CRYPTO=openssl | 732 | CONFIG_CRYPTO=openssl |
| 1151 | 712 | ifdef TLS_FUNCS | 733 | ifdef TLS_FUNCS |
| 1152 | 713 | OBJS += ../src/crypto/tls_openssl.o | 734 | OBJS += ../src/crypto/tls_openssl.o |
| 1153 | @@ -932,11 +953,13 @@ endif | |||
| 1154 | 932 | ifdef NEED_AES_ENCBLOCK | 953 | ifdef NEED_AES_ENCBLOCK |
| 1155 | 933 | AESOBJS += ../src/crypto/aes-encblock.o | 954 | AESOBJS += ../src/crypto/aes-encblock.o |
| 1156 | 934 | endif | 955 | endif |
| 1157 | 956 | ifneq ($(CONFIG_TLS), openssl) | ||
| 1158 | 935 | ifneq ($(CONFIG_TLS), linux) | 957 | ifneq ($(CONFIG_TLS), linux) |
| 1159 | 936 | ifneq ($(CONFIG_TLS), wolfssl) | 958 | ifneq ($(CONFIG_TLS), wolfssl) |
| 1160 | 937 | AESOBJS += ../src/crypto/aes-omac1.o | 959 | AESOBJS += ../src/crypto/aes-omac1.o |
| 1161 | 938 | endif | 960 | endif |
| 1162 | 939 | endif | 961 | endif |
| 1163 | 962 | endif | ||
| 1164 | 940 | ifdef NEED_AES_UNWRAP | 963 | ifdef NEED_AES_UNWRAP |
| 1165 | 941 | ifneq ($(CONFIG_TLS), openssl) | 964 | ifneq ($(CONFIG_TLS), openssl) |
| 1166 | 942 | ifneq ($(CONFIG_TLS), linux) | 965 | ifneq ($(CONFIG_TLS), linux) |
| 1167 | @@ -1172,6 +1195,9 @@ endif | |||
| 1168 | 1172 | ifdef NEED_AP_MLME | 1195 | ifdef NEED_AP_MLME |
| 1169 | 1173 | OBJS += ../src/ap/wmm.o | 1196 | OBJS += ../src/ap/wmm.o |
| 1170 | 1174 | OBJS += ../src/ap/ap_list.o | 1197 | OBJS += ../src/ap/ap_list.o |
| 1171 | 1198 | OBJS += ../src/ap/comeback_token.o | ||
| 1172 | 1199 | OBJS += ../src/pasn/pasn_responder.o | ||
| 1173 | 1200 | OBJS += ../src/pasn/pasn_common.o | ||
| 1174 | 1175 | OBJS += ../src/ap/ieee802_11.o | 1201 | OBJS += ../src/ap/ieee802_11.o |
| 1175 | 1176 | OBJS += ../src/ap/hw_features.o | 1202 | OBJS += ../src/ap/hw_features.o |
| 1176 | 1177 | OBJS += ../src/ap/dfs.o | 1203 | OBJS += ../src/ap/dfs.o |
| 1177 | diff --git a/hostapd/README b/hostapd/README | |||
| 1178 | index 739c964..1a0248f 100644 | |||
| 1179 | --- a/hostapd/README | |||
| 1180 | +++ b/hostapd/README | |||
| 1181 | @@ -2,7 +2,7 @@ hostapd - user space IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP | |||
| 1182 | 2 | Authenticator and RADIUS authentication server | 2 | Authenticator and RADIUS authentication server |
| 1183 | 3 | ================================================================ | 3 | ================================================================ |
| 1184 | 4 | 4 | ||
| 1186 | 5 | Copyright (c) 2002-2022, Jouni Malinen <j@w1.fi> and contributors | 5 | Copyright (c) 2002-2024, Jouni Malinen <j@w1.fi> and contributors |
| 1187 | 6 | All Rights Reserved. | 6 | All Rights Reserved. |
| 1188 | 7 | 7 | ||
| 1189 | 8 | This program is licensed under the BSD license (the one with | 8 | This program is licensed under the BSD license (the one with |
| 1190 | diff --git a/hostapd/android.config b/hostapd/android.config | |||
| 1191 | index c8b3afa..522de87 100644 | |||
| 1192 | --- a/hostapd/android.config | |||
| 1193 | +++ b/hostapd/android.config | |||
| 1194 | @@ -121,6 +121,9 @@ CONFIG_PKCS12=y | |||
| 1195 | 121 | # Build IPv6 support for RADIUS operations | 121 | # Build IPv6 support for RADIUS operations |
| 1196 | 122 | CONFIG_IPV6=y | 122 | CONFIG_IPV6=y |
| 1197 | 123 | 123 | ||
| 1198 | 124 | # Include support fo RADIUS/TLS into the RADIUS client | ||
| 1199 | 125 | #CONFIG_RADIUS_TLS=y | ||
| 1200 | 126 | |||
| 1201 | 124 | # IEEE Std 802.11r-2008 (Fast BSS Transition) | 127 | # IEEE Std 802.11r-2008 (Fast BSS Transition) |
| 1202 | 125 | #CONFIG_IEEE80211R=y | 128 | #CONFIG_IEEE80211R=y |
| 1203 | 126 | 129 | ||
| 1204 | @@ -212,3 +215,6 @@ CONFIG_NO_RANDOM_POOL=y | |||
| 1205 | 212 | # release under this optional build parameter. This functionality is subject to | 215 | # release under this optional build parameter. This functionality is subject to |
| 1206 | 213 | # be completely removed in a future release. | 216 | # be completely removed in a future release. |
| 1207 | 214 | CONFIG_WEP=y | 217 | CONFIG_WEP=y |
| 1208 | 218 | |||
| 1209 | 219 | # Wi-Fi Aware unsynchronized service discovery (NAN USD) | ||
| 1210 | 220 | #CONFIG_NAN_USD=y | ||
| 1211 | diff --git a/hostapd/config_file.c b/hostapd/config_file.c | |||
| 1212 | index b14728d..3fb0597 100644 | |||
| 1213 | --- a/hostapd/config_file.c | |||
| 1214 | +++ b/hostapd/config_file.c | |||
| 1215 | @@ -1,6 +1,6 @@ | |||
| 1216 | 1 | /* | 1 | /* |
| 1217 | 2 | * hostapd / Configuration file parser | 2 | * hostapd / Configuration file parser |
| 1219 | 3 | * Copyright (c) 2003-2018, Jouni Malinen <j@w1.fi> | 3 | * Copyright (c) 2003-2024, Jouni Malinen <j@w1.fi> |
| 1220 | 4 | * | 4 | * |
| 1221 | 5 | * This software may be distributed under the terms of the BSD license. | 5 | * This software may be distributed under the terms of the BSD license. |
| 1222 | 6 | * See README for more details. | 6 | * See README for more details. |
| 1223 | @@ -118,52 +118,6 @@ static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss, | |||
| 1224 | 118 | #endif /* CONFIG_NO_VLAN */ | 118 | #endif /* CONFIG_NO_VLAN */ |
| 1225 | 119 | 119 | ||
| 1226 | 120 | 120 | ||
| 1227 | 121 | int hostapd_acl_comp(const void *a, const void *b) | ||
| 1228 | 122 | { | ||
| 1229 | 123 | const struct mac_acl_entry *aa = a; | ||
| 1230 | 124 | const struct mac_acl_entry *bb = b; | ||
| 1231 | 125 | return os_memcmp(aa->addr, bb->addr, sizeof(macaddr)); | ||
| 1232 | 126 | } | ||
| 1233 | 127 | |||
| 1234 | 128 | |||
| 1235 | 129 | int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num, | ||
| 1236 | 130 | int vlan_id, const u8 *addr) | ||
| 1237 | 131 | { | ||
| 1238 | 132 | struct mac_acl_entry *newacl; | ||
| 1239 | 133 | |||
| 1240 | 134 | newacl = os_realloc_array(*acl, *num + 1, sizeof(**acl)); | ||
| 1241 | 135 | if (!newacl) { | ||
| 1242 | 136 | wpa_printf(MSG_ERROR, "MAC list reallocation failed"); | ||
| 1243 | 137 | return -1; | ||
| 1244 | 138 | } | ||
| 1245 | 139 | |||
| 1246 | 140 | *acl = newacl; | ||
| 1247 | 141 | os_memcpy((*acl)[*num].addr, addr, ETH_ALEN); | ||
| 1248 | 142 | os_memset(&(*acl)[*num].vlan_id, 0, sizeof((*acl)[*num].vlan_id)); | ||
| 1249 | 143 | (*acl)[*num].vlan_id.untagged = vlan_id; | ||
| 1250 | 144 | (*acl)[*num].vlan_id.notempty = !!vlan_id; | ||
| 1251 | 145 | (*num)++; | ||
| 1252 | 146 | |||
| 1253 | 147 | return 0; | ||
| 1254 | 148 | } | ||
| 1255 | 149 | |||
| 1256 | 150 | |||
| 1257 | 151 | void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num, | ||
| 1258 | 152 | const u8 *addr) | ||
| 1259 | 153 | { | ||
| 1260 | 154 | int i = 0; | ||
| 1261 | 155 | |||
| 1262 | 156 | while (i < *num) { | ||
| 1263 | 157 | if (os_memcmp((*acl)[i].addr, addr, ETH_ALEN) == 0) { | ||
| 1264 | 158 | os_remove_in_array(*acl, *num, sizeof(**acl), i); | ||
| 1265 | 159 | (*num)--; | ||
| 1266 | 160 | } else { | ||
| 1267 | 161 | i++; | ||
| 1268 | 162 | } | ||
| 1269 | 163 | } | ||
| 1270 | 164 | } | ||
| 1271 | 165 | |||
| 1272 | 166 | |||
| 1273 | 167 | static int hostapd_config_read_maclist(const char *fname, | 121 | static int hostapd_config_read_maclist(const char *fname, |
| 1274 | 168 | struct mac_acl_entry **acl, int *num) | 122 | struct mac_acl_entry **acl, int *num) |
| 1275 | 169 | { | 123 | { |
| 1276 | @@ -713,6 +667,10 @@ static int hostapd_config_parse_key_mgmt(int line, const char *value) | |||
| 1277 | 713 | val |= WPA_KEY_MGMT_FT_IEEE8021X_SHA384; | 667 | val |= WPA_KEY_MGMT_FT_IEEE8021X_SHA384; |
| 1278 | 714 | #endif /* CONFIG_SHA384 */ | 668 | #endif /* CONFIG_SHA384 */ |
| 1279 | 715 | #endif /* CONFIG_IEEE80211R_AP */ | 669 | #endif /* CONFIG_IEEE80211R_AP */ |
| 1280 | 670 | #ifdef CONFIG_SHA384 | ||
| 1281 | 671 | else if (os_strcmp(start, "WPA-EAP-SHA384") == 0) | ||
| 1282 | 672 | val |= WPA_KEY_MGMT_IEEE8021X_SHA384; | ||
| 1283 | 673 | #endif /* CONFIG_SHA384 */ | ||
| 1284 | 716 | else if (os_strcmp(start, "WPA-PSK-SHA256") == 0) | 674 | else if (os_strcmp(start, "WPA-PSK-SHA256") == 0) |
| 1285 | 717 | val |= WPA_KEY_MGMT_PSK_SHA256; | 675 | val |= WPA_KEY_MGMT_PSK_SHA256; |
| 1286 | 718 | else if (os_strcmp(start, "WPA-EAP-SHA256") == 0) | 676 | else if (os_strcmp(start, "WPA-EAP-SHA256") == 0) |
| 1287 | @@ -720,8 +678,12 @@ static int hostapd_config_parse_key_mgmt(int line, const char *value) | |||
| 1288 | 720 | #ifdef CONFIG_SAE | 678 | #ifdef CONFIG_SAE |
| 1289 | 721 | else if (os_strcmp(start, "SAE") == 0) | 679 | else if (os_strcmp(start, "SAE") == 0) |
| 1290 | 722 | val |= WPA_KEY_MGMT_SAE; | 680 | val |= WPA_KEY_MGMT_SAE; |
| 1291 | 681 | else if (os_strcmp(start, "SAE-EXT-KEY") == 0) | ||
| 1292 | 682 | val |= WPA_KEY_MGMT_SAE_EXT_KEY; | ||
| 1293 | 723 | else if (os_strcmp(start, "FT-SAE") == 0) | 683 | else if (os_strcmp(start, "FT-SAE") == 0) |
| 1294 | 724 | val |= WPA_KEY_MGMT_FT_SAE; | 684 | val |= WPA_KEY_MGMT_FT_SAE; |
| 1295 | 685 | else if (os_strcmp(start, "FT-SAE-EXT-KEY") == 0) | ||
| 1296 | 686 | val |= WPA_KEY_MGMT_FT_SAE_EXT_KEY; | ||
| 1297 | 725 | #endif /* CONFIG_SAE */ | 687 | #endif /* CONFIG_SAE */ |
| 1298 | 726 | #ifdef CONFIG_SUITEB | 688 | #ifdef CONFIG_SUITEB |
| 1299 | 727 | else if (os_strcmp(start, "WPA-EAP-SUITE-B") == 0) | 689 | else if (os_strcmp(start, "WPA-EAP-SUITE-B") == 0) |
| 1300 | @@ -1058,6 +1020,78 @@ static int add_r1kh(struct hostapd_bss_config *bss, char *value) | |||
| 1301 | 1058 | 1020 | ||
| 1302 | 1059 | return 0; | 1021 | return 0; |
| 1303 | 1060 | } | 1022 | } |
| 1304 | 1023 | |||
| 1305 | 1024 | |||
| 1306 | 1025 | int hostapd_config_read_rxkh_file(struct hostapd_bss_config *conf, | ||
| 1307 | 1026 | const char *fname) | ||
| 1308 | 1027 | { | ||
| 1309 | 1028 | FILE *f; | ||
| 1310 | 1029 | char buf[256], *pos; | ||
| 1311 | 1030 | int line = 0, errors = 0; | ||
| 1312 | 1031 | |||
| 1313 | 1032 | if (!fname) | ||
| 1314 | 1033 | return 0; | ||
| 1315 | 1034 | |||
| 1316 | 1035 | f = fopen(fname, "r"); | ||
| 1317 | 1036 | if (!f) { | ||
| 1318 | 1037 | wpa_printf(MSG_ERROR, "rxkh file '%s' not found.", fname); | ||
| 1319 | 1038 | return -1; | ||
| 1320 | 1039 | } | ||
| 1321 | 1040 | |||
| 1322 | 1041 | while (fgets(buf, sizeof(buf), f)) { | ||
| 1323 | 1042 | line++; | ||
| 1324 | 1043 | |||
| 1325 | 1044 | if (buf[0] == '#') | ||
| 1326 | 1045 | continue; | ||
| 1327 | 1046 | pos = buf; | ||
| 1328 | 1047 | while (*pos != '\0') { | ||
| 1329 | 1048 | if (*pos == '\n') { | ||
| 1330 | 1049 | *pos = '\0'; | ||
| 1331 | 1050 | break; | ||
| 1332 | 1051 | } | ||
| 1333 | 1052 | pos++; | ||
| 1334 | 1053 | } | ||
| 1335 | 1054 | if (buf[0] == '\0') | ||
| 1336 | 1055 | continue; | ||
| 1337 | 1056 | |||
| 1338 | 1057 | pos = os_strchr(buf, '='); | ||
| 1339 | 1058 | if (!pos) { | ||
| 1340 | 1059 | wpa_printf(MSG_ERROR, "Line %d: Invalid line '%s'", | ||
| 1341 | 1060 | line, buf); | ||
| 1342 | 1061 | errors++; | ||
| 1343 | 1062 | continue; | ||
| 1344 | 1063 | } | ||
| 1345 | 1064 | *pos = '\0'; | ||
| 1346 | 1065 | pos++; | ||
| 1347 | 1066 | |||
| 1348 | 1067 | if (os_strcmp(buf, "r0kh") == 0) { | ||
| 1349 | 1068 | if (add_r0kh(conf, pos) < 0) { | ||
| 1350 | 1069 | wpa_printf(MSG_ERROR, | ||
| 1351 | 1070 | "Line %d: Invalid r0kh '%s'", | ||
| 1352 | 1071 | line, pos); | ||
| 1353 | 1072 | errors++; | ||
| 1354 | 1073 | } | ||
| 1355 | 1074 | } else if (os_strcmp(buf, "r1kh") == 0) { | ||
| 1356 | 1075 | if (add_r1kh(conf, pos) < 0) { | ||
| 1357 | 1076 | wpa_printf(MSG_ERROR, | ||
| 1358 | 1077 | "Line %d: Invalid r1kh '%s'", | ||
| 1359 | 1078 | line, pos); | ||
| 1360 | 1079 | errors++; | ||
| 1361 | 1080 | } | ||
| 1362 | 1081 | } | ||
| 1363 | 1082 | } | ||
| 1364 | 1083 | |||
| 1365 | 1084 | fclose(f); | ||
| 1366 | 1085 | |||
| 1367 | 1086 | if (errors) { | ||
| 1368 | 1087 | wpa_printf(MSG_ERROR, | ||
| 1369 | 1088 | "%d errors in configuring RxKHs from '%s'", | ||
| 1370 | 1089 | errors, fname); | ||
| 1371 | 1090 | return -1; | ||
| 1372 | 1091 | } | ||
| 1373 | 1092 | return 0; | ||
| 1374 | 1093 | } | ||
| 1375 | 1094 | |||
| 1376 | 1061 | #endif /* CONFIG_IEEE80211R_AP */ | 1095 | #endif /* CONFIG_IEEE80211R_AP */ |
| 1377 | 1062 | 1096 | ||
| 1378 | 1063 | 1097 | ||
| 1379 | @@ -1644,6 +1678,8 @@ static int parse_anqp_elem(struct hostapd_bss_config *bss, char *buf, int line) | |||
| 1380 | 1644 | return 0; | 1678 | return 0; |
| 1381 | 1645 | } | 1679 | } |
| 1382 | 1646 | 1680 | ||
| 1383 | 1681 | #endif /* CONFIG_INTERWORKING */ | ||
| 1384 | 1682 | |||
| 1385 | 1647 | 1683 | ||
| 1386 | 1648 | static int parse_qos_map_set(struct hostapd_bss_config *bss, | 1684 | static int parse_qos_map_set(struct hostapd_bss_config *bss, |
| 1387 | 1649 | char *buf, int line) | 1685 | char *buf, int line) |
| 1388 | @@ -1685,8 +1721,6 @@ static int parse_qos_map_set(struct hostapd_bss_config *bss, | |||
| 1389 | 1685 | return 0; | 1721 | return 0; |
| 1390 | 1686 | } | 1722 | } |
| 1391 | 1687 | 1723 | ||
| 1392 | 1688 | #endif /* CONFIG_INTERWORKING */ | ||
| 1393 | 1689 | |||
| 1394 | 1690 | 1724 | ||
| 1395 | 1691 | #ifdef CONFIG_HS20 | 1725 | #ifdef CONFIG_HS20 |
| 1396 | 1692 | static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf, | 1726 | static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf, |
| 1397 | @@ -2197,6 +2231,7 @@ static int add_airtime_weight(struct hostapd_bss_config *bss, char *value) | |||
| 1398 | 2197 | 2231 | ||
| 1399 | 2198 | 2232 | ||
| 1400 | 2199 | #ifdef CONFIG_SAE | 2233 | #ifdef CONFIG_SAE |
| 1401 | 2234 | |||
| 1402 | 2200 | static int parse_sae_password(struct hostapd_bss_config *bss, const char *val) | 2235 | static int parse_sae_password(struct hostapd_bss_config *bss, const char *val) |
| 1403 | 2201 | { | 2236 | { |
| 1404 | 2202 | struct sae_password_entry *pw; | 2237 | struct sae_password_entry *pw; |
| 1405 | @@ -2300,6 +2335,40 @@ fail: | |||
| 1406 | 2300 | os_free(pw); | 2335 | os_free(pw); |
| 1407 | 2301 | return -1; | 2336 | return -1; |
| 1408 | 2302 | } | 2337 | } |
| 1409 | 2338 | |||
| 1410 | 2339 | |||
| 1411 | 2340 | static int parse_sae_password_file(struct hostapd_bss_config *bss, | ||
| 1412 | 2341 | const char *fname) | ||
| 1413 | 2342 | { | ||
| 1414 | 2343 | FILE *f; | ||
| 1415 | 2344 | char buf[500], *pos; | ||
| 1416 | 2345 | unsigned int line = 0; | ||
| 1417 | 2346 | |||
| 1418 | 2347 | f = fopen(fname, "r"); | ||
| 1419 | 2348 | if (!f) { | ||
| 1420 | 2349 | wpa_printf(MSG_ERROR, "sae_password_file '%s' not found.", | ||
| 1421 | 2350 | fname); | ||
| 1422 | 2351 | return -1; | ||
| 1423 | 2352 | } | ||
| 1424 | 2353 | |||
| 1425 | 2354 | while (fgets(buf, sizeof(buf), f)) { | ||
| 1426 | 2355 | pos = os_strchr(buf, '\n'); | ||
| 1427 | 2356 | if (pos) | ||
| 1428 | 2357 | *pos = '\0'; | ||
| 1429 | 2358 | line++; | ||
| 1430 | 2359 | if (parse_sae_password(bss, buf)) { | ||
| 1431 | 2360 | wpa_printf(MSG_ERROR, | ||
| 1432 | 2361 | "Invalid SAE password at line %d in '%s'", | ||
| 1433 | 2362 | line, fname); | ||
| 1434 | 2363 | fclose(f); | ||
| 1435 | 2364 | return -1; | ||
| 1436 | 2365 | } | ||
| 1437 | 2366 | } | ||
| 1438 | 2367 | |||
| 1439 | 2368 | fclose(f); | ||
| 1440 | 2369 | return 0; | ||
| 1441 | 2370 | } | ||
| 1442 | 2371 | |||
| 1443 | 2303 | #endif /* CONFIG_SAE */ | 2372 | #endif /* CONFIG_SAE */ |
| 1444 | 2304 | 2373 | ||
| 1445 | 2305 | 2374 | ||
| 1446 | @@ -2349,6 +2418,24 @@ static int get_hex_config(u8 *buf, size_t max_len, int line, | |||
| 1447 | 2349 | } | 2418 | } |
| 1448 | 2350 | 2419 | ||
| 1449 | 2351 | 2420 | ||
| 1450 | 2421 | #ifdef CONFIG_IEEE80211BE | ||
| 1451 | 2422 | static int get_u16(const char *pos, int line, u16 *ret_val) | ||
| 1452 | 2423 | { | ||
| 1453 | 2424 | char *end; | ||
| 1454 | 2425 | long int val = strtol(pos, &end, 0); | ||
| 1455 | 2426 | |||
| 1456 | 2427 | if (*end || val < 0 || val > 0xffff) { | ||
| 1457 | 2428 | wpa_printf(MSG_ERROR, "Line %d: Invalid value '%s'", | ||
| 1458 | 2429 | line, pos); | ||
| 1459 | 2430 | return -1; | ||
| 1460 | 2431 | } | ||
| 1461 | 2432 | |||
| 1462 | 2433 | *ret_val = val; | ||
| 1463 | 2434 | return 0; | ||
| 1464 | 2435 | } | ||
| 1465 | 2436 | #endif /* CONFIG_IEEE80211BE */ | ||
| 1466 | 2437 | |||
| 1467 | 2438 | |||
| 1468 | 2352 | static int hostapd_config_fill(struct hostapd_config *conf, | 2439 | static int hostapd_config_fill(struct hostapd_config *conf, |
| 1469 | 2353 | struct hostapd_bss_config *bss, | 2440 | struct hostapd_bss_config *bss, |
| 1470 | 2354 | const char *buf, char *pos, int line) | 2441 | const char *buf, char *pos, int line) |
| 1471 | @@ -2358,6 +2445,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1472 | 2358 | sizeof(conf->bss[0]->iface)); | 2445 | sizeof(conf->bss[0]->iface)); |
| 1473 | 2359 | } else if (os_strcmp(buf, "bridge") == 0) { | 2446 | } else if (os_strcmp(buf, "bridge") == 0) { |
| 1474 | 2360 | os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); | 2447 | os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); |
| 1475 | 2448 | } else if (os_strcmp(buf, "bridge_hairpin") == 0) { | ||
| 1476 | 2449 | bss->bridge_hairpin = atoi(pos); | ||
| 1477 | 2361 | } else if (os_strcmp(buf, "vlan_bridge") == 0) { | 2450 | } else if (os_strcmp(buf, "vlan_bridge") == 0) { |
| 1478 | 2362 | os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge)); | 2451 | os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge)); |
| 1479 | 2363 | } else if (os_strcmp(buf, "wds_bridge") == 0) { | 2452 | } else if (os_strcmp(buf, "wds_bridge") == 0) { |
| 1480 | @@ -2407,7 +2496,7 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1481 | 2407 | } | 2496 | } |
| 1482 | 2408 | os_memcpy(ssid->ssid, pos, ssid->ssid_len); | 2497 | os_memcpy(ssid->ssid, pos, ssid->ssid_len); |
| 1483 | 2409 | ssid->ssid_set = 1; | 2498 | ssid->ssid_set = 1; |
| 1485 | 2410 | ssid->short_ssid = crc32(ssid->ssid, ssid->ssid_len); | 2499 | ssid->short_ssid = ieee80211_crc32(ssid->ssid, ssid->ssid_len); |
| 1486 | 2411 | } else if (os_strcmp(buf, "ssid2") == 0) { | 2500 | } else if (os_strcmp(buf, "ssid2") == 0) { |
| 1487 | 2412 | struct hostapd_ssid *ssid = &bss->ssid; | 2501 | struct hostapd_ssid *ssid = &bss->ssid; |
| 1488 | 2413 | size_t slen; | 2502 | size_t slen; |
| 1489 | @@ -2421,7 +2510,7 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1490 | 2421 | os_memcpy(ssid->ssid, str, slen); | 2510 | os_memcpy(ssid->ssid, str, slen); |
| 1491 | 2422 | ssid->ssid_len = slen; | 2511 | ssid->ssid_len = slen; |
| 1492 | 2423 | ssid->ssid_set = 1; | 2512 | ssid->ssid_set = 1; |
| 1494 | 2424 | ssid->short_ssid = crc32(ssid->ssid, ssid->ssid_len); | 2513 | ssid->short_ssid = ieee80211_crc32(ssid->ssid, ssid->ssid_len); |
| 1495 | 2425 | os_free(str); | 2514 | os_free(str); |
| 1496 | 2426 | } else if (os_strcmp(buf, "utf8_ssid") == 0) { | 2515 | } else if (os_strcmp(buf, "utf8_ssid") == 0) { |
| 1497 | 2427 | bss->ssid.utf8_ssid = atoi(pos) > 0; | 2516 | bss->ssid.utf8_ssid = atoi(pos) > 0; |
| 1498 | @@ -2460,6 +2549,30 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1499 | 2460 | bss->ap_max_inactivity = atoi(pos); | 2549 | bss->ap_max_inactivity = atoi(pos); |
| 1500 | 2461 | } else if (os_strcmp(buf, "skip_inactivity_poll") == 0) { | 2550 | } else if (os_strcmp(buf, "skip_inactivity_poll") == 0) { |
| 1501 | 2462 | bss->skip_inactivity_poll = atoi(pos); | 2551 | bss->skip_inactivity_poll = atoi(pos); |
| 1502 | 2552 | } else if (os_strcmp(buf, "bss_max_idle") == 0) { | ||
| 1503 | 2553 | int val = atoi(pos); | ||
| 1504 | 2554 | |||
| 1505 | 2555 | if (val < 0 || val > 2) { | ||
| 1506 | 2556 | wpa_printf(MSG_ERROR, | ||
| 1507 | 2557 | "Line %d: Invalid bss_max_idle value", line); | ||
| 1508 | 2558 | return 1; | ||
| 1509 | 2559 | } | ||
| 1510 | 2560 | bss->bss_max_idle = val; | ||
| 1511 | 2561 | } else if (os_strcmp(buf, "max_acceptable_idle_period") == 0) { | ||
| 1512 | 2562 | bss->max_acceptable_idle_period = atoi(pos); | ||
| 1513 | 2563 | } else if (os_strcmp(buf, "no_disconnect_on_group_keyerror") == 0) { | ||
| 1514 | 2564 | int val = atoi(pos); | ||
| 1515 | 2565 | |||
| 1516 | 2566 | if (val < 0 || val > 1) { | ||
| 1517 | 2567 | wpa_printf(MSG_ERROR, | ||
| 1518 | 2568 | "Line %d: Invalid no_disconnect_on_group_keyerror", | ||
| 1519 | 2569 | line); | ||
| 1520 | 2570 | return 1; | ||
| 1521 | 2571 | } | ||
| 1522 | 2572 | bss->no_disconnect_on_group_keyerror = val; | ||
| 1523 | 2573 | } else if (os_strcmp(buf, "config_id") == 0) { | ||
| 1524 | 2574 | os_free(bss->config_id); | ||
| 1525 | 2575 | bss->config_id = os_strdup(pos); | ||
| 1526 | 2463 | } else if (os_strcmp(buf, "country_code") == 0) { | 2576 | } else if (os_strcmp(buf, "country_code") == 0) { |
| 1527 | 2464 | if (pos[0] < 'A' || pos[0] > 'Z' || | 2577 | if (pos[0] < 'A' || pos[0] > 'Z' || |
| 1528 | 2465 | pos[1] < 'A' || pos[1] > 'Z') { | 2578 | pos[1] < 'A' || pos[1] > 'Z') { |
| 1529 | @@ -2624,6 +2737,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1530 | 2624 | bss->eap_teap_separate_result = atoi(pos); | 2737 | bss->eap_teap_separate_result = atoi(pos); |
| 1531 | 2625 | } else if (os_strcmp(buf, "eap_teap_id") == 0) { | 2738 | } else if (os_strcmp(buf, "eap_teap_id") == 0) { |
| 1532 | 2626 | bss->eap_teap_id = atoi(pos); | 2739 | bss->eap_teap_id = atoi(pos); |
| 1533 | 2740 | } else if (os_strcmp(buf, "eap_teap_method_sequence") == 0) { | ||
| 1534 | 2741 | bss->eap_teap_method_sequence = atoi(pos); | ||
| 1535 | 2627 | #endif /* EAP_SERVER_TEAP */ | 2742 | #endif /* EAP_SERVER_TEAP */ |
| 1536 | 2628 | #ifdef EAP_SERVER_SIM | 2743 | #ifdef EAP_SERVER_SIM |
| 1537 | 2629 | } else if (os_strcmp(buf, "eap_sim_db") == 0) { | 2744 | } else if (os_strcmp(buf, "eap_sim_db") == 0) { |
| 1538 | @@ -2635,6 +2750,11 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1539 | 2635 | bss->eap_sim_aka_result_ind = atoi(pos); | 2750 | bss->eap_sim_aka_result_ind = atoi(pos); |
| 1540 | 2636 | } else if (os_strcmp(buf, "eap_sim_id") == 0) { | 2751 | } else if (os_strcmp(buf, "eap_sim_id") == 0) { |
| 1541 | 2637 | bss->eap_sim_id = atoi(pos); | 2752 | bss->eap_sim_id = atoi(pos); |
| 1542 | 2753 | } else if (os_strcmp(buf, "imsi_privacy_key") == 0) { | ||
| 1543 | 2754 | os_free(bss->imsi_privacy_key); | ||
| 1544 | 2755 | bss->imsi_privacy_key = os_strdup(pos); | ||
| 1545 | 2756 | } else if (os_strcmp(buf, "eap_sim_aka_fast_reauth_limit") == 0) { | ||
| 1546 | 2757 | bss->eap_sim_aka_fast_reauth_limit = atoi(pos); | ||
| 1547 | 2638 | #endif /* EAP_SERVER_SIM */ | 2758 | #endif /* EAP_SERVER_SIM */ |
| 1548 | 2639 | #ifdef EAP_SERVER_TNC | 2759 | #ifdef EAP_SERVER_TNC |
| 1549 | 2640 | } else if (os_strcmp(buf, "tnc") == 0) { | 2760 | } else if (os_strcmp(buf, "tnc") == 0) { |
| 1550 | @@ -2770,6 +2890,37 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1551 | 2770 | os_free(bss->radius->auth_server->shared_secret); | 2890 | os_free(bss->radius->auth_server->shared_secret); |
| 1552 | 2771 | bss->radius->auth_server->shared_secret = (u8 *) os_strdup(pos); | 2891 | bss->radius->auth_server->shared_secret = (u8 *) os_strdup(pos); |
| 1553 | 2772 | bss->radius->auth_server->shared_secret_len = len; | 2892 | bss->radius->auth_server->shared_secret_len = len; |
| 1554 | 2893 | } else if (bss->radius->auth_server && | ||
| 1555 | 2894 | os_strcmp(buf, "auth_server_type") == 0) { | ||
| 1556 | 2895 | if (os_strcmp(pos, "UDP") == 0) { | ||
| 1557 | 2896 | bss->radius->auth_server->tls = false; | ||
| 1558 | 2897 | #ifdef CONFIG_RADIUS_TLS | ||
| 1559 | 2898 | } else if (os_strcmp(pos, "TLS") == 0) { | ||
| 1560 | 2899 | bss->radius->auth_server->tls = true; | ||
| 1561 | 2900 | #endif /* CONFIG_RADIUS_TLS */ | ||
| 1562 | 2901 | } else { | ||
| 1563 | 2902 | wpa_printf(MSG_ERROR, "Line %d: unsupported RADIUS type '%s'", | ||
| 1564 | 2903 | line, pos); | ||
| 1565 | 2904 | return 1; | ||
| 1566 | 2905 | } | ||
| 1567 | 2906 | #ifdef CONFIG_RADIUS_TLS | ||
| 1568 | 2907 | } else if (bss->radius->auth_server && | ||
| 1569 | 2908 | os_strcmp(buf, "auth_server_ca_cert") == 0) { | ||
| 1570 | 2909 | os_free(bss->radius->auth_server->ca_cert); | ||
| 1571 | 2910 | bss->radius->auth_server->ca_cert = os_strdup(pos); | ||
| 1572 | 2911 | } else if (bss->radius->auth_server && | ||
| 1573 | 2912 | os_strcmp(buf, "auth_server_client_cert") == 0) { | ||
| 1574 | 2913 | os_free(bss->radius->auth_server->client_cert); | ||
| 1575 | 2914 | bss->radius->auth_server->client_cert = os_strdup(pos); | ||
| 1576 | 2915 | } else if (bss->radius->auth_server && | ||
| 1577 | 2916 | os_strcmp(buf, "auth_server_private_key") == 0) { | ||
| 1578 | 2917 | os_free(bss->radius->auth_server->private_key); | ||
| 1579 | 2918 | bss->radius->auth_server->private_key = os_strdup(pos); | ||
| 1580 | 2919 | } else if (bss->radius->auth_server && | ||
| 1581 | 2920 | os_strcmp(buf, "auth_server_private_key_passwd") == 0) { | ||
| 1582 | 2921 | os_free(bss->radius->auth_server->private_key_passwd); | ||
| 1583 | 2922 | bss->radius->auth_server->private_key_passwd = os_strdup(pos); | ||
| 1584 | 2923 | #endif /* CONFIG_RADIUS_TLS */ | ||
| 1585 | 2773 | } else if (os_strcmp(buf, "acct_server_addr") == 0) { | 2924 | } else if (os_strcmp(buf, "acct_server_addr") == 0) { |
| 1586 | 2774 | if (hostapd_config_read_radius_addr( | 2925 | if (hostapd_config_read_radius_addr( |
| 1587 | 2775 | &bss->radius->acct_servers, | 2926 | &bss->radius->acct_servers, |
| 1588 | @@ -2804,8 +2955,42 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1589 | 2804 | os_free(bss->radius->acct_server->shared_secret); | 2955 | os_free(bss->radius->acct_server->shared_secret); |
| 1590 | 2805 | bss->radius->acct_server->shared_secret = (u8 *) os_strdup(pos); | 2956 | bss->radius->acct_server->shared_secret = (u8 *) os_strdup(pos); |
| 1591 | 2806 | bss->radius->acct_server->shared_secret_len = len; | 2957 | bss->radius->acct_server->shared_secret_len = len; |
| 1592 | 2958 | } else if (bss->radius->acct_server && | ||
| 1593 | 2959 | os_strcmp(buf, "acct_server_type") == 0) { | ||
| 1594 | 2960 | if (os_strcmp(pos, "UDP") == 0) { | ||
| 1595 | 2961 | bss->radius->acct_server->tls = false; | ||
| 1596 | 2962 | #ifdef CONFIG_RADIUS_TLS | ||
| 1597 | 2963 | } else if (os_strcmp(pos, "TLS") == 0) { | ||
| 1598 | 2964 | bss->radius->acct_server->tls = true; | ||
| 1599 | 2965 | #endif /* CONFIG_RADIUS_TLS */ | ||
| 1600 | 2966 | } else { | ||
| 1601 | 2967 | wpa_printf(MSG_ERROR, "Line %d: unsupported RADIUS type '%s'", | ||
| 1602 | 2968 | line, pos); | ||
| 1603 | 2969 | return 1; | ||
| 1604 | 2970 | } | ||
| 1605 | 2971 | #ifdef CONFIG_RADIUS_TLS | ||
| 1606 | 2972 | } else if (bss->radius->acct_server && | ||
| 1607 | 2973 | os_strcmp(buf, "acct_server_ca_cert") == 0) { | ||
| 1608 | 2974 | os_free(bss->radius->acct_server->ca_cert); | ||
| 1609 | 2975 | bss->radius->acct_server->ca_cert = os_strdup(pos); | ||
| 1610 | 2976 | } else if (bss->radius->acct_server && | ||
| 1611 | 2977 | os_strcmp(buf, "acct_server_client_cert") == 0) { | ||
| 1612 | 2978 | os_free(bss->radius->acct_server->client_cert); | ||
| 1613 | 2979 | bss->radius->acct_server->client_cert = os_strdup(pos); | ||
| 1614 | 2980 | } else if (bss->radius->acct_server && | ||
| 1615 | 2981 | os_strcmp(buf, "acct_server_private_key") == 0) { | ||
| 1616 | 2982 | os_free(bss->radius->acct_server->private_key); | ||
| 1617 | 2983 | bss->radius->acct_server->private_key = os_strdup(pos); | ||
| 1618 | 2984 | } else if (bss->radius->acct_server && | ||
| 1619 | 2985 | os_strcmp(buf, "acct_server_private_key_passwd") == 0) { | ||
| 1620 | 2986 | os_free(bss->radius->acct_server->private_key_passwd); | ||
| 1621 | 2987 | bss->radius->acct_server->private_key_passwd = os_strdup(pos); | ||
| 1622 | 2988 | #endif /* CONFIG_RADIUS_TLS */ | ||
| 1623 | 2807 | } else if (os_strcmp(buf, "radius_retry_primary_interval") == 0) { | 2989 | } else if (os_strcmp(buf, "radius_retry_primary_interval") == 0) { |
| 1624 | 2808 | bss->radius->retry_primary_interval = atoi(pos); | 2990 | bss->radius->retry_primary_interval = atoi(pos); |
| 1625 | 2991 | } else if (os_strcmp(buf, | ||
| 1626 | 2992 | "radius_require_message_authenticator") == 0) { | ||
| 1627 | 2993 | bss->radius_require_message_authenticator = atoi(pos); | ||
| 1628 | 2809 | } else if (os_strcmp(buf, "radius_acct_interim_interval") == 0) { | 2994 | } else if (os_strcmp(buf, "radius_acct_interim_interval") == 0) { |
| 1629 | 2810 | bss->acct_interim_interval = atoi(pos); | 2995 | bss->acct_interim_interval = atoi(pos); |
| 1630 | 2811 | } else if (os_strcmp(buf, "radius_request_cui") == 0) { | 2996 | } else if (os_strcmp(buf, "radius_request_cui") == 0) { |
| 1631 | @@ -2975,7 +3160,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1632 | 2975 | bss->wpa_psk_radius = atoi(pos); | 3160 | bss->wpa_psk_radius = atoi(pos); |
| 1633 | 2976 | if (bss->wpa_psk_radius != PSK_RADIUS_IGNORED && | 3161 | if (bss->wpa_psk_radius != PSK_RADIUS_IGNORED && |
| 1634 | 2977 | bss->wpa_psk_radius != PSK_RADIUS_ACCEPTED && | 3162 | bss->wpa_psk_radius != PSK_RADIUS_ACCEPTED && |
| 1636 | 2978 | bss->wpa_psk_radius != PSK_RADIUS_REQUIRED) { | 3163 | bss->wpa_psk_radius != PSK_RADIUS_REQUIRED && |
| 1637 | 3164 | bss->wpa_psk_radius != PSK_RADIUS_DURING_4WAY_HS) { | ||
| 1638 | 2979 | wpa_printf(MSG_ERROR, | 3165 | wpa_printf(MSG_ERROR, |
| 1639 | 2980 | "Line %d: unknown wpa_psk_radius %d", | 3166 | "Line %d: unknown wpa_psk_radius %d", |
| 1640 | 2981 | line, bss->wpa_psk_radius); | 3167 | line, bss->wpa_psk_radius); |
| 1641 | @@ -3072,6 +3258,21 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1642 | 3072 | line, pos); | 3258 | line, pos); |
| 1643 | 3073 | return 1; | 3259 | return 1; |
| 1644 | 3074 | } | 3260 | } |
| 1645 | 3261 | } else if (os_strcmp(buf, "rxkh_file") == 0) { | ||
| 1646 | 3262 | os_free(bss->rxkh_file); | ||
| 1647 | 3263 | bss->rxkh_file = os_strdup(pos); | ||
| 1648 | 3264 | if (!bss->rxkh_file) { | ||
| 1649 | 3265 | wpa_printf(MSG_ERROR, "Line %d: allocation failed", | ||
| 1650 | 3266 | line); | ||
| 1651 | 3267 | return 1; | ||
| 1652 | 3268 | } | ||
| 1653 | 3269 | if (hostapd_config_read_rxkh_file(bss, pos)) { | ||
| 1654 | 3270 | wpa_printf(MSG_DEBUG, | ||
| 1655 | 3271 | "Line %d: failed to read rxkh_file '%s'", | ||
| 1656 | 3272 | line, pos); | ||
| 1657 | 3273 | /* Allow the file to be created later and read into | ||
| 1658 | 3274 | * already operating AP context. */ | ||
| 1659 | 3275 | } | ||
| 1660 | 3075 | } else if (os_strcmp(buf, "pmk_r1_push") == 0) { | 3276 | } else if (os_strcmp(buf, "pmk_r1_push") == 0) { |
| 1661 | 3076 | bss->pmk_r1_push = atoi(pos); | 3277 | bss->pmk_r1_push = atoi(pos); |
| 1662 | 3077 | } else if (os_strcmp(buf, "ft_over_ds") == 0) { | 3278 | } else if (os_strcmp(buf, "ft_over_ds") == 0) { |
| 1663 | @@ -3139,6 +3340,7 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1664 | 3139 | line, pos); | 3340 | line, pos); |
| 1665 | 3140 | return 1; | 3341 | return 1; |
| 1666 | 3141 | } | 3342 | } |
| 1667 | 3343 | conf->hw_mode_set = true; | ||
| 1668 | 3142 | } else if (os_strcmp(buf, "wps_rf_bands") == 0) { | 3344 | } else if (os_strcmp(buf, "wps_rf_bands") == 0) { |
| 1669 | 3143 | if (os_strcmp(pos, "ad") == 0) | 3345 | if (os_strcmp(pos, "ad") == 0) |
| 1670 | 3144 | bss->wps_rf_bands = WPS_RF_60GHZ; | 3346 | bss->wps_rf_bands = WPS_RF_60GHZ; |
| 1671 | @@ -3193,6 +3395,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1672 | 3193 | conf->acs_freq_list_present = 1; | 3395 | conf->acs_freq_list_present = 1; |
| 1673 | 3194 | } else if (os_strcmp(buf, "acs_exclude_6ghz_non_psc") == 0) { | 3396 | } else if (os_strcmp(buf, "acs_exclude_6ghz_non_psc") == 0) { |
| 1674 | 3195 | conf->acs_exclude_6ghz_non_psc = atoi(pos); | 3397 | conf->acs_exclude_6ghz_non_psc = atoi(pos); |
| 1675 | 3398 | } else if (os_strcmp(buf, "enable_background_radar") == 0) { | ||
| 1676 | 3399 | conf->enable_background_radar = atoi(pos); | ||
| 1677 | 3196 | } else if (os_strcmp(buf, "min_tx_power") == 0) { | 3400 | } else if (os_strcmp(buf, "min_tx_power") == 0) { |
| 1678 | 3197 | int val = atoi(pos); | 3401 | int val = atoi(pos); |
| 1679 | 3198 | 3402 | ||
| 1680 | @@ -3484,6 +3688,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1681 | 3484 | } | 3688 | } |
| 1682 | 3485 | } else if (os_strcmp(buf, "require_ht") == 0) { | 3689 | } else if (os_strcmp(buf, "require_ht") == 0) { |
| 1683 | 3486 | conf->require_ht = atoi(pos); | 3690 | conf->require_ht = atoi(pos); |
| 1684 | 3691 | } else if (os_strcmp(buf, "ht_vht_twt_responder") == 0) { | ||
| 1685 | 3692 | conf->ht_vht_twt_responder = atoi(pos); | ||
| 1686 | 3487 | } else if (os_strcmp(buf, "obss_interval") == 0) { | 3693 | } else if (os_strcmp(buf, "obss_interval") == 0) { |
| 1687 | 3488 | conf->obss_interval = atoi(pos); | 3694 | conf->obss_interval = atoi(pos); |
| 1688 | 3489 | #ifdef CONFIG_IEEE80211AC | 3695 | #ifdef CONFIG_IEEE80211AC |
| 1689 | @@ -3511,6 +3717,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1690 | 3511 | #ifdef CONFIG_IEEE80211AX | 3717 | #ifdef CONFIG_IEEE80211AX |
| 1691 | 3512 | } else if (os_strcmp(buf, "ieee80211ax") == 0) { | 3718 | } else if (os_strcmp(buf, "ieee80211ax") == 0) { |
| 1692 | 3513 | conf->ieee80211ax = atoi(pos); | 3719 | conf->ieee80211ax = atoi(pos); |
| 1693 | 3720 | } else if (os_strcmp(buf, "require_he") == 0) { | ||
| 1694 | 3721 | conf->require_he = atoi(pos); | ||
| 1695 | 3514 | } else if (os_strcmp(buf, "he_su_beamformer") == 0) { | 3722 | } else if (os_strcmp(buf, "he_su_beamformer") == 0) { |
| 1696 | 3515 | conf->he_phy_capab.he_su_beamformer = atoi(pos); | 3723 | conf->he_phy_capab.he_su_beamformer = atoi(pos); |
| 1697 | 3516 | } else if (os_strcmp(buf, "he_su_beamformee") == 0) { | 3724 | } else if (os_strcmp(buf, "he_su_beamformee") == 0) { |
| 1698 | @@ -3642,6 +3850,20 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1699 | 3642 | line, pos); | 3850 | line, pos); |
| 1700 | 3643 | return 1; | 3851 | return 1; |
| 1701 | 3644 | } | 3852 | } |
| 1702 | 3853 | } else if (os_strcmp(buf, "he_6ghz_reg_pwr_type") == 0) { | ||
| 1703 | 3854 | conf->he_6ghz_reg_pwr_type = atoi(pos); | ||
| 1704 | 3855 | if (conf->he_6ghz_reg_pwr_type > HE_REG_INFO_6GHZ_AP_TYPE_MAX) { | ||
| 1705 | 3856 | wpa_printf(MSG_ERROR, | ||
| 1706 | 3857 | "Line %d: invalid he_6ghz_reg_pwr_type value", | ||
| 1707 | 3858 | line); | ||
| 1708 | 3859 | return 1; | ||
| 1709 | 3860 | } | ||
| 1710 | 3861 | } else if (os_strcmp(buf, "reg_def_cli_eirp_psd") == 0) { | ||
| 1711 | 3862 | conf->reg_def_cli_eirp_psd = atoi(pos); | ||
| 1712 | 3863 | } else if (os_strcmp(buf, "reg_sub_cli_eirp_psd") == 0) { | ||
| 1713 | 3864 | conf->reg_sub_cli_eirp_psd = atoi(pos); | ||
| 1714 | 3865 | } else if (os_strcmp(buf, "reg_def_cli_eirp") == 0) { | ||
| 1715 | 3866 | conf->reg_def_cli_eirp = atoi(pos); | ||
| 1716 | 3645 | } else if (os_strcmp(buf, "he_oper_chwidth") == 0) { | 3867 | } else if (os_strcmp(buf, "he_oper_chwidth") == 0) { |
| 1717 | 3646 | conf->he_oper_chwidth = atoi(pos); | 3868 | conf->he_oper_chwidth = atoi(pos); |
| 1718 | 3647 | } else if (os_strcmp(buf, "he_oper_centr_freq_seg0_idx") == 0) { | 3869 | } else if (os_strcmp(buf, "he_oper_centr_freq_seg0_idx") == 0) { |
| 1719 | @@ -3666,6 +3888,15 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1720 | 3666 | return 1; | 3888 | return 1; |
| 1721 | 3667 | } | 3889 | } |
| 1722 | 3668 | bss->unsol_bcast_probe_resp_interval = val; | 3890 | bss->unsol_bcast_probe_resp_interval = val; |
| 1723 | 3891 | } else if (os_strcmp(buf, "mbssid") == 0) { | ||
| 1724 | 3892 | int mbssid = atoi(pos); | ||
| 1725 | 3893 | if (mbssid < 0 || mbssid > ENHANCED_MBSSID_ENABLED) { | ||
| 1726 | 3894 | wpa_printf(MSG_ERROR, | ||
| 1727 | 3895 | "Line %d: invalid mbssid (%d): '%s'.", | ||
| 1728 | 3896 | line, mbssid, pos); | ||
| 1729 | 3897 | return 1; | ||
| 1730 | 3898 | } | ||
| 1731 | 3899 | conf->mbssid = mbssid; | ||
| 1732 | 3669 | #endif /* CONFIG_IEEE80211AX */ | 3900 | #endif /* CONFIG_IEEE80211AX */ |
| 1733 | 3670 | } else if (os_strcmp(buf, "max_listen_interval") == 0) { | 3901 | } else if (os_strcmp(buf, "max_listen_interval") == 0) { |
| 1734 | 3671 | bss->max_listen_interval = atoi(pos); | 3902 | bss->max_listen_interval = atoi(pos); |
| 1735 | @@ -4053,10 +4284,10 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1736 | 4053 | bss->gas_frag_limit = val; | 4284 | bss->gas_frag_limit = val; |
| 1737 | 4054 | } else if (os_strcmp(buf, "gas_comeback_delay") == 0) { | 4285 | } else if (os_strcmp(buf, "gas_comeback_delay") == 0) { |
| 1738 | 4055 | bss->gas_comeback_delay = atoi(pos); | 4286 | bss->gas_comeback_delay = atoi(pos); |
| 1739 | 4287 | #endif /* CONFIG_INTERWORKING */ | ||
| 1740 | 4056 | } else if (os_strcmp(buf, "qos_map_set") == 0) { | 4288 | } else if (os_strcmp(buf, "qos_map_set") == 0) { |
| 1741 | 4057 | if (parse_qos_map_set(bss, pos, line) < 0) | 4289 | if (parse_qos_map_set(bss, pos, line) < 0) |
| 1742 | 4058 | return 1; | 4290 | return 1; |
| 1743 | 4059 | #endif /* CONFIG_INTERWORKING */ | ||
| 1744 | 4060 | #ifdef CONFIG_RADIUS_TEST | 4291 | #ifdef CONFIG_RADIUS_TEST |
| 1745 | 4061 | } else if (os_strcmp(buf, "dump_msk_file") == 0) { | 4292 | } else if (os_strcmp(buf, "dump_msk_file") == 0) { |
| 1746 | 4062 | os_free(bss->dump_msk_file); | 4293 | os_free(bss->dump_msk_file); |
| 1747 | @@ -4297,6 +4528,23 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1748 | 4297 | bss->oci_freq_override_fils_assoc = atoi(pos); | 4528 | bss->oci_freq_override_fils_assoc = atoi(pos); |
| 1749 | 4298 | } else if (os_strcmp(buf, "oci_freq_override_wnm_sleep") == 0) { | 4529 | } else if (os_strcmp(buf, "oci_freq_override_wnm_sleep") == 0) { |
| 1750 | 4299 | bss->oci_freq_override_wnm_sleep = atoi(pos); | 4530 | bss->oci_freq_override_wnm_sleep = atoi(pos); |
| 1751 | 4531 | } else if (os_strcmp(buf, "eap_skip_prot_success") == 0) { | ||
| 1752 | 4532 | bss->eap_skip_prot_success = atoi(pos); | ||
| 1753 | 4533 | } else if (os_strcmp(buf, "delay_eapol_tx") == 0) { | ||
| 1754 | 4534 | conf->delay_eapol_tx = atoi(pos); | ||
| 1755 | 4535 | } else if (os_strcmp(buf, "eapol_m1_elements") == 0) { | ||
| 1756 | 4536 | if (parse_wpabuf_hex(line, buf, &bss->eapol_m1_elements, pos)) | ||
| 1757 | 4537 | return 1; | ||
| 1758 | 4538 | } else if (os_strcmp(buf, "eapol_m3_elements") == 0) { | ||
| 1759 | 4539 | if (parse_wpabuf_hex(line, buf, &bss->eapol_m3_elements, pos)) | ||
| 1760 | 4540 | return 1; | ||
| 1761 | 4541 | } else if (os_strcmp(buf, "eapol_m3_no_encrypt") == 0) { | ||
| 1762 | 4542 | bss->eapol_m3_no_encrypt = atoi(pos); | ||
| 1763 | 4543 | } else if (os_strcmp(buf, "test_assoc_comeback_type") == 0) { | ||
| 1764 | 4544 | bss->test_assoc_comeback_type = atoi(pos); | ||
| 1765 | 4545 | } else if (os_strcmp(buf, "presp_elements") == 0) { | ||
| 1766 | 4546 | if (parse_wpabuf_hex(line, buf, &bss->presp_elements, pos)) | ||
| 1767 | 4547 | return 1; | ||
| 1768 | 4300 | #endif /* CONFIG_TESTING_OPTIONS */ | 4548 | #endif /* CONFIG_TESTING_OPTIONS */ |
| 1769 | 4301 | #ifdef CONFIG_SAE | 4549 | #ifdef CONFIG_SAE |
| 1770 | 4302 | } else if (os_strcmp(buf, "sae_password") == 0) { | 4550 | } else if (os_strcmp(buf, "sae_password") == 0) { |
| 1771 | @@ -4305,6 +4553,13 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1772 | 4305 | line); | 4553 | line); |
| 1773 | 4306 | return 1; | 4554 | return 1; |
| 1774 | 4307 | } | 4555 | } |
| 1775 | 4556 | } else if (os_strcmp(buf, "sae_password_file") == 0) { | ||
| 1776 | 4557 | if (parse_sae_password_file(bss, pos) < 0) { | ||
| 1777 | 4558 | wpa_printf(MSG_ERROR, | ||
| 1778 | 4559 | "Line %d: Invalid sae_password in file", | ||
| 1779 | 4560 | line); | ||
| 1780 | 4561 | return 1; | ||
| 1781 | 4562 | } | ||
| 1782 | 4308 | #endif /* CONFIG_SAE */ | 4563 | #endif /* CONFIG_SAE */ |
| 1783 | 4309 | } else if (os_strcmp(buf, "vendor_elements") == 0) { | 4564 | } else if (os_strcmp(buf, "vendor_elements") == 0) { |
| 1784 | 4310 | if (parse_wpabuf_hex(line, buf, &bss->vendor_elements, pos)) | 4565 | if (parse_wpabuf_hex(line, buf, &bss->vendor_elements, pos)) |
| 1785 | @@ -4436,6 +4691,10 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1786 | 4436 | WLAN_RRM_CAPS_BEACON_REPORT_PASSIVE | | 4691 | WLAN_RRM_CAPS_BEACON_REPORT_PASSIVE | |
| 1787 | 4437 | WLAN_RRM_CAPS_BEACON_REPORT_ACTIVE | | 4692 | WLAN_RRM_CAPS_BEACON_REPORT_ACTIVE | |
| 1788 | 4438 | WLAN_RRM_CAPS_BEACON_REPORT_TABLE; | 4693 | WLAN_RRM_CAPS_BEACON_REPORT_TABLE; |
| 1789 | 4694 | } else if (os_strcmp(buf, "rrm_link_measurement_report") == 0) { | ||
| 1790 | 4695 | if (atoi(pos)) | ||
| 1791 | 4696 | bss->radio_measurements[0] |= | ||
| 1792 | 4697 | WLAN_RRM_CAPS_LINK_MEASUREMENT; | ||
| 1793 | 4439 | } else if (os_strcmp(buf, "gas_address3") == 0) { | 4698 | } else if (os_strcmp(buf, "gas_address3") == 0) { |
| 1794 | 4440 | bss->gas_address3 = atoi(pos); | 4699 | bss->gas_address3 = atoi(pos); |
| 1795 | 4441 | } else if (os_strcmp(buf, "stationary_ap") == 0) { | 4700 | } else if (os_strcmp(buf, "stationary_ap") == 0) { |
| 1796 | @@ -4480,6 +4739,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1797 | 4480 | #endif /* CONFIG_FILS */ | 4739 | #endif /* CONFIG_FILS */ |
| 1798 | 4481 | } else if (os_strcmp(buf, "multicast_to_unicast") == 0) { | 4740 | } else if (os_strcmp(buf, "multicast_to_unicast") == 0) { |
| 1799 | 4482 | bss->multicast_to_unicast = atoi(pos); | 4741 | bss->multicast_to_unicast = atoi(pos); |
| 1800 | 4742 | } else if (os_strcmp(buf, "bridge_multicast_to_unicast") == 0) { | ||
| 1801 | 4743 | bss->bridge_multicast_to_unicast = atoi(pos); | ||
| 1802 | 4483 | } else if (os_strcmp(buf, "broadcast_deauth") == 0) { | 4744 | } else if (os_strcmp(buf, "broadcast_deauth") == 0) { |
| 1803 | 4484 | bss->broadcast_deauth = atoi(pos); | 4745 | bss->broadcast_deauth = atoi(pos); |
| 1804 | 4485 | } else if (os_strcmp(buf, "notify_mgmt_frames") == 0) { | 4746 | } else if (os_strcmp(buf, "notify_mgmt_frames") == 0) { |
| 1805 | @@ -4491,6 +4752,12 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1806 | 4491 | } else if (os_strcmp(buf, "dpp_mud_url") == 0) { | 4752 | } else if (os_strcmp(buf, "dpp_mud_url") == 0) { |
| 1807 | 4492 | os_free(bss->dpp_mud_url); | 4753 | os_free(bss->dpp_mud_url); |
| 1808 | 4493 | bss->dpp_mud_url = os_strdup(pos); | 4754 | bss->dpp_mud_url = os_strdup(pos); |
| 1809 | 4755 | } else if (os_strcmp(buf, "dpp_extra_conf_req_name") == 0) { | ||
| 1810 | 4756 | os_free(bss->dpp_extra_conf_req_name); | ||
| 1811 | 4757 | bss->dpp_extra_conf_req_name = os_strdup(pos); | ||
| 1812 | 4758 | } else if (os_strcmp(buf, "dpp_extra_conf_req_value") == 0) { | ||
| 1813 | 4759 | os_free(bss->dpp_extra_conf_req_value); | ||
| 1814 | 4760 | bss->dpp_extra_conf_req_value = os_strdup(pos); | ||
| 1815 | 4494 | } else if (os_strcmp(buf, "dpp_connector") == 0) { | 4761 | } else if (os_strcmp(buf, "dpp_connector") == 0) { |
| 1816 | 4495 | os_free(bss->dpp_connector); | 4762 | os_free(bss->dpp_connector); |
| 1817 | 4496 | bss->dpp_connector = os_strdup(pos); | 4763 | bss->dpp_connector = os_strdup(pos); |
| 1818 | @@ -4506,6 +4773,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1819 | 4506 | } else if (os_strcmp(buf, "dpp_controller") == 0) { | 4773 | } else if (os_strcmp(buf, "dpp_controller") == 0) { |
| 1820 | 4507 | if (hostapd_dpp_controller_parse(bss, pos)) | 4774 | if (hostapd_dpp_controller_parse(bss, pos)) |
| 1821 | 4508 | return 1; | 4775 | return 1; |
| 1822 | 4776 | } else if (os_strcmp(buf, "dpp_relay_port") == 0) { | ||
| 1823 | 4777 | bss->dpp_relay_port = atoi(pos); | ||
| 1824 | 4509 | } else if (os_strcmp(buf, "dpp_configurator_connectivity") == 0) { | 4778 | } else if (os_strcmp(buf, "dpp_configurator_connectivity") == 0) { |
| 1825 | 4510 | bss->dpp_configurator_connectivity = atoi(pos); | 4779 | bss->dpp_configurator_connectivity = atoi(pos); |
| 1826 | 4511 | } else if (os_strcmp(buf, "dpp_pfs") == 0) { | 4780 | } else if (os_strcmp(buf, "dpp_pfs") == 0) { |
| 1827 | @@ -4566,6 +4835,36 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1828 | 4566 | } | 4835 | } |
| 1829 | 4567 | 4836 | ||
| 1830 | 4568 | bss->multi_ap = val; | 4837 | bss->multi_ap = val; |
| 1831 | 4838 | } else if (os_strcmp(buf, "multi_ap_profile") == 0) { | ||
| 1832 | 4839 | int val = atoi(pos); | ||
| 1833 | 4840 | |||
| 1834 | 4841 | if (val < MULTI_AP_PROFILE_1 || val > MULTI_AP_PROFILE_MAX) { | ||
| 1835 | 4842 | wpa_printf(MSG_ERROR, | ||
| 1836 | 4843 | "Line %d: Invalid multi_ap_profile '%s'", | ||
| 1837 | 4844 | line, buf); | ||
| 1838 | 4845 | return -1; | ||
| 1839 | 4846 | } | ||
| 1840 | 4847 | bss->multi_ap_profile = val; | ||
| 1841 | 4848 | } else if (os_strcmp(buf, "multi_ap_client_disallow") == 0) { | ||
| 1842 | 4849 | int val = atoi(pos); | ||
| 1843 | 4850 | |||
| 1844 | 4851 | if (val < 0 || val > 3) { | ||
| 1845 | 4852 | wpa_printf(MSG_ERROR, | ||
| 1846 | 4853 | "Line %d: Invalid multi_ap_client_allow '%s'", | ||
| 1847 | 4854 | line, buf); | ||
| 1848 | 4855 | return -1; | ||
| 1849 | 4856 | } | ||
| 1850 | 4857 | bss->multi_ap_client_disallow = val; | ||
| 1851 | 4858 | } else if (os_strcmp(buf, "multi_ap_vlanid") == 0) { | ||
| 1852 | 4859 | int val = atoi(pos); | ||
| 1853 | 4860 | |||
| 1854 | 4861 | if (val < 0 || val > MAX_VLAN_ID) { | ||
| 1855 | 4862 | wpa_printf(MSG_ERROR, | ||
| 1856 | 4863 | "Line %d: Invalid multi_ap_vlan_id '%s'", | ||
| 1857 | 4864 | line, buf); | ||
| 1858 | 4865 | return -1; | ||
| 1859 | 4866 | } | ||
| 1860 | 4867 | bss->multi_ap_vlanid = val; | ||
| 1861 | 4569 | } else if (os_strcmp(buf, "rssi_reject_assoc_rssi") == 0) { | 4868 | } else if (os_strcmp(buf, "rssi_reject_assoc_rssi") == 0) { |
| 1862 | 4570 | conf->rssi_reject_assoc_rssi = atoi(pos); | 4869 | conf->rssi_reject_assoc_rssi = atoi(pos); |
| 1863 | 4571 | } else if (os_strcmp(buf, "rssi_reject_assoc_timeout") == 0) { | 4870 | } else if (os_strcmp(buf, "rssi_reject_assoc_timeout") == 0) { |
| 1864 | @@ -4641,6 +4940,16 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1865 | 4641 | bss->macsec_replay_protect = macsec_replay_protect; | 4940 | bss->macsec_replay_protect = macsec_replay_protect; |
| 1866 | 4642 | } else if (os_strcmp(buf, "macsec_replay_window") == 0) { | 4941 | } else if (os_strcmp(buf, "macsec_replay_window") == 0) { |
| 1867 | 4643 | bss->macsec_replay_window = atoi(pos); | 4942 | bss->macsec_replay_window = atoi(pos); |
| 1868 | 4943 | } else if (os_strcmp(buf, "macsec_offload") == 0) { | ||
| 1869 | 4944 | int macsec_offload = atoi(pos); | ||
| 1870 | 4945 | |||
| 1871 | 4946 | if (macsec_offload < 0 || macsec_offload > 2) { | ||
| 1872 | 4947 | wpa_printf(MSG_ERROR, | ||
| 1873 | 4948 | "Line %d: invalid macsec_offload (%d): '%s'.", | ||
| 1874 | 4949 | line, macsec_offload, pos); | ||
| 1875 | 4950 | return 1; | ||
| 1876 | 4951 | } | ||
| 1877 | 4952 | bss->macsec_offload = macsec_offload; | ||
| 1878 | 4644 | } else if (os_strcmp(buf, "macsec_port") == 0) { | 4953 | } else if (os_strcmp(buf, "macsec_port") == 0) { |
| 1879 | 4645 | int macsec_port = atoi(pos); | 4954 | int macsec_port = atoi(pos); |
| 1880 | 4646 | 4955 | ||
| 1881 | @@ -4661,6 +4970,16 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1882 | 4661 | return 1; | 4970 | return 1; |
| 1883 | 4662 | } | 4971 | } |
| 1884 | 4663 | bss->mka_priority = mka_priority; | 4972 | bss->mka_priority = mka_priority; |
| 1885 | 4973 | } else if (os_strcmp(buf, "macsec_csindex") == 0) { | ||
| 1886 | 4974 | int macsec_csindex = atoi(pos); | ||
| 1887 | 4975 | |||
| 1888 | 4976 | if (macsec_csindex < 0 || macsec_csindex > 1) { | ||
| 1889 | 4977 | wpa_printf(MSG_ERROR, | ||
| 1890 | 4978 | "Line %d: invalid macsec_csindex (%d): '%s'.", | ||
| 1891 | 4979 | line, macsec_csindex, pos); | ||
| 1892 | 4980 | return 1; | ||
| 1893 | 4981 | } | ||
| 1894 | 4982 | bss->macsec_csindex = macsec_csindex; | ||
| 1895 | 4664 | } else if (os_strcmp(buf, "mka_cak") == 0) { | 4983 | } else if (os_strcmp(buf, "mka_cak") == 0) { |
| 1896 | 4665 | size_t len = os_strlen(pos); | 4984 | size_t len = os_strlen(pos); |
| 1897 | 4666 | 4985 | ||
| 1898 | @@ -4697,6 +5016,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1899 | 4697 | bss->disable_11ac = !!atoi(pos); | 5016 | bss->disable_11ac = !!atoi(pos); |
| 1900 | 4698 | } else if (os_strcmp(buf, "disable_11ax") == 0) { | 5017 | } else if (os_strcmp(buf, "disable_11ax") == 0) { |
| 1901 | 4699 | bss->disable_11ax = !!atoi(pos); | 5018 | bss->disable_11ax = !!atoi(pos); |
| 1902 | 5019 | } else if (os_strcmp(buf, "disable_11be") == 0) { | ||
| 1903 | 5020 | bss->disable_11be = !!atoi(pos); | ||
| 1904 | 4700 | #ifdef CONFIG_PASN | 5021 | #ifdef CONFIG_PASN |
| 1905 | 4701 | #ifdef CONFIG_TESTING_OPTIONS | 5022 | #ifdef CONFIG_TESTING_OPTIONS |
| 1906 | 4702 | } else if (os_strcmp(buf, "force_kdk_derivation") == 0) { | 5023 | } else if (os_strcmp(buf, "force_kdk_derivation") == 0) { |
| 1907 | @@ -4713,6 +5034,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1908 | 4713 | } | 5034 | } |
| 1909 | 4714 | } else if (os_strcmp(buf, "pasn_comeback_after") == 0) { | 5035 | } else if (os_strcmp(buf, "pasn_comeback_after") == 0) { |
| 1910 | 4715 | bss->pasn_comeback_after = atoi(pos); | 5036 | bss->pasn_comeback_after = atoi(pos); |
| 1911 | 5037 | } else if (os_strcmp(buf, "pasn_noauth") == 0) { | ||
| 1912 | 5038 | bss->pasn_noauth = atoi(pos); | ||
| 1913 | 4716 | #endif /* CONFIG_PASN */ | 5039 | #endif /* CONFIG_PASN */ |
| 1914 | 4717 | } else if (os_strcmp(buf, "ext_capa_mask") == 0) { | 5040 | } else if (os_strcmp(buf, "ext_capa_mask") == 0) { |
| 1915 | 4718 | if (get_hex_config(bss->ext_capa_mask, EXT_CAPA_MAX_LEN, | 5041 | if (get_hex_config(bss->ext_capa_mask, EXT_CAPA_MAX_LEN, |
| 1916 | @@ -4724,6 +5047,58 @@ static int hostapd_config_fill(struct hostapd_config *conf, | |||
| 1917 | 4724 | return 1; | 5047 | return 1; |
| 1918 | 4725 | } else if (os_strcmp(buf, "rnr") == 0) { | 5048 | } else if (os_strcmp(buf, "rnr") == 0) { |
| 1919 | 4726 | bss->rnr = atoi(pos); | 5049 | bss->rnr = atoi(pos); |
| 1920 | 5050 | } else if (os_strcmp(buf, "ssid_protection") == 0) { | ||
| 1921 | 5051 | int val = atoi(pos); | ||
| 1922 | 5052 | |||
| 1923 | 5053 | if (val < 0 || val > 1) | ||
| 1924 | 5054 | return 1; | ||
| 1925 | 5055 | bss->ssid_protection = val; | ||
| 1926 | 5056 | #ifdef CONFIG_IEEE80211BE | ||
| 1927 | 5057 | } else if (os_strcmp(buf, "ieee80211be") == 0) { | ||
| 1928 | 5058 | conf->ieee80211be = atoi(pos); | ||
| 1929 | 5059 | } else if (os_strcmp(buf, "eht_oper_chwidth") == 0) { | ||
| 1930 | 5060 | conf->eht_oper_chwidth = atoi(pos); | ||
| 1931 | 5061 | } else if (os_strcmp(buf, "eht_oper_centr_freq_seg0_idx") == 0) { | ||
| 1932 | 5062 | conf->eht_oper_centr_freq_seg0_idx = atoi(pos); | ||
| 1933 | 5063 | } else if (os_strcmp(buf, "eht_su_beamformer") == 0) { | ||
| 1934 | 5064 | conf->eht_phy_capab.su_beamformer = atoi(pos); | ||
| 1935 | 5065 | } else if (os_strcmp(buf, "eht_su_beamformee") == 0) { | ||
| 1936 | 5066 | conf->eht_phy_capab.su_beamformee = atoi(pos); | ||
| 1937 | 5067 | } else if (os_strcmp(buf, "eht_mu_beamformer") == 0) { | ||
| 1938 | 5068 | conf->eht_phy_capab.mu_beamformer = atoi(pos); | ||
| 1939 | 5069 | } else if (os_strcmp(buf, "eht_default_pe_duration") == 0) { | ||
| 1940 | 5070 | conf->eht_default_pe_duration = atoi(pos); | ||
| 1941 | 5071 | } else if (os_strcmp(buf, "punct_bitmap") == 0) { | ||
| 1942 | 5072 | if (get_u16(pos, line, &conf->punct_bitmap)) | ||
| 1943 | 5073 | return 1; | ||
| 1944 | 5074 | } else if (os_strcmp(buf, "punct_acs_threshold") == 0) { | ||
| 1945 | 5075 | int val = atoi(pos); | ||
| 1946 | 5076 | |||
| 1947 | 5077 | if (val < 0 || val > 100) { | ||
| 1948 | 5078 | wpa_printf(MSG_ERROR, | ||
| 1949 | 5079 | "Line %d: punct_acs_threshold must be between 0 and 100", | ||
| 1950 | 5080 | line); | ||
| 1951 | 5081 | return 1; | ||
| 1952 | 5082 | } | ||
| 1953 | 5083 | conf->punct_acs_threshold = val; | ||
| 1954 | 5084 | } else if (os_strcmp(buf, "mld_ap") == 0) { | ||
| 1955 | 5085 | bss->mld_ap = !!atoi(pos); | ||
| 1956 | 5086 | } else if (os_strcmp(buf, "mld_addr") == 0) { | ||
| 1957 | 5087 | if (hwaddr_aton(pos, bss->mld_addr)) { | ||
| 1958 | 5088 | wpa_printf(MSG_ERROR, "Line %d: Invalid mld_addr", | ||
| 1959 | 5089 | line); | ||
| 1960 | 5090 | return 1; | ||
| 1961 | 5091 | } | ||
| 1962 | 5092 | } else if (os_strcmp(buf, "eht_bw320_offset") == 0) { | ||
| 1963 | 5093 | conf->eht_bw320_offset = atoi(pos); | ||
| 1964 | 5094 | #ifdef CONFIG_TESTING_OPTIONS | ||
| 1965 | 5095 | } else if (os_strcmp(buf, "eht_oper_puncturing_override") == 0) { | ||
| 1966 | 5096 | if (get_u16(pos, line, &bss->eht_oper_puncturing_override)) | ||
| 1967 | 5097 | return 1; | ||
| 1968 | 5098 | } else if (os_strcmp(buf, "mld_indicate_disabled") == 0) { | ||
| 1969 | 5099 | bss->mld_indicate_disabled = atoi(pos); | ||
| 1970 | 5100 | #endif /* CONFIG_TESTING_OPTIONS */ | ||
| 1971 | 5101 | #endif /* CONFIG_IEEE80211BE */ | ||
| 1972 | 4727 | } else { | 5102 | } else { |
| 1973 | 4728 | wpa_printf(MSG_ERROR, | 5103 | wpa_printf(MSG_ERROR, |
| 1974 | 4729 | "Line %d: unknown configuration item '%s'", | 5104 | "Line %d: unknown configuration item '%s'", |
| 1975 | diff --git a/hostapd/config_file.h b/hostapd/config_file.h | |||
| 1976 | index 9830f5a..9ef6ac8 100644 | |||
| 1977 | --- a/hostapd/config_file.h | |||
| 1978 | +++ b/hostapd/config_file.h | |||
| 1979 | @@ -10,13 +10,10 @@ | |||
| 1980 | 10 | #define CONFIG_FILE_H | 10 | #define CONFIG_FILE_H |
| 1981 | 11 | 11 | ||
| 1982 | 12 | struct hostapd_config * hostapd_config_read(const char *fname); | 12 | struct hostapd_config * hostapd_config_read(const char *fname); |
| 1983 | 13 | int hostapd_config_read_rxkh_file(struct hostapd_bss_config *conf, | ||
| 1984 | 14 | const char *fname); | ||
| 1985 | 13 | int hostapd_set_iface(struct hostapd_config *conf, | 15 | int hostapd_set_iface(struct hostapd_config *conf, |
| 1986 | 14 | struct hostapd_bss_config *bss, const char *field, | 16 | struct hostapd_bss_config *bss, const char *field, |
| 1987 | 15 | char *value); | 17 | char *value); |
| 1988 | 16 | int hostapd_acl_comp(const void *a, const void *b); | ||
| 1989 | 17 | int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num, | ||
| 1990 | 18 | int vlan_id, const u8 *addr); | ||
| 1991 | 19 | void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num, | ||
| 1992 | 20 | const u8 *addr); | ||
| 1993 | 21 | 18 | ||
| 1994 | 22 | #endif /* CONFIG_FILE_H */ | 19 | #endif /* CONFIG_FILE_H */ |
| 1995 | diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c | |||
| 1996 | index 86adf18..39b9ef5 100644 | |||
| 1997 | --- a/hostapd/ctrl_iface.c | |||
| 1998 | +++ b/hostapd/ctrl_iface.c | |||
| 1999 | @@ -38,6 +38,8 @@ | |||
| 2000 | 38 | #endif /* CONFIG_DPP */ | 38 | #endif /* CONFIG_DPP */ |
| 2001 | 39 | #include "common/wpa_ctrl.h" | 39 | #include "common/wpa_ctrl.h" |
| 2002 | 40 | #include "common/ptksa_cache.h" | 40 | #include "common/ptksa_cache.h" |
| 2003 | 41 | #include "common/hw_features_common.h" | ||
| 2004 | 42 | #include "common/nan_de.h" | ||
| 2005 | 41 | #include "crypto/tls.h" | 43 | #include "crypto/tls.h" |
| 2006 | 42 | #include "drivers/driver.h" | 44 | #include "drivers/driver.h" |
| 2007 | 43 | #include "eapol_auth/eapol_auth_sm.h" | 45 | #include "eapol_auth/eapol_auth_sm.h" |
| 2008 | @@ -62,6 +64,7 @@ | |||
| 2009 | 62 | #include "ap/rrm.h" | 64 | #include "ap/rrm.h" |
| 2010 | 63 | #include "ap/dpp_hostapd.h" | 65 | #include "ap/dpp_hostapd.h" |
| 2011 | 64 | #include "ap/dfs.h" | 66 | #include "ap/dfs.h" |
| 2012 | 67 | #include "ap/nan_usd_ap.h" | ||
| 2013 | 65 | #include "wps/wps_defs.h" | 68 | #include "wps/wps_defs.h" |
| 2014 | 66 | #include "wps/wps.h" | 69 | #include "wps/wps.h" |
| 2015 | 67 | #include "fst/fst_ctrl_iface.h" | 70 | #include "fst/fst_ctrl_iface.h" |
| 2016 | @@ -772,235 +775,6 @@ static int hostapd_ctrl_iface_send_qos_map_conf(struct hostapd_data *hapd, | |||
| 2017 | 772 | 775 | ||
| 2018 | 773 | #ifdef CONFIG_WNM_AP | 776 | #ifdef CONFIG_WNM_AP |
| 2019 | 774 | 777 | ||
| 2020 | 775 | static int hostapd_ctrl_iface_disassoc_imminent(struct hostapd_data *hapd, | ||
| 2021 | 776 | const char *cmd) | ||
| 2022 | 777 | { | ||
| 2023 | 778 | u8 addr[ETH_ALEN]; | ||
| 2024 | 779 | int disassoc_timer; | ||
| 2025 | 780 | struct sta_info *sta; | ||
| 2026 | 781 | |||
| 2027 | 782 | if (hwaddr_aton(cmd, addr)) | ||
| 2028 | 783 | return -1; | ||
| 2029 | 784 | if (cmd[17] != ' ') | ||
| 2030 | 785 | return -1; | ||
| 2031 | 786 | disassoc_timer = atoi(cmd + 17); | ||
| 2032 | 787 | |||
| 2033 | 788 | sta = ap_get_sta(hapd, addr); | ||
| 2034 | 789 | if (sta == NULL) { | ||
| 2035 | 790 | wpa_printf(MSG_DEBUG, "Station " MACSTR | ||
| 2036 | 791 | " not found for disassociation imminent message", | ||
| 2037 | 792 | MAC2STR(addr)); | ||
| 2038 | 793 | return -1; | ||
| 2039 | 794 | } | ||
| 2040 | 795 | |||
| 2041 | 796 | return wnm_send_disassoc_imminent(hapd, sta, disassoc_timer); | ||
| 2042 | 797 | } | ||
| 2043 | 798 | |||
| 2044 | 799 | |||
| 2045 | 800 | static int hostapd_ctrl_iface_ess_disassoc(struct hostapd_data *hapd, | ||
| 2046 | 801 | const char *cmd) | ||
| 2047 | 802 | { | ||
| 2048 | 803 | u8 addr[ETH_ALEN]; | ||
| 2049 | 804 | const char *url, *timerstr; | ||
| 2050 | 805 | int disassoc_timer; | ||
| 2051 | 806 | struct sta_info *sta; | ||
| 2052 | 807 | |||
| 2053 | 808 | if (hwaddr_aton(cmd, addr)) | ||
| 2054 | 809 | return -1; | ||
| 2055 | 810 | |||
| 2056 | 811 | sta = ap_get_sta(hapd, addr); | ||
| 2057 | 812 | if (sta == NULL) { | ||
| 2058 | 813 | wpa_printf(MSG_DEBUG, "Station " MACSTR | ||
| 2059 | 814 | " not found for ESS disassociation imminent message", | ||
| 2060 | 815 | MAC2STR(addr)); | ||
| 2061 | 816 | return -1; | ||
| 2062 | 817 | } | ||
| 2063 | 818 | |||
| 2064 | 819 | timerstr = cmd + 17; | ||
| 2065 | 820 | if (*timerstr != ' ') | ||
| 2066 | 821 | return -1; | ||
| 2067 | 822 | timerstr++; | ||
| 2068 | 823 | disassoc_timer = atoi(timerstr); | ||
| 2069 | 824 | if (disassoc_timer < 0 || disassoc_timer > 65535) | ||
| 2070 | 825 | return -1; | ||
| 2071 | 826 | |||
| 2072 | 827 | url = os_strchr(timerstr, ' '); | ||
| 2073 | 828 | if (url == NULL) | ||
| 2074 | 829 | return -1; | ||
| 2075 | 830 | url++; | ||
| 2076 | 831 | |||
| 2077 | 832 | return wnm_send_ess_disassoc_imminent(hapd, sta, url, disassoc_timer); | ||
| 2078 | 833 | } | ||
| 2079 | 834 | |||
| 2080 | 835 | |||
| 2081 | 836 | static int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd, | ||
| 2082 | 837 | const char *cmd) | ||
| 2083 | 838 | { | ||
| 2084 | 839 | u8 addr[ETH_ALEN]; | ||
| 2085 | 840 | const char *pos, *end; | ||
| 2086 | 841 | int disassoc_timer = 0; | ||
| 2087 | 842 | struct sta_info *sta; | ||
| 2088 | 843 | u8 req_mode = 0, valid_int = 0x01, dialog_token = 0x01; | ||
| 2089 | 844 | u8 bss_term_dur[12]; | ||
| 2090 | 845 | char *url = NULL; | ||
| 2091 | 846 | int ret; | ||
| 2092 | 847 | u8 nei_rep[1000]; | ||
| 2093 | 848 | int nei_len; | ||
| 2094 | 849 | u8 mbo[10]; | ||
| 2095 | 850 | size_t mbo_len = 0; | ||
| 2096 | 851 | |||
| 2097 | 852 | if (hwaddr_aton(cmd, addr)) { | ||
| 2098 | 853 | wpa_printf(MSG_DEBUG, "Invalid STA MAC address"); | ||
| 2099 | 854 | return -1; | ||
| 2100 | 855 | } | ||
| 2101 | 856 | |||
| 2102 | 857 | sta = ap_get_sta(hapd, addr); | ||
| 2103 | 858 | if (sta == NULL) { | ||
| 2104 | 859 | wpa_printf(MSG_DEBUG, "Station " MACSTR | ||
| 2105 | 860 | " not found for BSS TM Request message", | ||
| 2106 | 861 | MAC2STR(addr)); | ||
| 2107 | 862 | return -1; | ||
| 2108 | 863 | } | ||
| 2109 | 864 | |||
| 2110 | 865 | pos = os_strstr(cmd, " disassoc_timer="); | ||
| 2111 | 866 | if (pos) { | ||
| 2112 | 867 | pos += 16; | ||
| 2113 | 868 | disassoc_timer = atoi(pos); | ||
| 2114 | 869 | if (disassoc_timer < 0 || disassoc_timer > 65535) { | ||
| 2115 | 870 | wpa_printf(MSG_DEBUG, "Invalid disassoc_timer"); | ||
| 2116 | 871 | return -1; | ||
| 2117 | 872 | } | ||
| 2118 | 873 | } | ||
| 2119 | 874 | |||
| 2120 | 875 | pos = os_strstr(cmd, " valid_int="); | ||
| 2121 | 876 | if (pos) { | ||
| 2122 | 877 | pos += 11; | ||
| 2123 | 878 | valid_int = atoi(pos); | ||
| 2124 | 879 | } | ||
| 2125 | 880 | |||
| 2126 | 881 | pos = os_strstr(cmd, " dialog_token="); | ||
| 2127 | 882 | if (pos) { | ||
| 2128 | 883 | pos += 14; | ||
| 2129 | 884 | dialog_token = atoi(pos); | ||
| 2130 | 885 | } | ||
| 2131 | 886 | |||
| 2132 | 887 | pos = os_strstr(cmd, " bss_term="); | ||
| 2133 | 888 | if (pos) { | ||
| 2134 | 889 | pos += 10; | ||
| 2135 | 890 | req_mode |= WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED; | ||
| 2136 | 891 | /* TODO: TSF configurable/learnable */ | ||
| 2137 | 892 | bss_term_dur[0] = 4; /* Subelement ID */ | ||
| 2138 | 893 | bss_term_dur[1] = 10; /* Length */ | ||
| 2139 | 894 | os_memset(&bss_term_dur[2], 0, 8); | ||
| 2140 | 895 | end = os_strchr(pos, ','); | ||
| 2141 | 896 | if (end == NULL) { | ||
| 2142 | 897 | wpa_printf(MSG_DEBUG, "Invalid bss_term data"); | ||
| 2143 | 898 | return -1; | ||
| 2144 | 899 | } | ||
| 2145 | 900 | end++; | ||
| 2146 | 901 | WPA_PUT_LE16(&bss_term_dur[10], atoi(end)); | ||
| 2147 | 902 | } | ||
| 2148 | 903 | |||
| 2149 | 904 | nei_len = ieee802_11_parse_candidate_list(cmd, nei_rep, | ||
| 2150 | 905 | sizeof(nei_rep)); | ||
| 2151 | 906 | if (nei_len < 0) | ||
| 2152 | 907 | return -1; | ||
| 2153 | 908 | |||
| 2154 | 909 | pos = os_strstr(cmd, " url="); | ||
| 2155 | 910 | if (pos) { | ||
| 2156 | 911 | size_t len; | ||
| 2157 | 912 | pos += 5; | ||
| 2158 | 913 | end = os_strchr(pos, ' '); | ||
| 2159 | 914 | if (end) | ||
| 2160 | 915 | len = end - pos; | ||
| 2161 | 916 | else | ||
| 2162 | 917 | len = os_strlen(pos); | ||
| 2163 | 918 | url = os_malloc(len + 1); | ||
| 2164 | 919 | if (url == NULL) | ||
| 2165 | 920 | return -1; | ||
| 2166 | 921 | os_memcpy(url, pos, len); | ||
| 2167 | 922 | url[len] = '\0'; | ||
| 2168 | 923 | req_mode |= WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT; | ||
| 2169 | 924 | } | ||
| 2170 | 925 | |||
| 2171 | 926 | if (os_strstr(cmd, " pref=1")) | ||
| 2172 | 927 | req_mode |= WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED; | ||
| 2173 | 928 | if (os_strstr(cmd, " abridged=1")) | ||
| 2174 | 929 | req_mode |= WNM_BSS_TM_REQ_ABRIDGED; | ||
| 2175 | 930 | if (os_strstr(cmd, " disassoc_imminent=1")) | ||
| 2176 | 931 | req_mode |= WNM_BSS_TM_REQ_DISASSOC_IMMINENT; | ||
| 2177 | 932 | |||
| 2178 | 933 | #ifdef CONFIG_MBO | ||
| 2179 | 934 | pos = os_strstr(cmd, "mbo="); | ||
| 2180 | 935 | if (pos) { | ||
| 2181 | 936 | unsigned int mbo_reason, cell_pref, reassoc_delay; | ||
| 2182 | 937 | u8 *mbo_pos = mbo; | ||
| 2183 | 938 | |||
| 2184 | 939 | ret = sscanf(pos, "mbo=%u:%u:%u", &mbo_reason, | ||
| 2185 | 940 | &reassoc_delay, &cell_pref); | ||
| 2186 | 941 | if (ret != 3) { | ||
| 2187 | 942 | wpa_printf(MSG_DEBUG, | ||
| 2188 | 943 | "MBO requires three arguments: mbo=<reason>:<reassoc_delay>:<cell_pref>"); | ||
| 2189 | 944 | ret = -1; | ||
| 2190 | 945 | goto fail; | ||
| 2191 | 946 | } | ||
| 2192 | 947 | |||
| 2193 | 948 | if (mbo_reason > MBO_TRANSITION_REASON_PREMIUM_AP) { | ||
| 2194 | 949 | wpa_printf(MSG_DEBUG, | ||
| 2195 | 950 | "Invalid MBO transition reason code %u", | ||
| 2196 | 951 | mbo_reason); | ||
| 2197 | 952 | ret = -1; | ||
| 2198 | 953 | goto fail; | ||
| 2199 | 954 | } | ||
| 2200 | 955 | |||
| 2201 | 956 | /* Valid values for Cellular preference are: 0, 1, 255 */ | ||
| 2202 | 957 | if (cell_pref != 0 && cell_pref != 1 && cell_pref != 255) { | ||
| 2203 | 958 | wpa_printf(MSG_DEBUG, | ||
| 2204 | 959 | "Invalid MBO cellular capability %u", | ||
| 2205 | 960 | cell_pref); | ||
| 2206 | 961 | ret = -1; | ||
| 2207 | 962 | goto fail; | ||
| 2208 | 963 | } | ||
| 2209 | 964 | |||
| 2210 | 965 | if (reassoc_delay > 65535 || | ||
| 2211 | 966 | (reassoc_delay && | ||
| 2212 | 967 | !(req_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT))) { | ||
| 2213 | 968 | wpa_printf(MSG_DEBUG, | ||
| 2214 | 969 | "MBO: Assoc retry delay is only valid in disassoc imminent mode"); | ||
| 2215 | 970 | ret = -1; | ||
| 2216 | 971 | goto fail; | ||
| 2217 | 972 | } | ||
| 2218 | 973 | |||
| 2219 | 974 | *mbo_pos++ = MBO_ATTR_ID_TRANSITION_REASON; | ||
| 2220 | 975 | *mbo_pos++ = 1; | ||
| 2221 | 976 | *mbo_pos++ = mbo_reason; | ||
| 2222 | 977 | *mbo_pos++ = MBO_ATTR_ID_CELL_DATA_PREF; | ||
| 2223 | 978 | *mbo_pos++ = 1; | ||
| 2224 | 979 | *mbo_pos++ = cell_pref; | ||
| 2225 | 980 | |||
| 2226 | 981 | if (reassoc_delay) { | ||
| 2227 | 982 | *mbo_pos++ = MBO_ATTR_ID_ASSOC_RETRY_DELAY; | ||
| 2228 | 983 | *mbo_pos++ = 2; | ||
| 2229 | 984 | WPA_PUT_LE16(mbo_pos, reassoc_delay); | ||
| 2230 | 985 | mbo_pos += 2; | ||
| 2231 | 986 | } | ||
| 2232 | 987 | |||
| 2233 | 988 | mbo_len = mbo_pos - mbo; | ||
| 2234 | 989 | } | ||
| 2235 | 990 | #endif /* CONFIG_MBO */ | ||
| 2236 | 991 | |||
| 2237 | 992 | ret = wnm_send_bss_tm_req(hapd, sta, req_mode, disassoc_timer, | ||
| 2238 | 993 | valid_int, bss_term_dur, dialog_token, url, | ||
| 2239 | 994 | nei_len ? nei_rep : NULL, nei_len, | ||
| 2240 | 995 | mbo_len ? mbo : NULL, mbo_len); | ||
| 2241 | 996 | #ifdef CONFIG_MBO | ||
| 2242 | 997 | fail: | ||
| 2243 | 998 | #endif /* CONFIG_MBO */ | ||
| 2244 | 999 | os_free(url); | ||
| 2245 | 1000 | return ret; | ||
| 2246 | 1001 | } | ||
| 2247 | 1002 | |||
| 2248 | 1003 | |||
| 2249 | 1004 | static int hostapd_ctrl_iface_coloc_intf_req(struct hostapd_data *hapd, | 778 | static int hostapd_ctrl_iface_coloc_intf_req(struct hostapd_data *hapd, |
| 2250 | 1005 | const char *cmd) | 779 | const char *cmd) |
| 2251 | 1006 | { | 780 | { |
| 2252 | @@ -1090,6 +864,12 @@ static int hostapd_ctrl_iface_get_key_mgmt(struct hostapd_data *hapd, | |||
| 2253 | 1090 | return pos - buf; | 864 | return pos - buf; |
| 2254 | 1091 | pos += ret; | 865 | pos += ret; |
| 2255 | 1092 | } | 866 | } |
| 2256 | 867 | if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_FT_SAE_EXT_KEY) { | ||
| 2257 | 868 | ret = os_snprintf(pos, end - pos, "FT-SAE-EXT-KEY "); | ||
| 2258 | 869 | if (os_snprintf_error(end - pos, ret)) | ||
| 2259 | 870 | return pos - buf; | ||
| 2260 | 871 | pos += ret; | ||
| 2261 | 872 | } | ||
| 2262 | 1093 | #endif /* CONFIG_SAE */ | 873 | #endif /* CONFIG_SAE */ |
| 2263 | 1094 | #ifdef CONFIG_FILS | 874 | #ifdef CONFIG_FILS |
| 2264 | 1095 | if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA256) { | 875 | if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA256) { |
| 2265 | @@ -1125,6 +905,12 @@ static int hostapd_ctrl_iface_get_key_mgmt(struct hostapd_data *hapd, | |||
| 2266 | 1125 | return pos - buf; | 905 | return pos - buf; |
| 2267 | 1126 | pos += ret; | 906 | pos += ret; |
| 2268 | 1127 | } | 907 | } |
| 2269 | 908 | if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_SAE_EXT_KEY) { | ||
| 2270 | 909 | ret = os_snprintf(pos, end - pos, "SAE-EXT-KEY "); | ||
| 2271 | 910 | if (os_snprintf_error(end - pos, ret)) | ||
| 2272 | 911 | return pos - buf; | ||
| 2273 | 912 | pos += ret; | ||
| 2274 | 913 | } | ||
| 2275 | 1128 | #endif /* CONFIG_SAE */ | 914 | #endif /* CONFIG_SAE */ |
| 2276 | 1129 | if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X_SUITE_B) { | 915 | if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X_SUITE_B) { |
| 2277 | 1130 | ret = os_snprintf(pos, end - pos, "WPA-EAP-SUITE-B "); | 916 | ret = os_snprintf(pos, end - pos, "WPA-EAP-SUITE-B "); |
| 2278 | @@ -1172,6 +958,14 @@ static int hostapd_ctrl_iface_get_key_mgmt(struct hostapd_data *hapd, | |||
| 2279 | 1172 | pos += ret; | 958 | pos += ret; |
| 2280 | 1173 | } | 959 | } |
| 2281 | 1174 | #endif /* CONFIG_DPP */ | 960 | #endif /* CONFIG_DPP */ |
| 2282 | 961 | #ifdef CONFIG_SHA384 | ||
| 2283 | 962 | if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X_SHA384) { | ||
| 2284 | 963 | ret = os_snprintf(pos, end - pos, "WPA-EAP-SHA384 "); | ||
| 2285 | 964 | if (os_snprintf_error(end - pos, ret)) | ||
| 2286 | 965 | return pos - buf; | ||
| 2287 | 966 | pos += ret; | ||
| 2288 | 967 | } | ||
| 2289 | 968 | #endif /* CONFIG_SHA384 */ | ||
| 2290 | 1175 | 969 | ||
| 2291 | 1176 | if (pos > buf && *(pos - 1) == ' ') { | 970 | if (pos > buf && *(pos - 1) == ' ') { |
| 2292 | 1177 | *(pos - 1) = '\0'; | 971 | *(pos - 1) = '\0'; |
| 2293 | @@ -1200,6 +994,14 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd, | |||
| 2294 | 1200 | return pos - buf; | 994 | return pos - buf; |
| 2295 | 1201 | pos += ret; | 995 | pos += ret; |
| 2296 | 1202 | 996 | ||
| 2297 | 997 | if ((hapd->conf->config_id)) { | ||
| 2298 | 998 | ret = os_snprintf(pos, end - pos, "config_id=%s\n", | ||
| 2299 | 999 | hapd->conf->config_id); | ||
| 2300 | 1000 | if (os_snprintf_error(end - pos, ret)) | ||
| 2301 | 1001 | return pos - buf; | ||
| 2302 | 1002 | pos += ret; | ||
| 2303 | 1003 | } | ||
| 2304 | 1004 | |||
| 2305 | 1203 | #ifdef CONFIG_WPS | 1005 | #ifdef CONFIG_WPS |
| 2306 | 1204 | ret = os_snprintf(pos, end - pos, "wps_state=%s\n", | 1006 | ret = os_snprintf(pos, end - pos, "wps_state=%s\n", |
| 2307 | 1205 | hapd->conf->wps_state == 0 ? "disabled" : | 1007 | hapd->conf->wps_state == 0 ? "disabled" : |
| 2308 | @@ -1362,43 +1164,6 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd, | |||
| 2309 | 1362 | } | 1164 | } |
| 2310 | 1363 | 1165 | ||
| 2311 | 1364 | 1166 | ||
| 2312 | 1365 | static void hostapd_disassoc_accept_mac(struct hostapd_data *hapd) | ||
| 2313 | 1366 | { | ||
| 2314 | 1367 | struct sta_info *sta; | ||
| 2315 | 1368 | struct vlan_description vlan_id; | ||
| 2316 | 1369 | |||
| 2317 | 1370 | if (hapd->conf->macaddr_acl != DENY_UNLESS_ACCEPTED) | ||
| 2318 | 1371 | return; | ||
| 2319 | 1372 | |||
| 2320 | 1373 | for (sta = hapd->sta_list; sta; sta = sta->next) { | ||
| 2321 | 1374 | if (!hostapd_maclist_found(hapd->conf->accept_mac, | ||
| 2322 | 1375 | hapd->conf->num_accept_mac, | ||
| 2323 | 1376 | sta->addr, &vlan_id) || | ||
| 2324 | 1377 | (vlan_id.notempty && | ||
| 2325 | 1378 | vlan_compare(&vlan_id, sta->vlan_desc))) | ||
| 2326 | 1379 | ap_sta_disconnect(hapd, sta, sta->addr, | ||
| 2327 | 1380 | WLAN_REASON_UNSPECIFIED); | ||
| 2328 | 1381 | } | ||
| 2329 | 1382 | } | ||
| 2330 | 1383 | |||
| 2331 | 1384 | |||
| 2332 | 1385 | static void hostapd_disassoc_deny_mac(struct hostapd_data *hapd) | ||
| 2333 | 1386 | { | ||
| 2334 | 1387 | struct sta_info *sta; | ||
| 2335 | 1388 | struct vlan_description vlan_id; | ||
| 2336 | 1389 | |||
| 2337 | 1390 | for (sta = hapd->sta_list; sta; sta = sta->next) { | ||
| 2338 | 1391 | if (hostapd_maclist_found(hapd->conf->deny_mac, | ||
| 2339 | 1392 | hapd->conf->num_deny_mac, sta->addr, | ||
| 2340 | 1393 | &vlan_id) && | ||
| 2341 | 1394 | (!vlan_id.notempty || | ||
| 2342 | 1395 | !vlan_compare(&vlan_id, sta->vlan_desc))) | ||
| 2343 | 1396 | ap_sta_disconnect(hapd, sta, sta->addr, | ||
| 2344 | 1397 | WLAN_REASON_UNSPECIFIED); | ||
| 2345 | 1398 | } | ||
| 2346 | 1399 | } | ||
| 2347 | 1400 | |||
| 2348 | 1401 | |||
| 2349 | 1402 | static int hostapd_ctrl_iface_set_band(struct hostapd_data *hapd, | 1167 | static int hostapd_ctrl_iface_set_band(struct hostapd_data *hapd, |
| 2350 | 1403 | const char *bands) | 1168 | const char *bands) |
| 2351 | 1404 | { | 1169 | { |
| 2352 | @@ -1519,6 +1284,9 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd) | |||
| 2353 | 1519 | } else if (os_strcasecmp(cmd, "dpp_configurator_params") == 0) { | 1284 | } else if (os_strcasecmp(cmd, "dpp_configurator_params") == 0) { |
| 2354 | 1520 | os_free(hapd->dpp_configurator_params); | 1285 | os_free(hapd->dpp_configurator_params); |
| 2355 | 1521 | hapd->dpp_configurator_params = os_strdup(value); | 1286 | hapd->dpp_configurator_params = os_strdup(value); |
| 2356 | 1287 | #ifdef CONFIG_DPP2 | ||
| 2357 | 1288 | dpp_controller_set_params(hapd->iface->interfaces->dpp, value); | ||
| 2358 | 1289 | #endif /* CONFIG_DPP2 */ | ||
| 2359 | 1522 | } else if (os_strcasecmp(cmd, "dpp_init_max_tries") == 0) { | 1290 | } else if (os_strcasecmp(cmd, "dpp_init_max_tries") == 0) { |
| 2360 | 1523 | hapd->dpp_init_max_tries = atoi(value); | 1291 | hapd->dpp_init_max_tries = atoi(value); |
| 2361 | 1524 | } else if (os_strcasecmp(cmd, "dpp_init_retry_time") == 0) { | 1292 | } else if (os_strcasecmp(cmd, "dpp_init_retry_time") == 0) { |
| 2362 | @@ -1541,6 +1309,8 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd) | |||
| 2363 | 1541 | hostapd_disassoc_deny_mac(hapd); | 1309 | hostapd_disassoc_deny_mac(hapd); |
| 2364 | 1542 | } else if (os_strcasecmp(cmd, "accept_mac_file") == 0) { | 1310 | } else if (os_strcasecmp(cmd, "accept_mac_file") == 0) { |
| 2365 | 1543 | hostapd_disassoc_accept_mac(hapd); | 1311 | hostapd_disassoc_accept_mac(hapd); |
| 2366 | 1312 | } else if (os_strcasecmp(cmd, "ssid") == 0) { | ||
| 2367 | 1313 | hostapd_neighbor_sync_own_report(hapd); | ||
| 2368 | 1544 | } else if (os_strncmp(cmd, "wme_ac_", 7) == 0 || | 1314 | } else if (os_strncmp(cmd, "wme_ac_", 7) == 0 || |
| 2369 | 1545 | os_strncmp(cmd, "wmm_ac_", 7) == 0) { | 1315 | os_strncmp(cmd, "wmm_ac_", 7) == 0) { |
| 2370 | 1546 | hapd->parameter_set_count++; | 1316 | hapd->parameter_set_count++; |
| 2371 | @@ -1627,6 +1397,16 @@ static int hostapd_ctrl_iface_reload(struct hostapd_iface *iface) | |||
| 2372 | 1627 | } | 1397 | } |
| 2373 | 1628 | 1398 | ||
| 2374 | 1629 | 1399 | ||
| 2375 | 1400 | static int hostapd_ctrl_iface_reload_bss(struct hostapd_data *bss) | ||
| 2376 | 1401 | { | ||
| 2377 | 1402 | if (hostapd_reload_bss_only(bss) < 0) { | ||
| 2378 | 1403 | wpa_printf(MSG_ERROR, "Reloading of BSS failed"); | ||
| 2379 | 1404 | return -1; | ||
| 2380 | 1405 | } | ||
| 2381 | 1406 | return 0; | ||
| 2382 | 1407 | } | ||
| 2383 | 1408 | |||
| 2384 | 1409 | |||
| 2385 | 1630 | static int hostapd_ctrl_iface_disable(struct hostapd_iface *iface) | 1410 | static int hostapd_ctrl_iface_disable(struct hostapd_iface *iface) |
| 2386 | 1631 | { | 1411 | { |
| 2387 | 1632 | if (hostapd_disable_iface(iface) < 0) { | 1412 | if (hostapd_disable_iface(iface) < 0) { |
| 2388 | @@ -1655,7 +1435,7 @@ hostapd_ctrl_iface_kick_mismatch_psk_sta_iter(struct hostapd_data *hapd, | |||
| 2389 | 1655 | pmk_match = PMK_LEN == pmk_len && | 1435 | pmk_match = PMK_LEN == pmk_len && |
| 2390 | 1656 | os_memcmp(psk->psk, pmk, pmk_len) == 0; | 1436 | os_memcmp(psk->psk, pmk, pmk_len) == 0; |
| 2391 | 1657 | sta_match = psk->group == 0 && | 1437 | sta_match = psk->group == 0 && |
| 2393 | 1658 | os_memcmp(sta->addr, psk->addr, ETH_ALEN) == 0; | 1438 | ether_addr_equal(sta->addr, psk->addr); |
| 2394 | 1659 | bss_match = psk->group == 1; | 1439 | bss_match = psk->group == 1; |
| 2395 | 1660 | 1440 | ||
| 2396 | 1661 | if (pmk_match && (sta_match || bss_match)) | 1441 | if (pmk_match && (sta_match || bss_match)) |
| 2397 | @@ -1694,6 +1474,79 @@ static int hostapd_ctrl_iface_reload_wpa_psk(struct hostapd_data *hapd) | |||
| 2398 | 1694 | } | 1474 | } |
| 2399 | 1695 | 1475 | ||
| 2400 | 1696 | 1476 | ||
| 2401 | 1477 | #ifdef CONFIG_IEEE80211R_AP | ||
| 2402 | 1478 | |||
| 2403 | 1479 | static int hostapd_ctrl_iface_get_rxkhs(struct hostapd_data *hapd, | ||
| 2404 | 1480 | char *buf, size_t buflen) | ||
| 2405 | 1481 | { | ||
| 2406 | 1482 | int ret, start_pos; | ||
| 2407 | 1483 | char *pos, *end; | ||
| 2408 | 1484 | struct ft_remote_r0kh *r0kh; | ||
| 2409 | 1485 | struct ft_remote_r1kh *r1kh; | ||
| 2410 | 1486 | struct hostapd_bss_config *conf = hapd->conf; | ||
| 2411 | 1487 | |||
| 2412 | 1488 | pos = buf; | ||
| 2413 | 1489 | end = buf + buflen; | ||
| 2414 | 1490 | |||
| 2415 | 1491 | for (r0kh = conf->r0kh_list; r0kh; r0kh=r0kh->next) { | ||
| 2416 | 1492 | start_pos = pos - buf; | ||
| 2417 | 1493 | ret = os_snprintf(pos, end - pos, "r0kh=" MACSTR " ", | ||
| 2418 | 1494 | MAC2STR(r0kh->addr)); | ||
| 2419 | 1495 | if (os_snprintf_error(end - pos, ret)) | ||
| 2420 | 1496 | return start_pos; | ||
| 2421 | 1497 | pos += ret; | ||
| 2422 | 1498 | if (r0kh->id_len + 1 >= (size_t) (end - pos)) | ||
| 2423 | 1499 | return start_pos; | ||
| 2424 | 1500 | os_memcpy(pos, r0kh->id, r0kh->id_len); | ||
| 2425 | 1501 | pos += r0kh->id_len; | ||
| 2426 | 1502 | *pos++ = ' '; | ||
| 2427 | 1503 | pos += wpa_snprintf_hex(pos, end - pos, r0kh->key, | ||
| 2428 | 1504 | sizeof(r0kh->key)); | ||
| 2429 | 1505 | ret = os_snprintf(pos, end - pos, "\n"); | ||
| 2430 | 1506 | if (os_snprintf_error(end - pos, ret)) | ||
| 2431 | 1507 | return start_pos; | ||
| 2432 | 1508 | pos += ret; | ||
| 2433 | 1509 | } | ||
| 2434 | 1510 | |||
| 2435 | 1511 | for (r1kh = conf->r1kh_list; r1kh; r1kh=r1kh->next) { | ||
| 2436 | 1512 | start_pos = pos - buf; | ||
| 2437 | 1513 | ret = os_snprintf(pos, end - pos, "r1kh=" MACSTR " " MACSTR " ", | ||
| 2438 | 1514 | MAC2STR(r1kh->addr), MAC2STR(r1kh->id)); | ||
| 2439 | 1515 | if (os_snprintf_error(end - pos, ret)) | ||
| 2440 | 1516 | return start_pos; | ||
| 2441 | 1517 | pos += ret; | ||
| 2442 | 1518 | pos += wpa_snprintf_hex(pos, end - pos, r1kh->key, | ||
| 2443 | 1519 | sizeof(r1kh->key)); | ||
| 2444 | 1520 | ret = os_snprintf(pos, end - pos, "\n"); | ||
| 2445 | 1521 | if (os_snprintf_error(end - pos, ret)) | ||
| 2446 | 1522 | return start_pos; | ||
| 2447 | 1523 | pos += ret; | ||
| 2448 | 1524 | } | ||
| 2449 | 1525 | |||
| 2450 | 1526 | return pos - buf; | ||
| 2451 | 1527 | } | ||
| 2452 | 1528 | |||
| 2453 | 1529 | |||
| 2454 | 1530 | static int hostapd_ctrl_iface_reload_rxkhs(struct hostapd_data *hapd) | ||
| 2455 | 1531 | { | ||
| 2456 | 1532 | struct hostapd_bss_config *conf = hapd->conf; | ||
| 2457 | 1533 | int err; | ||
| 2458 | 1534 | |||
| 2459 | 1535 | hostapd_config_clear_rxkhs(conf); | ||
| 2460 | 1536 | |||
| 2461 | 1537 | err = hostapd_config_read_rxkh_file(conf, conf->rxkh_file); | ||
| 2462 | 1538 | if (err < 0) { | ||
| 2463 | 1539 | wpa_printf(MSG_ERROR, "Reloading RxKHs failed: %d", | ||
| 2464 | 1540 | err); | ||
| 2465 | 1541 | return -1; | ||
| 2466 | 1542 | } | ||
| 2467 | 1543 | |||
| 2468 | 1544 | return 0; | ||
| 2469 | 1545 | } | ||
| 2470 | 1546 | |||
| 2471 | 1547 | #endif /* CONFIG_IEEE80211R_AP */ | ||
| 2472 | 1548 | |||
| 2473 | 1549 | |||
| 2474 | 1697 | #ifdef CONFIG_TESTING_OPTIONS | 1550 | #ifdef CONFIG_TESTING_OPTIONS |
| 2475 | 1698 | 1551 | ||
| 2476 | 1699 | static int hostapd_ctrl_iface_radar(struct hostapd_data *hapd, char *cmd) | 1552 | static int hostapd_ctrl_iface_radar(struct hostapd_data *hapd, char *cmd) |
| 2477 | @@ -1945,7 +1798,7 @@ static int hostapd_ctrl_iface_eapol_rx(struct hostapd_data *hapd, char *cmd) | |||
| 2478 | 1945 | return -1; | 1798 | return -1; |
| 2479 | 1946 | } | 1799 | } |
| 2480 | 1947 | 1800 | ||
| 2482 | 1948 | ieee802_1x_receive(hapd, src, buf, len); | 1801 | ieee802_1x_receive(hapd, src, buf, len, FRAME_ENCRYPTION_UNKNOWN); |
| 2483 | 1949 | os_free(buf); | 1802 | os_free(buf); |
| 2484 | 1950 | 1803 | ||
| 2485 | 1951 | return 0; | 1804 | return 0; |
| 2486 | @@ -2068,6 +1921,7 @@ static int hostapd_ctrl_iface_data_test_config(struct hostapd_data *hapd, | |||
| 2487 | 2068 | int enabled = atoi(cmd); | 1921 | int enabled = atoi(cmd); |
| 2488 | 2069 | char *pos; | 1922 | char *pos; |
| 2489 | 2070 | const char *ifname; | 1923 | const char *ifname; |
| 2490 | 1924 | const u8 *addr = hapd->own_addr; | ||
| 2491 | 2071 | 1925 | ||
| 2492 | 2072 | if (!enabled) { | 1926 | if (!enabled) { |
| 2493 | 2073 | if (hapd->l2_test) { | 1927 | if (hapd->l2_test) { |
| 2494 | @@ -2088,7 +1942,11 @@ static int hostapd_ctrl_iface_data_test_config(struct hostapd_data *hapd, | |||
| 2495 | 2088 | else | 1942 | else |
| 2496 | 2089 | ifname = hapd->conf->iface; | 1943 | ifname = hapd->conf->iface; |
| 2497 | 2090 | 1944 | ||
| 2499 | 2091 | hapd->l2_test = l2_packet_init(ifname, hapd->own_addr, | 1945 | #ifdef CONFIG_IEEE80211BE |
| 2500 | 1946 | if (hapd->conf->mld_ap) | ||
| 2501 | 1947 | addr = hapd->mld->mld_addr; | ||
| 2502 | 1948 | #endif /* CONFIG_IEEE80211BE */ | ||
| 2503 | 1949 | hapd->l2_test = l2_packet_init(ifname, addr, | ||
| 2504 | 2092 | ETHERTYPE_IP, hostapd_data_test_rx, | 1950 | ETHERTYPE_IP, hostapd_data_test_rx, |
| 2505 | 2093 | hapd, 1); | 1951 | hapd, 1); |
| 2506 | 2094 | if (hapd->l2_test == NULL) | 1952 | if (hapd->l2_test == NULL) |
| 2507 | @@ -2225,74 +2083,6 @@ done: | |||
| 2508 | 2225 | } | 2083 | } |
| 2509 | 2226 | 2084 | ||
| 2510 | 2227 | 2085 | ||
| 2511 | 2228 | static int hostapd_ctrl_test_alloc_fail(struct hostapd_data *hapd, char *cmd) | ||
| 2512 | 2229 | { | ||
| 2513 | 2230 | #ifdef WPA_TRACE_BFD | ||
| 2514 | 2231 | char *pos; | ||
| 2515 | 2232 | |||
| 2516 | 2233 | wpa_trace_fail_after = atoi(cmd); | ||
| 2517 | 2234 | pos = os_strchr(cmd, ':'); | ||
| 2518 | 2235 | if (pos) { | ||
| 2519 | 2236 | pos++; | ||
| 2520 | 2237 | os_strlcpy(wpa_trace_fail_func, pos, | ||
| 2521 | 2238 | sizeof(wpa_trace_fail_func)); | ||
| 2522 | 2239 | } else { | ||
| 2523 | 2240 | wpa_trace_fail_after = 0; | ||
| 2524 | 2241 | } | ||
| 2525 | 2242 | |||
| 2526 | 2243 | return 0; | ||
| 2527 | 2244 | #else /* WPA_TRACE_BFD */ | ||
| 2528 | 2245 | return -1; | ||
| 2529 | 2246 | #endif /* WPA_TRACE_BFD */ | ||
| 2530 | 2247 | } | ||
| 2531 | 2248 | |||
| 2532 | 2249 | |||
| 2533 | 2250 | static int hostapd_ctrl_get_alloc_fail(struct hostapd_data *hapd, | ||
| 2534 | 2251 | char *buf, size_t buflen) | ||
| 2535 | 2252 | { | ||
| 2536 | 2253 | #ifdef WPA_TRACE_BFD | ||
| 2537 | 2254 | return os_snprintf(buf, buflen, "%u:%s", wpa_trace_fail_after, | ||
| 2538 | 2255 | wpa_trace_fail_func); | ||
| 2539 | 2256 | #else /* WPA_TRACE_BFD */ | ||
| 2540 | 2257 | return -1; | ||
| 2541 | 2258 | #endif /* WPA_TRACE_BFD */ | ||
| 2542 | 2259 | } | ||
| 2543 | 2260 | |||
| 2544 | 2261 | |||
| 2545 | 2262 | static int hostapd_ctrl_test_fail(struct hostapd_data *hapd, char *cmd) | ||
| 2546 | 2263 | { | ||
| 2547 | 2264 | #ifdef WPA_TRACE_BFD | ||
| 2548 | 2265 | char *pos; | ||
| 2549 | 2266 | |||
| 2550 | 2267 | wpa_trace_test_fail_after = atoi(cmd); | ||
| 2551 | 2268 | pos = os_strchr(cmd, ':'); | ||
| 2552 | 2269 | if (pos) { | ||
| 2553 | 2270 | pos++; | ||
| 2554 | 2271 | os_strlcpy(wpa_trace_test_fail_func, pos, | ||
| 2555 | 2272 | sizeof(wpa_trace_test_fail_func)); | ||
| 2556 | 2273 | } else { | ||
| 2557 | 2274 | wpa_trace_test_fail_after = 0; | ||
| 2558 | 2275 | } | ||
| 2559 | 2276 | |||
| 2560 | 2277 | return 0; | ||
| 2561 | 2278 | #else /* WPA_TRACE_BFD */ | ||
| 2562 | 2279 | return -1; | ||
| 2563 | 2280 | #endif /* WPA_TRACE_BFD */ | ||
| 2564 | 2281 | } | ||
| 2565 | 2282 | |||
| 2566 | 2283 | |||
| 2567 | 2284 | static int hostapd_ctrl_get_fail(struct hostapd_data *hapd, | ||
| 2568 | 2285 | char *buf, size_t buflen) | ||
| 2569 | 2286 | { | ||
| 2570 | 2287 | #ifdef WPA_TRACE_BFD | ||
| 2571 | 2288 | return os_snprintf(buf, buflen, "%u:%s", wpa_trace_test_fail_after, | ||
| 2572 | 2289 | wpa_trace_test_fail_func); | ||
| 2573 | 2290 | #else /* WPA_TRACE_BFD */ | ||
| 2574 | 2291 | return -1; | ||
| 2575 | 2292 | #endif /* WPA_TRACE_BFD */ | ||
| 2576 | 2293 | } | ||
| 2577 | 2294 | |||
| 2578 | 2295 | |||
| 2579 | 2296 | static int hostapd_ctrl_reset_pn(struct hostapd_data *hapd, const char *cmd) | 2086 | static int hostapd_ctrl_reset_pn(struct hostapd_data *hapd, const char *cmd) |
| 2580 | 2297 | { | 2087 | { |
| 2581 | 2298 | struct sta_info *sta; | 2088 | struct sta_info *sta; |
| 2582 | @@ -2664,8 +2454,46 @@ static int hostapd_ctrl_register_frame(struct hostapd_data *hapd, | |||
| 2583 | 2664 | 2454 | ||
| 2584 | 2665 | 2455 | ||
| 2585 | 2666 | #ifdef NEED_AP_MLME | 2456 | #ifdef NEED_AP_MLME |
| 2587 | 2667 | static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params) | 2457 | static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params, |
| 2588 | 2458 | u16 punct_bitmap) | ||
| 2589 | 2668 | { | 2459 | { |
| 2590 | 2460 | u32 start_freq; | ||
| 2591 | 2461 | |||
| 2592 | 2462 | if (is_6ghz_freq(params->freq)) { | ||
| 2593 | 2463 | const int bw_idx[] = { 20, 40, 80, 160, 320 }; | ||
| 2594 | 2464 | int idx, bw; | ||
| 2595 | 2465 | |||
| 2596 | 2466 | /* The 6 GHz band requires HE to be enabled. */ | ||
| 2597 | 2467 | params->he_enabled = 1; | ||
| 2598 | 2468 | |||
| 2599 | 2469 | if (params->center_freq1) { | ||
| 2600 | 2470 | if (params->freq == 5935) | ||
| 2601 | 2471 | idx = (params->center_freq1 - 5925) / 5; | ||
| 2602 | 2472 | else | ||
| 2603 | 2473 | idx = (params->center_freq1 - 5950) / 5; | ||
| 2604 | 2474 | |||
| 2605 | 2475 | bw = center_idx_to_bw_6ghz(idx); | ||
| 2606 | 2476 | if (bw < 0 || bw > (int) ARRAY_SIZE(bw_idx) || | ||
| 2607 | 2477 | bw_idx[bw] != params->bandwidth) | ||
| 2608 | 2478 | return -1; | ||
| 2609 | 2479 | } | ||
| 2610 | 2480 | } else { /* Non-6 GHz channel */ | ||
| 2611 | 2481 | /* An EHT STA is also an HE STA as defined in | ||
| 2612 | 2482 | * IEEE P802.11be/D5.0, 4.3.16a. */ | ||
| 2613 | 2483 | if (params->he_enabled || params->eht_enabled) { | ||
| 2614 | 2484 | params->he_enabled = 1; | ||
| 2615 | 2485 | /* An HE STA is also a VHT STA if operating in the 5 GHz | ||
| 2616 | 2486 | * band and an HE STA is also an HT STA in the 2.4 GHz | ||
| 2617 | 2487 | * band as defined in IEEE Std 802.11ax-2021, 4.3.15a. | ||
| 2618 | 2488 | * A VHT STA is an HT STA as defined in IEEE | ||
| 2619 | 2489 | * Std 802.11, 4.3.15. */ | ||
| 2620 | 2490 | if (IS_5GHZ(params->freq)) | ||
| 2621 | 2491 | params->vht_enabled = 1; | ||
| 2622 | 2492 | |||
| 2623 | 2493 | params->ht_enabled = 1; | ||
| 2624 | 2494 | } | ||
| 2625 | 2495 | } | ||
| 2626 | 2496 | |||
| 2627 | 2669 | switch (params->bandwidth) { | 2497 | switch (params->bandwidth) { |
| 2628 | 2670 | case 0: | 2498 | case 0: |
| 2629 | 2671 | /* bandwidth not specified: use 20 MHz by default */ | 2499 | /* bandwidth not specified: use 20 MHz by default */ |
| 2630 | @@ -2677,11 +2505,17 @@ static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params) | |||
| 2631 | 2677 | 2505 | ||
| 2632 | 2678 | if (params->center_freq2 || params->sec_channel_offset) | 2506 | if (params->center_freq2 || params->sec_channel_offset) |
| 2633 | 2679 | return -1; | 2507 | return -1; |
| 2635 | 2680 | break; | 2508 | |
| 2636 | 2509 | if (punct_bitmap) | ||
| 2637 | 2510 | return -1; | ||
| 2638 | 2511 | break; | ||
| 2639 | 2681 | case 40: | 2512 | case 40: |
| 2640 | 2682 | if (params->center_freq2 || !params->sec_channel_offset) | 2513 | if (params->center_freq2 || !params->sec_channel_offset) |
| 2641 | 2683 | return -1; | 2514 | return -1; |
| 2642 | 2684 | 2515 | ||
| 2643 | 2516 | if (punct_bitmap) | ||
| 2644 | 2517 | return -1; | ||
| 2645 | 2518 | |||
| 2646 | 2685 | if (!params->center_freq1) | 2519 | if (!params->center_freq1) |
| 2647 | 2686 | break; | 2520 | break; |
| 2648 | 2687 | switch (params->sec_channel_offset) { | 2521 | switch (params->sec_channel_offset) { |
| 2649 | @@ -2716,6 +2550,9 @@ static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params) | |||
| 2650 | 2716 | return -1; | 2550 | return -1; |
| 2651 | 2717 | } | 2551 | } |
| 2652 | 2718 | 2552 | ||
| 2653 | 2553 | if (params->center_freq2 && punct_bitmap) | ||
| 2654 | 2554 | return -1; | ||
| 2655 | 2555 | |||
| 2656 | 2719 | /* Adjacent and overlapped are not allowed for 80+80 */ | 2556 | /* Adjacent and overlapped are not allowed for 80+80 */ |
| 2657 | 2720 | if (params->center_freq2 && | 2557 | if (params->center_freq2 && |
| 2658 | 2721 | params->center_freq1 - params->center_freq2 <= 80 && | 2558 | params->center_freq1 - params->center_freq2 <= 80 && |
| 2659 | @@ -2746,10 +2583,63 @@ static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params) | |||
| 2660 | 2746 | return -1; | 2583 | return -1; |
| 2661 | 2747 | } | 2584 | } |
| 2662 | 2748 | break; | 2585 | break; |
| 2663 | 2586 | case 320: | ||
| 2664 | 2587 | if (!params->center_freq1 || params->center_freq2 || | ||
| 2665 | 2588 | !params->sec_channel_offset) | ||
| 2666 | 2589 | return -1; | ||
| 2667 | 2590 | |||
| 2668 | 2591 | switch (params->sec_channel_offset) { | ||
| 2669 | 2592 | case 1: | ||
| 2670 | 2593 | if (params->freq + 150 != params->center_freq1 && | ||
| 2671 | 2594 | params->freq + 110 != params->center_freq1 && | ||
| 2672 | 2595 | params->freq + 70 != params->center_freq1 && | ||
| 2673 | 2596 | params->freq + 30 != params->center_freq1 && | ||
| 2674 | 2597 | params->freq - 10 != params->center_freq1 && | ||
| 2675 | 2598 | params->freq - 50 != params->center_freq1 && | ||
| 2676 | 2599 | params->freq - 90 != params->center_freq1 && | ||
| 2677 | 2600 | params->freq - 130 != params->center_freq1) | ||
| 2678 | 2601 | return -1; | ||
| 2679 | 2602 | break; | ||
| 2680 | 2603 | case -1: | ||
| 2681 | 2604 | if (params->freq + 130 != params->center_freq1 && | ||
| 2682 | 2605 | params->freq + 90 != params->center_freq1 && | ||
| 2683 | 2606 | params->freq + 50 != params->center_freq1 && | ||
| 2684 | 2607 | params->freq + 10 != params->center_freq1 && | ||
| 2685 | 2608 | params->freq - 30 != params->center_freq1 && | ||
| 2686 | 2609 | params->freq - 70 != params->center_freq1 && | ||
| 2687 | 2610 | params->freq - 110 != params->center_freq1 && | ||
| 2688 | 2611 | params->freq - 150 != params->center_freq1) | ||
| 2689 | 2612 | return -1; | ||
| 2690 | 2613 | break; | ||
| 2691 | 2614 | } | ||
| 2692 | 2615 | break; | ||
| 2693 | 2749 | default: | 2616 | default: |
| 2694 | 2750 | return -1; | 2617 | return -1; |
| 2695 | 2751 | } | 2618 | } |
| 2696 | 2752 | 2619 | ||
| 2697 | 2620 | if (!punct_bitmap) | ||
| 2698 | 2621 | return 0; | ||
| 2699 | 2622 | |||
| 2700 | 2623 | if (!params->eht_enabled) { | ||
| 2701 | 2624 | wpa_printf(MSG_ERROR, | ||
| 2702 | 2625 | "Preamble puncturing supported only in EHT"); | ||
| 2703 | 2626 | return -1; | ||
| 2704 | 2627 | } | ||
| 2705 | 2628 | |||
| 2706 | 2629 | if (params->freq >= 2412 && params->freq <= 2484) { | ||
| 2707 | 2630 | wpa_printf(MSG_ERROR, | ||
| 2708 | 2631 | "Preamble puncturing is not supported in 2.4 GHz"); | ||
| 2709 | 2632 | return -1; | ||
| 2710 | 2633 | } | ||
| 2711 | 2634 | |||
| 2712 | 2635 | start_freq = params->center_freq1 - (params->bandwidth / 2); | ||
| 2713 | 2636 | if (!is_punct_bitmap_valid(params->bandwidth, | ||
| 2714 | 2637 | (params->freq - start_freq) / 20, | ||
| 2715 | 2638 | punct_bitmap)) { | ||
| 2716 | 2639 | wpa_printf(MSG_ERROR, "Invalid preamble puncturing bitmap"); | ||
| 2717 | 2640 | return -1; | ||
| 2718 | 2641 | } | ||
| 2719 | 2642 | |||
| 2720 | 2753 | return 0; | 2643 | return 0; |
| 2721 | 2754 | } | 2644 | } |
| 2722 | 2755 | #endif /* NEED_AP_MLME */ | 2645 | #endif /* NEED_AP_MLME */ |
| 2723 | @@ -2765,12 +2655,21 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, | |||
| 2724 | 2765 | unsigned int i; | 2655 | unsigned int i; |
| 2725 | 2766 | int bandwidth; | 2656 | int bandwidth; |
| 2726 | 2767 | u8 chan; | 2657 | u8 chan; |
| 2727 | 2658 | unsigned int num_err = 0; | ||
| 2728 | 2659 | int err = 0; | ||
| 2729 | 2768 | 2660 | ||
| 2730 | 2769 | ret = hostapd_parse_csa_settings(pos, &settings); | 2661 | ret = hostapd_parse_csa_settings(pos, &settings); |
| 2731 | 2770 | if (ret) | 2662 | if (ret) |
| 2732 | 2771 | return ret; | 2663 | return ret; |
| 2733 | 2772 | 2664 | ||
| 2735 | 2773 | ret = hostapd_ctrl_check_freq_params(&settings.freq_params); | 2665 | settings.link_id = -1; |
| 2736 | 2666 | #ifdef CONFIG_IEEE80211BE | ||
| 2737 | 2667 | if (iface->num_bss && iface->bss[0]->conf->mld_ap) | ||
| 2738 | 2668 | settings.link_id = iface->bss[0]->mld_link_id; | ||
| 2739 | 2669 | #endif /* CONFIG_IEEE80211BE */ | ||
| 2740 | 2670 | |||
| 2741 | 2671 | ret = hostapd_ctrl_check_freq_params(&settings.freq_params, | ||
| 2742 | 2672 | settings.punct_bitmap); | ||
| 2743 | 2774 | if (ret) { | 2673 | if (ret) { |
| 2744 | 2775 | wpa_printf(MSG_INFO, | 2674 | wpa_printf(MSG_INFO, |
| 2745 | 2776 | "chanswitch: invalid frequency settings provided"); | 2675 | "chanswitch: invalid frequency settings provided"); |
| 2746 | @@ -2790,6 +2689,9 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, | |||
| 2747 | 2790 | case 160: | 2689 | case 160: |
| 2748 | 2791 | bandwidth = CHAN_WIDTH_160; | 2690 | bandwidth = CHAN_WIDTH_160; |
| 2749 | 2792 | break; | 2691 | break; |
| 2750 | 2692 | case 320: | ||
| 2751 | 2693 | bandwidth = CHAN_WIDTH_320; | ||
| 2752 | 2694 | break; | ||
| 2753 | 2793 | default: | 2695 | default: |
| 2754 | 2794 | bandwidth = CHAN_WIDTH_20; | 2696 | bandwidth = CHAN_WIDTH_20; |
| 2755 | 2795 | break; | 2697 | break; |
| 2756 | @@ -2828,29 +2730,271 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, | |||
| 2757 | 2828 | settings.freq_params.center_freq1); | 2730 | settings.freq_params.center_freq1); |
| 2758 | 2829 | 2731 | ||
| 2759 | 2830 | /* Perform CAC and switch channel */ | 2732 | /* Perform CAC and switch channel */ |
| 2760 | 2733 | iface->is_ch_switch_dfs = true; | ||
| 2761 | 2831 | hostapd_switch_channel_fallback(iface, &settings.freq_params); | 2734 | hostapd_switch_channel_fallback(iface, &settings.freq_params); |
| 2762 | 2832 | return 0; | 2735 | return 0; |
| 2763 | 2833 | } | 2736 | } |
| 2764 | 2834 | 2737 | ||
| 2765 | 2835 | for (i = 0; i < iface->num_bss; i++) { | 2738 | for (i = 0; i < iface->num_bss; i++) { |
| 2766 | 2836 | 2739 | ||
| 2768 | 2837 | /* Save CHAN_SWITCH VHT and HE config */ | 2740 | /* Save CHAN_SWITCH VHT, HE, and EHT config */ |
| 2769 | 2838 | hostapd_chan_switch_config(iface->bss[i], | 2741 | hostapd_chan_switch_config(iface->bss[i], |
| 2770 | 2839 | &settings.freq_params); | 2742 | &settings.freq_params); |
| 2771 | 2840 | 2743 | ||
| 2777 | 2841 | ret = hostapd_switch_channel(iface->bss[i], &settings); | 2744 | err = hostapd_switch_channel(iface->bss[i], &settings); |
| 2778 | 2842 | if (ret) { | 2745 | if (err) { |
| 2779 | 2843 | /* FIX: What do we do if CSA fails in the middle of | 2746 | ret = err; |
| 2780 | 2844 | * submitting multi-BSS CSA requests? */ | 2747 | num_err++; |
| 2776 | 2845 | return ret; | ||
| 2781 | 2846 | } | 2748 | } |
| 2782 | 2847 | } | 2749 | } |
| 2783 | 2848 | 2750 | ||
| 2784 | 2751 | return (iface->num_bss == num_err) ? ret : 0; | ||
| 2785 | 2752 | #else /* NEED_AP_MLME */ | ||
| 2786 | 2753 | return -1; | ||
| 2787 | 2754 | #endif /* NEED_AP_MLME */ | ||
| 2788 | 2755 | } | ||
| 2789 | 2756 | |||
| 2790 | 2757 | |||
| 2791 | 2758 | #ifdef CONFIG_IEEE80211AX | ||
| 2792 | 2759 | static int hostapd_ctrl_iface_color_change(struct hostapd_iface *iface, | ||
| 2793 | 2760 | const char *pos) | ||
| 2794 | 2761 | { | ||
| 2795 | 2762 | #ifdef NEED_AP_MLME | ||
| 2796 | 2763 | struct cca_settings settings; | ||
| 2797 | 2764 | struct hostapd_data *hapd = iface->bss[0]; | ||
| 2798 | 2765 | int ret, color; | ||
| 2799 | 2766 | unsigned int i; | ||
| 2800 | 2767 | char *end; | ||
| 2801 | 2768 | |||
| 2802 | 2769 | os_memset(&settings, 0, sizeof(settings)); | ||
| 2803 | 2770 | |||
| 2804 | 2771 | color = strtol(pos, &end, 10); | ||
| 2805 | 2772 | if (pos == end || color < 0 || color > 63) { | ||
| 2806 | 2773 | wpa_printf(MSG_ERROR, "color_change: Invalid color provided"); | ||
| 2807 | 2774 | return -1; | ||
| 2808 | 2775 | } | ||
| 2809 | 2776 | |||
| 2810 | 2777 | /* Color value is expected to be [1-63]. If 0 comes, assumption is this | ||
| 2811 | 2778 | * is to disable the color. In this case no need to do CCA, just | ||
| 2812 | 2779 | * changing Beacon frames is sufficient. */ | ||
| 2813 | 2780 | if (color == 0) { | ||
| 2814 | 2781 | if (iface->conf->he_op.he_bss_color_disabled) { | ||
| 2815 | 2782 | wpa_printf(MSG_ERROR, | ||
| 2816 | 2783 | "color_change: Color is already disabled"); | ||
| 2817 | 2784 | return -1; | ||
| 2818 | 2785 | } | ||
| 2819 | 2786 | |||
| 2820 | 2787 | iface->conf->he_op.he_bss_color_disabled = 1; | ||
| 2821 | 2788 | |||
| 2822 | 2789 | for (i = 0; i < iface->num_bss; i++) | ||
| 2823 | 2790 | ieee802_11_set_beacon(iface->bss[i]); | ||
| 2824 | 2791 | |||
| 2825 | 2792 | return 0; | ||
| 2826 | 2793 | } | ||
| 2827 | 2794 | |||
| 2828 | 2795 | if (color == iface->conf->he_op.he_bss_color) { | ||
| 2829 | 2796 | if (!iface->conf->he_op.he_bss_color_disabled) { | ||
| 2830 | 2797 | wpa_printf(MSG_ERROR, | ||
| 2831 | 2798 | "color_change: Provided color is already set"); | ||
| 2832 | 2799 | return -1; | ||
| 2833 | 2800 | } | ||
| 2834 | 2801 | |||
| 2835 | 2802 | iface->conf->he_op.he_bss_color_disabled = 0; | ||
| 2836 | 2803 | |||
| 2837 | 2804 | for (i = 0; i < iface->num_bss; i++) | ||
| 2838 | 2805 | ieee802_11_set_beacon(iface->bss[i]); | ||
| 2839 | 2806 | |||
| 2840 | 2807 | return 0; | ||
| 2841 | 2808 | } | ||
| 2842 | 2809 | |||
| 2843 | 2810 | if (hapd->cca_in_progress) { | ||
| 2844 | 2811 | wpa_printf(MSG_ERROR, | ||
| 2845 | 2812 | "color_change: CCA is already in progress"); | ||
| 2846 | 2813 | return -1; | ||
| 2847 | 2814 | } | ||
| 2848 | 2815 | |||
| 2849 | 2816 | iface->conf->he_op.he_bss_color_disabled = 0; | ||
| 2850 | 2817 | |||
| 2851 | 2818 | for (i = 0; i < iface->num_bss; i++) { | ||
| 2852 | 2819 | struct hostapd_data *bss = iface->bss[i]; | ||
| 2853 | 2820 | |||
| 2854 | 2821 | hostapd_cleanup_cca_params(bss); | ||
| 2855 | 2822 | |||
| 2856 | 2823 | bss->cca_color = color; | ||
| 2857 | 2824 | bss->cca_count = 10; | ||
| 2858 | 2825 | |||
| 2859 | 2826 | if (hostapd_fill_cca_settings(bss, &settings)) { | ||
| 2860 | 2827 | wpa_printf(MSG_DEBUG, | ||
| 2861 | 2828 | "color_change: Filling CCA settings failed for color: %d\n", | ||
| 2862 | 2829 | color); | ||
| 2863 | 2830 | hostapd_cleanup_cca_params(bss); | ||
| 2864 | 2831 | continue; | ||
| 2865 | 2832 | } | ||
| 2866 | 2833 | |||
| 2867 | 2834 | wpa_printf(MSG_DEBUG, "Setting user selected color: %d", color); | ||
| 2868 | 2835 | ret = hostapd_drv_switch_color(bss, &settings); | ||
| 2869 | 2836 | if (ret) | ||
| 2870 | 2837 | hostapd_cleanup_cca_params(bss); | ||
| 2871 | 2838 | |||
| 2872 | 2839 | free_beacon_data(&settings.beacon_cca); | ||
| 2873 | 2840 | free_beacon_data(&settings.beacon_after); | ||
| 2874 | 2841 | } | ||
| 2875 | 2842 | |||
| 2876 | 2849 | return 0; | 2843 | return 0; |
| 2877 | 2850 | #else /* NEED_AP_MLME */ | 2844 | #else /* NEED_AP_MLME */ |
| 2878 | 2851 | return -1; | 2845 | return -1; |
| 2879 | 2852 | #endif /* NEED_AP_MLME */ | 2846 | #endif /* NEED_AP_MLME */ |
| 2880 | 2853 | } | 2847 | } |
| 2881 | 2848 | #endif /* CONFIG_IEEE80211AX */ | ||
| 2882 | 2849 | |||
| 2883 | 2850 | |||
| 2884 | 2851 | static u8 hostapd_maxnss(struct hostapd_data *hapd, struct sta_info *sta) | ||
| 2885 | 2852 | { | ||
| 2886 | 2853 | u8 *mcs_set = NULL; | ||
| 2887 | 2854 | u16 mcs_map; | ||
| 2888 | 2855 | u8 ht_rx_nss = 0; | ||
| 2889 | 2856 | u8 vht_rx_nss = 1; | ||
| 2890 | 2857 | u8 mcs; | ||
| 2891 | 2858 | bool ht_supported = false; | ||
| 2892 | 2859 | bool vht_supported = false; | ||
| 2893 | 2860 | int i; | ||
| 2894 | 2861 | |||
| 2895 | 2862 | if (sta->ht_capabilities && (sta->flags & WLAN_STA_HT)) { | ||
| 2896 | 2863 | mcs_set = sta->ht_capabilities->supported_mcs_set; | ||
| 2897 | 2864 | ht_supported = true; | ||
| 2898 | 2865 | } | ||
| 2899 | 2866 | |||
| 2900 | 2867 | if (sta->vht_capabilities && (sta->flags & WLAN_STA_VHT)) { | ||
| 2901 | 2868 | mcs_map = le_to_host16( | ||
| 2902 | 2869 | sta->vht_capabilities->vht_supported_mcs_set.rx_map); | ||
| 2903 | 2870 | vht_supported = true; | ||
| 2904 | 2871 | } | ||
| 2905 | 2872 | |||
| 2906 | 2873 | if (ht_supported && mcs_set) { | ||
| 2907 | 2874 | if (mcs_set[0]) | ||
| 2908 | 2875 | ht_rx_nss++; | ||
| 2909 | 2876 | if (mcs_set[1]) | ||
| 2910 | 2877 | ht_rx_nss++; | ||
| 2911 | 2878 | if (mcs_set[2]) | ||
| 2912 | 2879 | ht_rx_nss++; | ||
| 2913 | 2880 | if (mcs_set[3]) | ||
| 2914 | 2881 | ht_rx_nss++; | ||
| 2915 | 2882 | } | ||
| 2916 | 2883 | if (vht_supported) { | ||
| 2917 | 2884 | for (i = 7; i >= 0; i--) { | ||
| 2918 | 2885 | mcs = (mcs_map >> (2 * i)) & 0x03; | ||
| 2919 | 2886 | if (mcs != 0x03) { | ||
| 2920 | 2887 | vht_rx_nss = i + 1; | ||
| 2921 | 2888 | break; | ||
| 2922 | 2889 | } | ||
| 2923 | 2890 | } | ||
| 2924 | 2891 | } | ||
| 2925 | 2892 | |||
| 2926 | 2893 | return ht_rx_nss > vht_rx_nss ? ht_rx_nss : vht_rx_nss; | ||
| 2927 | 2894 | } | ||
| 2928 | 2895 | |||
| 2929 | 2896 | |||
| 2930 | 2897 | static char hostapd_ctrl_iface_notify_cw_htaction(struct hostapd_data *hapd, | ||
| 2931 | 2898 | const u8 *addr, u8 width) | ||
| 2932 | 2899 | { | ||
| 2933 | 2900 | u8 buf[3]; | ||
| 2934 | 2901 | char ret; | ||
| 2935 | 2902 | |||
| 2936 | 2903 | width = width >= 1 ? 1 : 0; | ||
| 2937 | 2904 | |||
| 2938 | 2905 | buf[0] = WLAN_ACTION_HT; | ||
| 2939 | 2906 | buf[1] = WLAN_HT_ACTION_NOTIFY_CHANWIDTH; | ||
| 2940 | 2907 | buf[2] = width; | ||
| 2941 | 2908 | |||
| 2942 | 2909 | ret = hostapd_drv_send_action(hapd, hapd->iface->freq, 0, addr, | ||
| 2943 | 2910 | buf, sizeof(buf)); | ||
| 2944 | 2911 | if (ret) | ||
| 2945 | 2912 | wpa_printf(MSG_DEBUG, | ||
| 2946 | 2913 | "Failed to send Notify Channel Width frame to " | ||
| 2947 | 2914 | MACSTR, MAC2STR(addr)); | ||
| 2948 | 2915 | |||
| 2949 | 2916 | return ret; | ||
| 2950 | 2917 | } | ||
| 2951 | 2918 | |||
| 2952 | 2919 | |||
| 2953 | 2920 | static char hostapd_ctrl_iface_notify_cw_vhtaction(struct hostapd_data *hapd, | ||
| 2954 | 2921 | const u8 *addr, u8 width) | ||
| 2955 | 2922 | { | ||
| 2956 | 2923 | u8 buf[3]; | ||
| 2957 | 2924 | char ret; | ||
| 2958 | 2925 | |||
| 2959 | 2926 | buf[0] = WLAN_ACTION_VHT; | ||
| 2960 | 2927 | buf[1] = WLAN_VHT_ACTION_OPMODE_NOTIF; | ||
| 2961 | 2928 | buf[2] = width; | ||
| 2962 | 2929 | |||
| 2963 | 2930 | ret = hostapd_drv_send_action(hapd, hapd->iface->freq, 0, addr, | ||
| 2964 | 2931 | buf, sizeof(buf)); | ||
| 2965 | 2932 | if (ret) | ||
| 2966 | 2933 | wpa_printf(MSG_DEBUG, | ||
| 2967 | 2934 | "Failed to send Opeating Mode Notification frame to " | ||
| 2968 | 2935 | MACSTR, MAC2STR(addr)); | ||
| 2969 | 2936 | |||
| 2970 | 2937 | return ret; | ||
| 2971 | 2938 | } | ||
| 2972 | 2939 | |||
| 2973 | 2940 | |||
| 2974 | 2941 | static char hostapd_ctrl_iface_notify_cw_change(struct hostapd_data *hapd, | ||
| 2975 | 2942 | const char *cmd) | ||
| 2976 | 2943 | { | ||
| 2977 | 2944 | u8 cw, operating_mode = 0, nss; | ||
| 2978 | 2945 | struct sta_info *sta; | ||
| 2979 | 2946 | enum hostapd_hw_mode hw_mode; | ||
| 2980 | 2947 | |||
| 2981 | 2948 | if (is_6ghz_freq(hapd->iface->freq)) { | ||
| 2982 | 2949 | wpa_printf(MSG_ERROR, "20/40 BSS coex not supported in 6 GHz"); | ||
| 2983 | 2950 | return -1; | ||
| 2984 | 2951 | } | ||
| 2985 | 2952 | |||
| 2986 | 2953 | cw = atoi(cmd); | ||
| 2987 | 2954 | hw_mode = hapd->iface->current_mode->mode; | ||
| 2988 | 2955 | if ((hw_mode == HOSTAPD_MODE_IEEE80211G || | ||
| 2989 | 2956 | hw_mode == HOSTAPD_MODE_IEEE80211B) && | ||
| 2990 | 2957 | !(cw == 0 || cw == 1)) { | ||
| 2991 | 2958 | wpa_printf(MSG_ERROR, | ||
| 2992 | 2959 | "Channel width should be either 20 MHz or 40 MHz for 2.4 GHz band"); | ||
| 2993 | 2960 | return -1; | ||
| 2994 | 2961 | } | ||
| 2995 | 2962 | |||
| 2996 | 2963 | switch (cw) { | ||
| 2997 | 2964 | case 0: | ||
| 2998 | 2965 | operating_mode = 0; | ||
| 2999 | 2966 | break; | ||
| 3000 | 2967 | case 1: | ||
| 3001 | 2968 | operating_mode = VHT_OPMODE_CHANNEL_40MHZ; | ||
| 3002 | 2969 | break; | ||
| 3003 | 2970 | case 2: | ||
| 3004 | 2971 | operating_mode = VHT_OPMODE_CHANNEL_80MHZ; | ||
| 3005 | 2972 | break; | ||
| 3006 | 2973 | case 3: | ||
| 3007 | 2974 | operating_mode = VHT_OPMODE_CHANNEL_160MHZ; | ||
| 3008 | 2975 | break; | ||
| 3009 | 2976 | default: | ||
| 3010 | 2977 | wpa_printf(MSG_ERROR, "Channel width should be between 0 to 3"); | ||
| 3011 | 2978 | return -1; | ||
| 3012 | 2979 | } | ||
| 3013 | 2980 | |||
| 3014 | 2981 | for (sta = hapd->sta_list; sta; sta = sta->next) { | ||
| 3015 | 2982 | if ((sta->flags & WLAN_STA_VHT) && sta->vht_capabilities) { | ||
| 3016 | 2983 | nss = hostapd_maxnss(hapd, sta) - 1; | ||
| 3017 | 2984 | hostapd_ctrl_iface_notify_cw_vhtaction(hapd, sta->addr, | ||
| 3018 | 2985 | operating_mode | | ||
| 3019 | 2986 | (u8) (nss << 4)); | ||
| 3020 | 2987 | continue; | ||
| 3021 | 2988 | } | ||
| 3022 | 2989 | |||
| 3023 | 2990 | if ((sta->flags & (WLAN_STA_HT | WLAN_STA_VHT)) == | ||
| 3024 | 2991 | WLAN_STA_HT && sta->ht_capabilities) | ||
| 3025 | 2992 | hostapd_ctrl_iface_notify_cw_htaction(hapd, sta->addr, | ||
| 3026 | 2993 | cw); | ||
| 3027 | 2994 | } | ||
| 3028 | 2995 | |||
| 3029 | 2996 | return 0; | ||
| 3030 | 2997 | } | ||
| 3031 | 2854 | 2998 | ||
| 3032 | 2855 | 2999 | ||
| 3033 | 2856 | static int hostapd_ctrl_iface_mib(struct hostapd_data *hapd, char *reply, | 3000 | static int hostapd_ctrl_iface_mib(struct hostapd_data *hapd, char *reply, |
| 3034 | @@ -3171,6 +3315,26 @@ static int hostapd_ctrl_iface_req_beacon(struct hostapd_data *hapd, | |||
| 3035 | 3171 | } | 3315 | } |
| 3036 | 3172 | 3316 | ||
| 3037 | 3173 | 3317 | ||
| 3038 | 3318 | static int hostapd_ctrl_iface_req_link_measurement(struct hostapd_data *hapd, | ||
| 3039 | 3319 | const char *cmd, char *reply, | ||
| 3040 | 3320 | size_t reply_size) | ||
| 3041 | 3321 | { | ||
| 3042 | 3322 | u8 addr[ETH_ALEN]; | ||
| 3043 | 3323 | int ret; | ||
| 3044 | 3324 | |||
| 3045 | 3325 | if (hwaddr_aton(cmd, addr)) { | ||
| 3046 | 3326 | wpa_printf(MSG_ERROR, | ||
| 3047 | 3327 | "CTRL: REQ_LINK_MEASUREMENT: Invalid MAC address"); | ||
| 3048 | 3328 | return -1; | ||
| 3049 | 3329 | } | ||
| 3050 | 3330 | |||
| 3051 | 3331 | ret = hostapd_send_link_measurement_req(hapd, addr); | ||
| 3052 | 3332 | if (ret >= 0) | ||
| 3053 | 3333 | ret = os_snprintf(reply, reply_size, "%d", ret); | ||
| 3054 | 3334 | return ret; | ||
| 3055 | 3335 | } | ||
| 3056 | 3336 | |||
| 3057 | 3337 | |||
| 3058 | 3174 | static int hostapd_ctrl_iface_show_neighbor(struct hostapd_data *hapd, | 3338 | static int hostapd_ctrl_iface_show_neighbor(struct hostapd_data *hapd, |
| 3059 | 3175 | char *buf, size_t buflen) | 3339 | char *buf, size_t buflen) |
| 3060 | 3176 | { | 3340 | { |
| 3061 | @@ -3379,80 +3543,6 @@ static int hostapd_ctrl_driver_flags2(struct hostapd_iface *iface, char *buf, | |||
| 3062 | 3379 | } | 3543 | } |
| 3063 | 3380 | 3544 | ||
| 3064 | 3381 | 3545 | ||
| 3065 | 3382 | static int hostapd_ctrl_iface_acl_del_mac(struct mac_acl_entry **acl, int *num, | ||
| 3066 | 3383 | const char *txtaddr) | ||
| 3067 | 3384 | { | ||
| 3068 | 3385 | u8 addr[ETH_ALEN]; | ||
| 3069 | 3386 | struct vlan_description vlan_id; | ||
| 3070 | 3387 | |||
| 3071 | 3388 | if (!(*num)) | ||
| 3072 | 3389 | return 0; | ||
| 3073 | 3390 | |||
| 3074 | 3391 | if (hwaddr_aton(txtaddr, addr)) | ||
| 3075 | 3392 | return -1; | ||
| 3076 | 3393 | |||
| 3077 | 3394 | if (hostapd_maclist_found(*acl, *num, addr, &vlan_id)) | ||
| 3078 | 3395 | hostapd_remove_acl_mac(acl, num, addr); | ||
| 3079 | 3396 | |||
| 3080 | 3397 | return 0; | ||
| 3081 | 3398 | } | ||
| 3082 | 3399 | |||
| 3083 | 3400 | |||
| 3084 | 3401 | static void hostapd_ctrl_iface_acl_clear_list(struct mac_acl_entry **acl, | ||
| 3085 | 3402 | int *num) | ||
| 3086 | 3403 | { | ||
| 3087 | 3404 | while (*num) | ||
| 3088 | 3405 | hostapd_remove_acl_mac(acl, num, (*acl)[0].addr); | ||
| 3089 | 3406 | } | ||
| 3090 | 3407 | |||
| 3091 | 3408 | |||
| 3092 | 3409 | static int hostapd_ctrl_iface_acl_show_mac(struct mac_acl_entry *acl, int num, | ||
| 3093 | 3410 | char *buf, size_t buflen) | ||
| 3094 | 3411 | { | ||
| 3095 | 3412 | int i = 0, len = 0, ret = 0; | ||
| 3096 | 3413 | |||
| 3097 | 3414 | if (!acl) | ||
| 3098 | 3415 | return 0; | ||
| 3099 | 3416 | |||
| 3100 | 3417 | while (i < num) { | ||
| 3101 | 3418 | ret = os_snprintf(buf + len, buflen - len, | ||
| 3102 | 3419 | MACSTR " VLAN_ID=%d\n", | ||
| 3103 | 3420 | MAC2STR(acl[i].addr), | ||
| 3104 | 3421 | acl[i].vlan_id.untagged); | ||
| 3105 | 3422 | if (ret < 0 || (size_t) ret >= buflen - len) | ||
| 3106 | 3423 | return len; | ||
| 3107 | 3424 | i++; | ||
| 3108 | 3425 | len += ret; | ||
| 3109 | 3426 | } | ||
| 3110 | 3427 | return len; | ||
| 3111 | 3428 | } | ||
| 3112 | 3429 | |||
| 3113 | 3430 | |||
| 3114 | 3431 | static int hostapd_ctrl_iface_acl_add_mac(struct mac_acl_entry **acl, int *num, | ||
| 3115 | 3432 | const char *cmd) | ||
| 3116 | 3433 | { | ||
| 3117 | 3434 | u8 addr[ETH_ALEN]; | ||
| 3118 | 3435 | struct vlan_description vlan_id; | ||
| 3119 | 3436 | int ret = 0, vlanid = 0; | ||
| 3120 | 3437 | const char *pos; | ||
| 3121 | 3438 | |||
| 3122 | 3439 | if (hwaddr_aton(cmd, addr)) | ||
| 3123 | 3440 | return -1; | ||
| 3124 | 3441 | |||
| 3125 | 3442 | pos = os_strstr(cmd, "VLAN_ID="); | ||
| 3126 | 3443 | if (pos) | ||
| 3127 | 3444 | vlanid = atoi(pos + 8); | ||
| 3128 | 3445 | |||
| 3129 | 3446 | if (!hostapd_maclist_found(*acl, *num, addr, &vlan_id)) { | ||
| 3130 | 3447 | ret = hostapd_add_acl_maclist(acl, num, vlanid, addr); | ||
| 3131 | 3448 | if (ret != -1 && *acl) | ||
| 3132 | 3449 | qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); | ||
| 3133 | 3450 | } | ||
| 3134 | 3451 | |||
| 3135 | 3452 | return ret < 0 ? -1 : 0; | ||
| 3136 | 3453 | } | ||
| 3137 | 3454 | |||
| 3138 | 3455 | |||
| 3139 | 3456 | static int hostapd_ctrl_iface_get_capability(struct hostapd_data *hapd, | 3546 | static int hostapd_ctrl_iface_get_capability(struct hostapd_data *hapd, |
| 3140 | 3457 | const char *field, char *buf, | 3547 | const char *field, char *buf, |
| 3141 | 3458 | size_t buflen) | 3548 | size_t buflen) |
| 3142 | @@ -3500,6 +3590,395 @@ static int hostapd_ctrl_iface_driver_cmd(struct hostapd_data *hapd, char *cmd, | |||
| 3143 | 3500 | #endif /* ANDROID */ | 3590 | #endif /* ANDROID */ |
| 3144 | 3501 | 3591 | ||
| 3145 | 3502 | 3592 | ||
| 3146 | 3593 | #ifdef CONFIG_IEEE80211BE | ||
| 3147 | 3594 | |||
| 3148 | 3595 | static int hostapd_ctrl_iface_enable_mld(struct hostapd_iface *iface) | ||
| 3149 | 3596 | { | ||
| 3150 | 3597 | unsigned int i; | ||
| 3151 | 3598 | |||
| 3152 | 3599 | if (!iface || !iface->bss[0]->conf->mld_ap) { | ||
| 3153 | 3600 | wpa_printf(MSG_ERROR, | ||
| 3154 | 3601 | "Trying to enable AP MLD on an interface that is not affiliated with an AP MLD"); | ||
| 3155 | 3602 | return -1; | ||
| 3156 | 3603 | } | ||
| 3157 | 3604 | |||
| 3158 | 3605 | for (i = 0; i < iface->interfaces->count; ++i) { | ||
| 3159 | 3606 | struct hostapd_iface *h_iface = iface->interfaces->iface[i]; | ||
| 3160 | 3607 | struct hostapd_data *h_hapd = h_iface->bss[0]; | ||
| 3161 | 3608 | |||
| 3162 | 3609 | if (!hostapd_is_ml_partner(h_hapd, iface->bss[0])) | ||
| 3163 | 3610 | continue; | ||
| 3164 | 3611 | |||
| 3165 | 3612 | if (hostapd_enable_iface(h_iface)) { | ||
| 3166 | 3613 | wpa_printf(MSG_ERROR, "Enabling of AP MLD failed"); | ||
| 3167 | 3614 | return -1; | ||
| 3168 | 3615 | } | ||
| 3169 | 3616 | } | ||
| 3170 | 3617 | return 0; | ||
| 3171 | 3618 | } | ||
| 3172 | 3619 | |||
| 3173 | 3620 | |||
| 3174 | 3621 | static void hostapd_disable_iface_bss(struct hostapd_iface *iface) | ||
| 3175 | 3622 | { | ||
| 3176 | 3623 | unsigned int i; | ||
| 3177 | 3624 | |||
| 3178 | 3625 | for (i = 0; i < iface->num_bss; i++) | ||
| 3179 | 3626 | hostapd_bss_deinit_no_free(iface->bss[i]); | ||
| 3180 | 3627 | } | ||
| 3181 | 3628 | |||
| 3182 | 3629 | |||
| 3183 | 3630 | static int hostapd_ctrl_iface_disable_mld(struct hostapd_iface *iface) | ||
| 3184 | 3631 | { | ||
| 3185 | 3632 | unsigned int i; | ||
| 3186 | 3633 | |||
| 3187 | 3634 | if (!iface || !iface->bss[0]->conf->mld_ap) { | ||
| 3188 | 3635 | wpa_printf(MSG_ERROR, | ||
| 3189 | 3636 | "Trying to disable AP MLD on an interface that is not affiliated with an AP MLD."); | ||
| 3190 | 3637 | return -1; | ||
| 3191 | 3638 | } | ||
| 3192 | 3639 | |||
| 3193 | 3640 | /* First, disable BSSs before stopping beaconing and doing driver | ||
| 3194 | 3641 | * deinit so that the broadcast Deauthentication frames go out. */ | ||
| 3195 | 3642 | |||
| 3196 | 3643 | for (i = 0; i < iface->interfaces->count; ++i) { | ||
| 3197 | 3644 | struct hostapd_iface *h_iface = iface->interfaces->iface[i]; | ||
| 3198 | 3645 | struct hostapd_data *h_hapd = h_iface->bss[0]; | ||
| 3199 | 3646 | |||
| 3200 | 3647 | if (!hostapd_is_ml_partner(h_hapd, iface->bss[0])) | ||
| 3201 | 3648 | continue; | ||
| 3202 | 3649 | |||
| 3203 | 3650 | hostapd_disable_iface_bss(iface); | ||
| 3204 | 3651 | } | ||
| 3205 | 3652 | |||
| 3206 | 3653 | /* Then, fully disable interfaces */ | ||
| 3207 | 3654 | for (i = 0; i < iface->interfaces->count; ++i) { | ||
| 3208 | 3655 | struct hostapd_iface *h_iface = iface->interfaces->iface[i]; | ||
| 3209 | 3656 | struct hostapd_data *h_hapd = h_iface->bss[0]; | ||
| 3210 | 3657 | |||
| 3211 | 3658 | if (!hostapd_is_ml_partner(h_hapd, iface->bss[0])) | ||
| 3212 | 3659 | continue; | ||
| 3213 | 3660 | |||
| 3214 | 3661 | if (hostapd_disable_iface(h_iface)) { | ||
| 3215 | 3662 | wpa_printf(MSG_ERROR, "Disabling AP MLD failed"); | ||
| 3216 | 3663 | return -1; | ||
| 3217 | 3664 | } | ||
| 3218 | 3665 | } | ||
| 3219 | 3666 | |||
| 3220 | 3667 | return 0; | ||
| 3221 | 3668 | } | ||
| 3222 | 3669 | |||
| 3223 | 3670 | |||
| 3224 | 3671 | #ifdef CONFIG_TESTING_OPTIONS | ||
| 3225 | 3672 | static int hostapd_ctrl_iface_link_remove(struct hostapd_data *hapd, char *cmd, | ||
| 3226 | 3673 | char *buf, size_t buflen) | ||
| 3227 | 3674 | { | ||
| 3228 | 3675 | int ret; | ||
| 3229 | 3676 | u32 count = atoi(cmd); | ||
| 3230 | 3677 | |||
| 3231 | 3678 | if (!count) | ||
| 3232 | 3679 | count = 1; | ||
| 3233 | 3680 | |||
| 3234 | 3681 | ret = hostapd_link_remove(hapd, count); | ||
| 3235 | 3682 | if (ret == 0) { | ||
| 3236 | 3683 | ret = os_snprintf(buf, buflen, "%s\n", "OK"); | ||
| 3237 | 3684 | if (os_snprintf_error(buflen, ret)) | ||
| 3238 | 3685 | ret = -1; | ||
| 3239 | 3686 | else | ||
| 3240 | 3687 | ret = 0; | ||
| 3241 | 3688 | } | ||
| 3242 | 3689 | |||
| 3243 | 3690 | return ret; | ||
| 3244 | 3691 | } | ||
| 3245 | 3692 | #endif /* CONFIG_TESTING_OPTIONS */ | ||
| 3246 | 3693 | #endif /* CONFIG_IEEE80211BE */ | ||
| 3247 | 3694 | |||
| 3248 | 3695 | |||
| 3249 | 3696 | #ifdef CONFIG_NAN_USD | ||
| 3250 | 3697 | |||
| 3251 | 3698 | static int hostapd_ctrl_nan_publish(struct hostapd_data *hapd, char *cmd, | ||
| 3252 | 3699 | char *buf, size_t buflen) | ||
| 3253 | 3700 | { | ||
| 3254 | 3701 | char *token, *context = NULL; | ||
| 3255 | 3702 | int publish_id; | ||
| 3256 | 3703 | struct nan_publish_params params; | ||
| 3257 | 3704 | const char *service_name = NULL; | ||
| 3258 | 3705 | struct wpabuf *ssi = NULL; | ||
| 3259 | 3706 | int ret = -1; | ||
| 3260 | 3707 | enum nan_service_protocol_type srv_proto_type = 0; | ||
| 3261 | 3708 | |||
| 3262 | 3709 | os_memset(¶ms, 0, sizeof(params)); | ||
| 3263 | 3710 | /* USD shall use both solicited and unsolicited transmissions */ | ||
| 3264 | 3711 | params.unsolicited = true; | ||
| 3265 | 3712 | params.solicited = true; | ||
| 3266 | 3713 | /* USD shall require FSD without GAS */ | ||
| 3267 | 3714 | params.fsd = true; | ||
| 3268 | 3715 | |||
| 3269 | 3716 | while ((token = str_token(cmd, " ", &context))) { | ||
| 3270 | 3717 | if (os_strncmp(token, "service_name=", 13) == 0) { | ||
| 3271 | 3718 | service_name = token + 13; | ||
| 3272 | 3719 | continue; | ||
| 3273 | 3720 | } | ||
| 3274 | 3721 | |||
| 3275 | 3722 | if (os_strncmp(token, "ttl=", 4) == 0) { | ||
| 3276 | 3723 | params.ttl = atoi(token + 4); | ||
| 3277 | 3724 | continue; | ||
| 3278 | 3725 | } | ||
| 3279 | 3726 | |||
| 3280 | 3727 | if (os_strncmp(token, "srv_proto_type=", 15) == 0) { | ||
| 3281 | 3728 | srv_proto_type = atoi(token + 15); | ||
| 3282 | 3729 | continue; | ||
| 3283 | 3730 | } | ||
| 3284 | 3731 | |||
| 3285 | 3732 | if (os_strncmp(token, "ssi=", 4) == 0) { | ||
| 3286 | 3733 | if (ssi) | ||
| 3287 | 3734 | goto fail; | ||
| 3288 | 3735 | ssi = wpabuf_parse_bin(token + 4); | ||
| 3289 | 3736 | if (!ssi) | ||
| 3290 | 3737 | goto fail; | ||
| 3291 | 3738 | continue; | ||
| 3292 | 3739 | } | ||
| 3293 | 3740 | |||
| 3294 | 3741 | if (os_strcmp(token, "solicited=0") == 0) { | ||
| 3295 | 3742 | params.solicited = false; | ||
| 3296 | 3743 | continue; | ||
| 3297 | 3744 | } | ||
| 3298 | 3745 | |||
| 3299 | 3746 | if (os_strcmp(token, "unsolicited=0") == 0) { | ||
| 3300 | 3747 | params.unsolicited = false; | ||
| 3301 | 3748 | continue; | ||
| 3302 | 3749 | } | ||
| 3303 | 3750 | |||
| 3304 | 3751 | if (os_strcmp(token, "fsd=0") == 0) { | ||
| 3305 | 3752 | params.fsd = false; | ||
| 3306 | 3753 | continue; | ||
| 3307 | 3754 | } | ||
| 3308 | 3755 | |||
| 3309 | 3756 | wpa_printf(MSG_INFO, "CTRL: Invalid NAN_PUBLISH parameter: %s", | ||
| 3310 | 3757 | token); | ||
| 3311 | 3758 | goto fail; | ||
| 3312 | 3759 | } | ||
| 3313 | 3760 | |||
| 3314 | 3761 | publish_id = hostapd_nan_usd_publish(hapd, service_name, srv_proto_type, | ||
| 3315 | 3762 | ssi, ¶ms); | ||
| 3316 | 3763 | if (publish_id > 0) | ||
| 3317 | 3764 | ret = os_snprintf(buf, buflen, "%d", publish_id); | ||
| 3318 | 3765 | fail: | ||
| 3319 | 3766 | wpabuf_free(ssi); | ||
| 3320 | 3767 | return ret; | ||
| 3321 | 3768 | } | ||
| 3322 | 3769 | |||
| 3323 | 3770 | |||
| 3324 | 3771 | static int hostapd_ctrl_nan_cancel_publish(struct hostapd_data *hapd, | ||
| 3325 | 3772 | char *cmd) | ||
| 3326 | 3773 | { | ||
| 3327 | 3774 | char *token, *context = NULL; | ||
| 3328 | 3775 | int publish_id = 0; | ||
| 3329 | 3776 | |||
| 3330 | 3777 | while ((token = str_token(cmd, " ", &context))) { | ||
| 3331 | 3778 | if (sscanf(token, "publish_id=%i", &publish_id) == 1) | ||
| 3332 | 3779 | continue; | ||
| 3333 | 3780 | wpa_printf(MSG_INFO, | ||
| 3334 | 3781 | "CTRL: Invalid NAN_CANCEL_PUBLISH parameter: %s", | ||
| 3335 | 3782 | token); | ||
| 3336 | 3783 | return -1; | ||
| 3337 | 3784 | } | ||
| 3338 | 3785 | |||
| 3339 | 3786 | if (publish_id <= 0) { | ||
| 3340 | 3787 | wpa_printf(MSG_INFO, | ||
| 3341 | 3788 | "CTRL: Invalid or missing NAN_CANCEL_PUBLISH publish_id"); | ||
| 3342 | 3789 | return -1; | ||
| 3343 | 3790 | } | ||
| 3344 | 3791 | |||
| 3345 | 3792 | hostapd_nan_usd_cancel_publish(hapd, publish_id); | ||
| 3346 | 3793 | return 0; | ||
| 3347 | 3794 | } | ||
| 3348 | 3795 | |||
| 3349 | 3796 | |||
| 3350 | 3797 | static int hostapd_ctrl_nan_update_publish(struct hostapd_data *hapd, | ||
| 3351 | 3798 | char *cmd) | ||
| 3352 | 3799 | { | ||
| 3353 | 3800 | char *token, *context = NULL; | ||
| 3354 | 3801 | int publish_id = 0; | ||
| 3355 | 3802 | struct wpabuf *ssi = NULL; | ||
| 3356 | 3803 | int ret = -1; | ||
| 3357 | 3804 | |||
| 3358 | 3805 | while ((token = str_token(cmd, " ", &context))) { | ||
| 3359 | 3806 | if (sscanf(token, "publish_id=%i", &publish_id) == 1) | ||
| 3360 | 3807 | continue; | ||
| 3361 | 3808 | if (os_strncmp(token, "ssi=", 4) == 0) { | ||
| 3362 | 3809 | if (ssi) | ||
| 3363 | 3810 | goto fail; | ||
| 3364 | 3811 | ssi = wpabuf_parse_bin(token + 4); | ||
| 3365 | 3812 | if (!ssi) | ||
| 3366 | 3813 | goto fail; | ||
| 3367 | 3814 | continue; | ||
| 3368 | 3815 | } | ||
| 3369 | 3816 | wpa_printf(MSG_INFO, | ||
| 3370 | 3817 | "CTRL: Invalid NAN_UPDATE_PUBLISH parameter: %s", | ||
| 3371 | 3818 | token); | ||
| 3372 | 3819 | goto fail; | ||
| 3373 | 3820 | } | ||
| 3374 | 3821 | |||
| 3375 | 3822 | if (publish_id <= 0) { | ||
| 3376 | 3823 | wpa_printf(MSG_INFO, | ||
| 3377 | 3824 | "CTRL: Invalid or missing NAN_UPDATE_PUBLISH publish_id"); | ||
| 3378 | 3825 | goto fail; | ||
| 3379 | 3826 | } | ||
| 3380 | 3827 | |||
| 3381 | 3828 | ret = hostapd_nan_usd_update_publish(hapd, publish_id, ssi); | ||
| 3382 | 3829 | fail: | ||
| 3383 | 3830 | wpabuf_free(ssi); | ||
| 3384 | 3831 | return ret; | ||
| 3385 | 3832 | } | ||
| 3386 | 3833 | |||
| 3387 | 3834 | |||
| 3388 | 3835 | static int hostapd_ctrl_nan_subscribe(struct hostapd_data *hapd, char *cmd, | ||
| 3389 | 3836 | char *buf, size_t buflen) | ||
| 3390 | 3837 | { | ||
| 3391 | 3838 | char *token, *context = NULL; | ||
| 3392 | 3839 | int subscribe_id; | ||
| 3393 | 3840 | struct nan_subscribe_params params; | ||
| 3394 | 3841 | const char *service_name = NULL; | ||
| 3395 | 3842 | struct wpabuf *ssi = NULL; | ||
| 3396 | 3843 | int ret = -1; | ||
| 3397 | 3844 | enum nan_service_protocol_type srv_proto_type = 0; | ||
| 3398 | 3845 | |||
| 3399 | 3846 | os_memset(¶ms, 0, sizeof(params)); | ||
| 3400 | 3847 | |||
| 3401 | 3848 | while ((token = str_token(cmd, " ", &context))) { | ||
| 3402 | 3849 | if (os_strncmp(token, "service_name=", 13) == 0) { | ||
| 3403 | 3850 | service_name = token + 13; | ||
| 3404 | 3851 | continue; | ||
| 3405 | 3852 | } | ||
| 3406 | 3853 | |||
| 3407 | 3854 | if (os_strcmp(token, "active=1") == 0) { | ||
| 3408 | 3855 | params.active = true; | ||
| 3409 | 3856 | continue; | ||
| 3410 | 3857 | } | ||
| 3411 | 3858 | |||
| 3412 | 3859 | if (os_strncmp(token, "ttl=", 4) == 0) { | ||
| 3413 | 3860 | params.ttl = atoi(token + 4); | ||
| 3414 | 3861 | continue; | ||
| 3415 | 3862 | } | ||
| 3416 | 3863 | |||
| 3417 | 3864 | if (os_strncmp(token, "srv_proto_type=", 15) == 0) { | ||
| 3418 | 3865 | srv_proto_type = atoi(token + 15); | ||
| 3419 | 3866 | continue; | ||
| 3420 | 3867 | } | ||
| 3421 | 3868 | |||
| 3422 | 3869 | if (os_strncmp(token, "ssi=", 4) == 0) { | ||
| 3423 | 3870 | if (ssi) | ||
| 3424 | 3871 | goto fail; | ||
| 3425 | 3872 | ssi = wpabuf_parse_bin(token + 4); | ||
| 3426 | 3873 | if (!ssi) | ||
| 3427 | 3874 | goto fail; | ||
| 3428 | 3875 | continue; | ||
| 3429 | 3876 | } | ||
| 3430 | 3877 | |||
| 3431 | 3878 | wpa_printf(MSG_INFO, | ||
| 3432 | 3879 | "CTRL: Invalid NAN_SUBSCRIBE parameter: %s", | ||
| 3433 | 3880 | token); | ||
| 3434 | 3881 | goto fail; | ||
| 3435 | 3882 | } | ||
| 3436 | 3883 | |||
| 3437 | 3884 | subscribe_id = hostapd_nan_usd_subscribe(hapd, service_name, | ||
| 3438 | 3885 | srv_proto_type, ssi, | ||
| 3439 | 3886 | ¶ms); | ||
| 3440 | 3887 | if (subscribe_id > 0) | ||
| 3441 | 3888 | ret = os_snprintf(buf, buflen, "%d", subscribe_id); | ||
| 3442 | 3889 | fail: | ||
| 3443 | 3890 | wpabuf_free(ssi); | ||
| 3444 | 3891 | return ret; | ||
| 3445 | 3892 | } | ||
| 3446 | 3893 | |||
| 3447 | 3894 | |||
| 3448 | 3895 | static int hostapd_ctrl_nan_cancel_subscribe(struct hostapd_data *hapd, | ||
| 3449 | 3896 | char *cmd) | ||
| 3450 | 3897 | { | ||
| 3451 | 3898 | char *token, *context = NULL; | ||
| 3452 | 3899 | int subscribe_id = 0; | ||
| 3453 | 3900 | |||
| 3454 | 3901 | while ((token = str_token(cmd, " ", &context))) { | ||
| 3455 | 3902 | if (sscanf(token, "subscribe_id=%i", &subscribe_id) == 1) | ||
| 3456 | 3903 | continue; | ||
| 3457 | 3904 | wpa_printf(MSG_INFO, | ||
| 3458 | 3905 | "CTRL: Invalid NAN_CANCEL_SUBSCRIBE parameter: %s", | ||
| 3459 | 3906 | token); | ||
| 3460 | 3907 | return -1; | ||
| 3461 | 3908 | } | ||
| 3462 | 3909 | |||
| 3463 | 3910 | if (subscribe_id <= 0) { | ||
| 3464 | 3911 | wpa_printf(MSG_INFO, | ||
| 3465 | 3912 | "CTRL: Invalid or missing NAN_CANCEL_SUBSCRIBE subscribe_id"); | ||
| 3466 | 3913 | return -1; | ||
| 3467 | 3914 | } | ||
| 3468 | 3915 | |||
| 3469 | 3916 | hostapd_nan_usd_cancel_subscribe(hapd, subscribe_id); | ||
| 3470 | 3917 | return 0; | ||
| 3471 | 3918 | } | ||
| 3472 | 3919 | |||
| 3473 | 3920 | |||
| 3474 | 3921 | static int hostapd_ctrl_nan_transmit(struct hostapd_data *hapd, char *cmd) | ||
| 3475 | 3922 | { | ||
| 3476 | 3923 | char *token, *context = NULL; | ||
| 3477 | 3924 | int handle = 0; | ||
| 3478 | 3925 | int req_instance_id = 0; | ||
| 3479 | 3926 | struct wpabuf *ssi = NULL; | ||
| 3480 | 3927 | u8 peer_addr[ETH_ALEN]; | ||
| 3481 | 3928 | int ret = -1; | ||
| 3482 | 3929 | |||
| 3483 | 3930 | os_memset(peer_addr, 0, ETH_ALEN); | ||
| 3484 | 3931 | |||
| 3485 | 3932 | while ((token = str_token(cmd, " ", &context))) { | ||
| 3486 | 3933 | if (sscanf(token, "handle=%i", &handle) == 1) | ||
| 3487 | 3934 | continue; | ||
| 3488 | 3935 | |||
| 3489 | 3936 | if (sscanf(token, "req_instance_id=%i", &req_instance_id) == 1) | ||
| 3490 | 3937 | continue; | ||
| 3491 | 3938 | |||
| 3492 | 3939 | if (os_strncmp(token, "address=", 8) == 0) { | ||
| 3493 | 3940 | if (hwaddr_aton(token + 8, peer_addr) < 0) | ||
| 3494 | 3941 | return -1; | ||
| 3495 | 3942 | continue; | ||
| 3496 | 3943 | } | ||
| 3497 | 3944 | |||
| 3498 | 3945 | if (os_strncmp(token, "ssi=", 4) == 0) { | ||
| 3499 | 3946 | if (ssi) | ||
| 3500 | 3947 | goto fail; | ||
| 3501 | 3948 | ssi = wpabuf_parse_bin(token + 4); | ||
| 3502 | 3949 | if (!ssi) | ||
| 3503 | 3950 | goto fail; | ||
| 3504 | 3951 | continue; | ||
| 3505 | 3952 | } | ||
| 3506 | 3953 | |||
| 3507 | 3954 | wpa_printf(MSG_INFO, | ||
| 3508 | 3955 | "CTRL: Invalid NAN_TRANSMIT parameter: %s", | ||
| 3509 | 3956 | token); | ||
| 3510 | 3957 | goto fail; | ||
| 3511 | 3958 | } | ||
| 3512 | 3959 | |||
| 3513 | 3960 | if (handle <= 0) { | ||
| 3514 | 3961 | wpa_printf(MSG_INFO, | ||
| 3515 | 3962 | "CTRL: Invalid or missing NAN_TRANSMIT handle"); | ||
| 3516 | 3963 | goto fail; | ||
| 3517 | 3964 | } | ||
| 3518 | 3965 | |||
| 3519 | 3966 | if (is_zero_ether_addr(peer_addr)) { | ||
| 3520 | 3967 | wpa_printf(MSG_INFO, | ||
| 3521 | 3968 | "CTRL: Invalid or missing NAN_TRANSMIT address"); | ||
| 3522 | 3969 | goto fail; | ||
| 3523 | 3970 | } | ||
| 3524 | 3971 | |||
| 3525 | 3972 | ret = hostapd_nan_usd_transmit(hapd, handle, ssi, NULL, peer_addr, | ||
| 3526 | 3973 | req_instance_id); | ||
| 3527 | 3974 | fail: | ||
| 3528 | 3975 | wpabuf_free(ssi); | ||
| 3529 | 3976 | return ret; | ||
| 3530 | 3977 | } | ||
| 3531 | 3978 | |||
| 3532 | 3979 | #endif /* CONFIG_NAN_USD */ | ||
| 3533 | 3980 | |||
| 3534 | 3981 | |||
| 3535 | 3503 | static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | 3982 | static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, |
| 3536 | 3504 | char *buf, char *reply, | 3983 | char *buf, char *reply, |
| 3537 | 3505 | int reply_size, | 3984 | int reply_size, |
| 3538 | @@ -3517,6 +3996,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3539 | 3517 | } else if (os_strncmp(buf, "RELOG", 5) == 0) { | 3996 | } else if (os_strncmp(buf, "RELOG", 5) == 0) { |
| 3540 | 3518 | if (wpa_debug_reopen_file() < 0) | 3997 | if (wpa_debug_reopen_file() < 0) |
| 3541 | 3519 | reply_len = -1; | 3998 | reply_len = -1; |
| 3542 | 3999 | } else if (os_strcmp(buf, "CLOSE_LOG") == 0) { | ||
| 3543 | 4000 | wpa_debug_stop_log(); | ||
| 3544 | 3520 | } else if (os_strncmp(buf, "NOTE ", 5) == 0) { | 4001 | } else if (os_strncmp(buf, "NOTE ", 5) == 0) { |
| 3545 | 3521 | wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); | 4002 | wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); |
| 3546 | 3522 | } else if (os_strcmp(buf, "STATUS") == 0) { | 4003 | } else if (os_strcmp(buf, "STATUS") == 0) { |
| 3547 | @@ -3682,16 +4163,30 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3548 | 3682 | } else if (os_strncmp(buf, "GET ", 4) == 0) { | 4163 | } else if (os_strncmp(buf, "GET ", 4) == 0) { |
| 3549 | 3683 | reply_len = hostapd_ctrl_iface_get(hapd, buf + 4, reply, | 4164 | reply_len = hostapd_ctrl_iface_get(hapd, buf + 4, reply, |
| 3550 | 3684 | reply_size); | 4165 | reply_size); |
| 3552 | 3685 | } else if (os_strncmp(buf, "ENABLE", 6) == 0) { | 4166 | } else if (os_strcmp(buf, "ENABLE") == 0) { |
| 3553 | 3686 | if (hostapd_ctrl_iface_enable(hapd->iface)) | 4167 | if (hostapd_ctrl_iface_enable(hapd->iface)) |
| 3554 | 3687 | reply_len = -1; | 4168 | reply_len = -1; |
| 3555 | 3688 | } else if (os_strcmp(buf, "RELOAD_WPA_PSK") == 0) { | 4169 | } else if (os_strcmp(buf, "RELOAD_WPA_PSK") == 0) { |
| 3556 | 3689 | if (hostapd_ctrl_iface_reload_wpa_psk(hapd)) | 4170 | if (hostapd_ctrl_iface_reload_wpa_psk(hapd)) |
| 3557 | 3690 | reply_len = -1; | 4171 | reply_len = -1; |
| 3559 | 3691 | } else if (os_strncmp(buf, "RELOAD", 6) == 0) { | 4172 | #ifdef CONFIG_IEEE80211R_AP |
| 3560 | 4173 | } else if (os_strcmp(buf, "GET_RXKHS") == 0) { | ||
| 3561 | 4174 | reply_len = hostapd_ctrl_iface_get_rxkhs(hapd, reply, | ||
| 3562 | 4175 | reply_size); | ||
| 3563 | 4176 | } else if (os_strcmp(buf, "RELOAD_RXKHS") == 0) { | ||
| 3564 | 4177 | if (hostapd_ctrl_iface_reload_rxkhs(hapd)) | ||
| 3565 | 4178 | reply_len = -1; | ||
| 3566 | 4179 | #endif /* CONFIG_IEEE80211R_AP */ | ||
| 3567 | 4180 | } else if (os_strcmp(buf, "RELOAD_BSS") == 0) { | ||
| 3568 | 4181 | if (hostapd_ctrl_iface_reload_bss(hapd)) | ||
| 3569 | 4182 | reply_len = -1; | ||
| 3570 | 4183 | } else if (os_strcmp(buf, "RELOAD_CONFIG") == 0) { | ||
| 3571 | 4184 | if (hostapd_reload_config(hapd->iface)) | ||
| 3572 | 4185 | reply_len = -1; | ||
| 3573 | 4186 | } else if (os_strcmp(buf, "RELOAD") == 0) { | ||
| 3574 | 3692 | if (hostapd_ctrl_iface_reload(hapd->iface)) | 4187 | if (hostapd_ctrl_iface_reload(hapd->iface)) |
| 3575 | 3693 | reply_len = -1; | 4188 | reply_len = -1; |
| 3577 | 3694 | } else if (os_strncmp(buf, "DISABLE", 7) == 0) { | 4189 | } else if (os_strcmp(buf, "DISABLE") == 0) { |
| 3578 | 3695 | if (hostapd_ctrl_iface_disable(hapd->iface)) | 4190 | if (hostapd_ctrl_iface_disable(hapd->iface)) |
| 3579 | 3696 | reply_len = -1; | 4191 | reply_len = -1; |
| 3580 | 3697 | } else if (os_strcmp(buf, "UPDATE_BEACON") == 0) { | 4192 | } else if (os_strcmp(buf, "UPDATE_BEACON") == 0) { |
| 3581 | @@ -3727,16 +4222,15 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3582 | 3727 | if (hostapd_ctrl_iface_data_test_frame(hapd, buf + 16) < 0) | 4222 | if (hostapd_ctrl_iface_data_test_frame(hapd, buf + 16) < 0) |
| 3583 | 3728 | reply_len = -1; | 4223 | reply_len = -1; |
| 3584 | 3729 | } else if (os_strncmp(buf, "TEST_ALLOC_FAIL ", 16) == 0) { | 4224 | } else if (os_strncmp(buf, "TEST_ALLOC_FAIL ", 16) == 0) { |
| 3586 | 3730 | if (hostapd_ctrl_test_alloc_fail(hapd, buf + 16) < 0) | 4225 | if (testing_set_fail_pattern(true, buf + 16) < 0) |
| 3587 | 3731 | reply_len = -1; | 4226 | reply_len = -1; |
| 3588 | 3732 | } else if (os_strcmp(buf, "GET_ALLOC_FAIL") == 0) { | 4227 | } else if (os_strcmp(buf, "GET_ALLOC_FAIL") == 0) { |
| 3591 | 3733 | reply_len = hostapd_ctrl_get_alloc_fail(hapd, reply, | 4228 | reply_len = testing_get_fail_pattern(true, reply, reply_size); |
| 3590 | 3734 | reply_size); | ||
| 3592 | 3735 | } else if (os_strncmp(buf, "TEST_FAIL ", 10) == 0) { | 4229 | } else if (os_strncmp(buf, "TEST_FAIL ", 10) == 0) { |
| 3594 | 3736 | if (hostapd_ctrl_test_fail(hapd, buf + 10) < 0) | 4230 | if (testing_set_fail_pattern(false, buf + 10) < 0) |
| 3595 | 3737 | reply_len = -1; | 4231 | reply_len = -1; |
| 3596 | 3738 | } else if (os_strcmp(buf, "GET_FAIL") == 0) { | 4232 | } else if (os_strcmp(buf, "GET_FAIL") == 0) { |
| 3598 | 3739 | reply_len = hostapd_ctrl_get_fail(hapd, reply, reply_size); | 4233 | reply_len = testing_get_fail_pattern(false, reply, reply_size); |
| 3599 | 3740 | } else if (os_strncmp(buf, "RESET_PN ", 9) == 0) { | 4234 | } else if (os_strncmp(buf, "RESET_PN ", 9) == 0) { |
| 3600 | 3741 | if (hostapd_ctrl_reset_pn(hapd, buf + 9) < 0) | 4235 | if (hostapd_ctrl_reset_pn(hapd, buf + 9) < 0) |
| 3601 | 3742 | reply_len = -1; | 4236 | reply_len = -1; |
| 3602 | @@ -3768,6 +4262,14 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3603 | 3768 | } else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) { | 4262 | } else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) { |
| 3604 | 3769 | if (hostapd_ctrl_iface_chan_switch(hapd->iface, buf + 12)) | 4263 | if (hostapd_ctrl_iface_chan_switch(hapd->iface, buf + 12)) |
| 3605 | 3770 | reply_len = -1; | 4264 | reply_len = -1; |
| 3606 | 4265 | #ifdef CONFIG_IEEE80211AX | ||
| 3607 | 4266 | } else if (os_strncmp(buf, "COLOR_CHANGE ", 13) == 0) { | ||
| 3608 | 4267 | if (hostapd_ctrl_iface_color_change(hapd->iface, buf + 13)) | ||
| 3609 | 4268 | reply_len = -1; | ||
| 3610 | 4269 | #endif /* CONFIG_IEEE80211AX */ | ||
| 3611 | 4270 | } else if (os_strncmp(buf, "NOTIFY_CW_CHANGE ", 17) == 0) { | ||
| 3612 | 4271 | if (hostapd_ctrl_iface_notify_cw_change(hapd, buf + 17)) | ||
| 3613 | 4272 | reply_len = -1; | ||
| 3614 | 3771 | } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { | 4273 | } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { |
| 3615 | 3772 | reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, | 4274 | reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, |
| 3616 | 3773 | reply_size); | 4275 | reply_size); |
| 3617 | @@ -3816,6 +4318,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3618 | 3816 | } else if (os_strncmp(buf, "REQ_BEACON ", 11) == 0) { | 4318 | } else if (os_strncmp(buf, "REQ_BEACON ", 11) == 0) { |
| 3619 | 3817 | reply_len = hostapd_ctrl_iface_req_beacon(hapd, buf + 11, | 4319 | reply_len = hostapd_ctrl_iface_req_beacon(hapd, buf + 11, |
| 3620 | 3818 | reply, reply_size); | 4320 | reply, reply_size); |
| 3621 | 4321 | } else if (os_strncmp(buf, "REQ_LINK_MEASUREMENT ", 21) == 0) { | ||
| 3622 | 4322 | reply_len = hostapd_ctrl_iface_req_link_measurement( | ||
| 3623 | 4323 | hapd, buf + 21, reply, reply_size); | ||
| 3624 | 3819 | } else if (os_strcmp(buf, "DRIVER_FLAGS") == 0) { | 4324 | } else if (os_strcmp(buf, "DRIVER_FLAGS") == 0) { |
| 3625 | 3820 | reply_len = hostapd_ctrl_driver_flags(hapd->iface, reply, | 4325 | reply_len = hostapd_ctrl_driver_flags(hapd->iface, reply, |
| 3626 | 3821 | reply_size); | 4326 | reply_size); |
| 3627 | @@ -3828,14 +4333,15 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3628 | 3828 | if (os_strncmp(buf + 11, "ADD_MAC ", 8) == 0) { | 4333 | if (os_strncmp(buf + 11, "ADD_MAC ", 8) == 0) { |
| 3629 | 3829 | if (hostapd_ctrl_iface_acl_add_mac( | 4334 | if (hostapd_ctrl_iface_acl_add_mac( |
| 3630 | 3830 | &hapd->conf->accept_mac, | 4335 | &hapd->conf->accept_mac, |
| 3632 | 3831 | &hapd->conf->num_accept_mac, buf + 19)) | 4336 | &hapd->conf->num_accept_mac, buf + 19) || |
| 3633 | 4337 | hostapd_set_acl(hapd)) | ||
| 3634 | 3832 | reply_len = -1; | 4338 | reply_len = -1; |
| 3635 | 3833 | } else if (os_strncmp((buf + 11), "DEL_MAC ", 8) == 0) { | 4339 | } else if (os_strncmp((buf + 11), "DEL_MAC ", 8) == 0) { |
| 3637 | 3834 | if (!hostapd_ctrl_iface_acl_del_mac( | 4340 | if (hostapd_ctrl_iface_acl_del_mac( |
| 3638 | 3835 | &hapd->conf->accept_mac, | 4341 | &hapd->conf->accept_mac, |
| 3642 | 3836 | &hapd->conf->num_accept_mac, buf + 19)) | 4342 | &hapd->conf->num_accept_mac, buf + 19) || |
| 3643 | 3837 | hostapd_disassoc_accept_mac(hapd); | 4343 | hostapd_set_acl(hapd) || |
| 3644 | 3838 | else | 4344 | hostapd_disassoc_accept_mac(hapd)) |
| 3645 | 3839 | reply_len = -1; | 4345 | reply_len = -1; |
| 3646 | 3840 | } else if (os_strcmp(buf + 11, "SHOW") == 0) { | 4346 | } else if (os_strcmp(buf + 11, "SHOW") == 0) { |
| 3647 | 3841 | reply_len = hostapd_ctrl_iface_acl_show_mac( | 4347 | reply_len = hostapd_ctrl_iface_acl_show_mac( |
| 3648 | @@ -3845,20 +4351,25 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3649 | 3845 | hostapd_ctrl_iface_acl_clear_list( | 4351 | hostapd_ctrl_iface_acl_clear_list( |
| 3650 | 3846 | &hapd->conf->accept_mac, | 4352 | &hapd->conf->accept_mac, |
| 3651 | 3847 | &hapd->conf->num_accept_mac); | 4353 | &hapd->conf->num_accept_mac); |
| 3653 | 3848 | hostapd_disassoc_accept_mac(hapd); | 4354 | if (hostapd_set_acl(hapd) || |
| 3654 | 4355 | hostapd_disassoc_accept_mac(hapd)) | ||
| 3655 | 4356 | reply_len = -1; | ||
| 3656 | 4357 | } else { | ||
| 3657 | 4358 | reply_len = -1; | ||
| 3658 | 3849 | } | 4359 | } |
| 3659 | 3850 | } else if (os_strncmp(buf, "DENY_ACL ", 9) == 0) { | 4360 | } else if (os_strncmp(buf, "DENY_ACL ", 9) == 0) { |
| 3660 | 3851 | if (os_strncmp(buf + 9, "ADD_MAC ", 8) == 0) { | 4361 | if (os_strncmp(buf + 9, "ADD_MAC ", 8) == 0) { |
| 3662 | 3852 | if (!hostapd_ctrl_iface_acl_add_mac( | 4362 | if (hostapd_ctrl_iface_acl_add_mac( |
| 3663 | 3853 | &hapd->conf->deny_mac, | 4363 | &hapd->conf->deny_mac, |
| 3667 | 3854 | &hapd->conf->num_deny_mac, buf + 17)) | 4364 | &hapd->conf->num_deny_mac, buf + 17) || |
| 3668 | 3855 | hostapd_disassoc_deny_mac(hapd); | 4365 | hostapd_set_acl(hapd) || |
| 3669 | 3856 | else | 4366 | hostapd_disassoc_deny_mac(hapd)) |
| 3670 | 3857 | reply_len = -1; | 4367 | reply_len = -1; |
| 3671 | 3858 | } else if (os_strncmp(buf + 9, "DEL_MAC ", 8) == 0) { | 4368 | } else if (os_strncmp(buf + 9, "DEL_MAC ", 8) == 0) { |
| 3672 | 3859 | if (hostapd_ctrl_iface_acl_del_mac( | 4369 | if (hostapd_ctrl_iface_acl_del_mac( |
| 3673 | 3860 | &hapd->conf->deny_mac, | 4370 | &hapd->conf->deny_mac, |
| 3675 | 3861 | &hapd->conf->num_deny_mac, buf + 17)) | 4371 | &hapd->conf->num_deny_mac, buf + 17) || |
| 3676 | 4372 | hostapd_set_acl(hapd)) | ||
| 3677 | 3862 | reply_len = -1; | 4373 | reply_len = -1; |
| 3678 | 3863 | } else if (os_strcmp(buf + 9, "SHOW") == 0) { | 4374 | } else if (os_strcmp(buf + 9, "SHOW") == 0) { |
| 3679 | 3864 | reply_len = hostapd_ctrl_iface_acl_show_mac( | 4375 | reply_len = hostapd_ctrl_iface_acl_show_mac( |
| 3680 | @@ -3868,6 +4379,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3681 | 3868 | hostapd_ctrl_iface_acl_clear_list( | 4379 | hostapd_ctrl_iface_acl_clear_list( |
| 3682 | 3869 | &hapd->conf->deny_mac, | 4380 | &hapd->conf->deny_mac, |
| 3683 | 3870 | &hapd->conf->num_deny_mac); | 4381 | &hapd->conf->num_deny_mac); |
| 3684 | 4382 | if (hostapd_set_acl(hapd)) | ||
| 3685 | 4383 | reply_len = -1; | ||
| 3686 | 4384 | } else { | ||
| 3687 | 4385 | reply_len = -1; | ||
| 3688 | 3871 | } | 4386 | } |
| 3689 | 3872 | #ifdef CONFIG_DPP | 4387 | #ifdef CONFIG_DPP |
| 3690 | 3873 | } else if (os_strncmp(buf, "DPP_QR_CODE ", 12) == 0) { | 4388 | } else if (os_strncmp(buf, "DPP_QR_CODE ", 12) == 0) { |
| 3691 | @@ -3959,6 +4474,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3692 | 3959 | if (os_snprintf_error(reply_size, reply_len)) | 4474 | if (os_snprintf_error(reply_size, reply_len)) |
| 3693 | 3960 | reply_len = -1; | 4475 | reply_len = -1; |
| 3694 | 3961 | } | 4476 | } |
| 3695 | 4477 | } else if (os_strncmp(buf, "DPP_CONFIGURATOR_SET ", 21) == 0) { | ||
| 3696 | 4478 | if (dpp_configurator_set(hapd->iface->interfaces->dpp, | ||
| 3697 | 4479 | buf + 20) < 0) | ||
| 3698 | 4480 | reply_len = -1; | ||
| 3699 | 3962 | } else if (os_strncmp(buf, "DPP_CONFIGURATOR_REMOVE ", 24) == 0) { | 4481 | } else if (os_strncmp(buf, "DPP_CONFIGURATOR_REMOVE ", 24) == 0) { |
| 3700 | 3963 | if (dpp_configurator_remove(hapd->iface->interfaces->dpp, | 4482 | if (dpp_configurator_remove(hapd->iface->interfaces->dpp, |
| 3701 | 3964 | buf + 24) < 0) | 4483 | buf + 24) < 0) |
| 3702 | @@ -3997,8 +4516,41 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3703 | 3997 | reply_len = -1; | 4516 | reply_len = -1; |
| 3704 | 3998 | } else if (os_strcmp(buf, "DPP_STOP_CHIRP") == 0) { | 4517 | } else if (os_strcmp(buf, "DPP_STOP_CHIRP") == 0) { |
| 3705 | 3999 | hostapd_dpp_chirp_stop(hapd); | 4518 | hostapd_dpp_chirp_stop(hapd); |
| 3706 | 4519 | } else if (os_strncmp(buf, "DPP_RELAY_ADD_CONTROLLER ", 25) == 0) { | ||
| 3707 | 4520 | if (hostapd_dpp_add_controller(hapd, buf + 25) < 0) | ||
| 3708 | 4521 | reply_len = -1; | ||
| 3709 | 4522 | } else if (os_strncmp(buf, "DPP_RELAY_REMOVE_CONTROLLER ", 28) == 0) { | ||
| 3710 | 4523 | hostapd_dpp_remove_controller(hapd, buf + 28); | ||
| 3711 | 4000 | #endif /* CONFIG_DPP2 */ | 4524 | #endif /* CONFIG_DPP2 */ |
| 3712 | 4525 | #ifdef CONFIG_DPP3 | ||
| 3713 | 4526 | } else if (os_strcmp(buf, "DPP_PUSH_BUTTON") == 0) { | ||
| 3714 | 4527 | if (hostapd_dpp_push_button(hapd, NULL) < 0) | ||
| 3715 | 4528 | reply_len = -1; | ||
| 3716 | 4529 | } else if (os_strncmp(buf, "DPP_PUSH_BUTTON ", 16) == 0) { | ||
| 3717 | 4530 | if (hostapd_dpp_push_button(hapd, buf + 15) < 0) | ||
| 3718 | 4531 | reply_len = -1; | ||
| 3719 | 4532 | #endif /* CONFIG_DPP3 */ | ||
| 3720 | 4001 | #endif /* CONFIG_DPP */ | 4533 | #endif /* CONFIG_DPP */ |
| 3721 | 4534 | #ifdef CONFIG_NAN_USD | ||
| 3722 | 4535 | } else if (os_strncmp(buf, "NAN_PUBLISH ", 12) == 0) { | ||
| 3723 | 4536 | reply_len = hostapd_ctrl_nan_publish(hapd, buf + 12, reply, | ||
| 3724 | 4537 | reply_size); | ||
| 3725 | 4538 | } else if (os_strncmp(buf, "NAN_CANCEL_PUBLISH ", 19) == 0) { | ||
| 3726 | 4539 | if (hostapd_ctrl_nan_cancel_publish(hapd, buf + 19) < 0) | ||
| 3727 | 4540 | reply_len = -1; | ||
| 3728 | 4541 | } else if (os_strncmp(buf, "NAN_UPDATE_PUBLISH ", 19) == 0) { | ||
| 3729 | 4542 | if (hostapd_ctrl_nan_update_publish(hapd, buf + 19) < 0) | ||
| 3730 | 4543 | reply_len = -1; | ||
| 3731 | 4544 | } else if (os_strncmp(buf, "NAN_SUBSCRIBE ", 14) == 0) { | ||
| 3732 | 4545 | reply_len = hostapd_ctrl_nan_subscribe(hapd, buf + 14, reply, | ||
| 3733 | 4546 | reply_size); | ||
| 3734 | 4547 | } else if (os_strncmp(buf, "NAN_CANCEL_SUBSCRIBE ", 21) == 0) { | ||
| 3735 | 4548 | if (hostapd_ctrl_nan_cancel_subscribe(hapd, buf + 21) < 0) | ||
| 3736 | 4549 | reply_len = -1; | ||
| 3737 | 4550 | } else if (os_strncmp(buf, "NAN_TRANSMIT ", 13) == 0) { | ||
| 3738 | 4551 | if (hostapd_ctrl_nan_transmit(hapd, buf + 13) < 0) | ||
| 3739 | 4552 | reply_len = -1; | ||
| 3740 | 4553 | #endif /* CONFIG_NAN_USD */ | ||
| 3741 | 4002 | #ifdef RADIUS_SERVER | 4554 | #ifdef RADIUS_SERVER |
| 3742 | 4003 | } else if (os_strncmp(buf, "DAC_REQUEST ", 12) == 0) { | 4555 | } else if (os_strncmp(buf, "DAC_REQUEST ", 12) == 0) { |
| 3743 | 4004 | if (radius_server_dac_request(hapd->radius_srv, buf + 12) < 0) | 4556 | if (radius_server_dac_request(hapd->radius_srv, buf + 12) < 0) |
| 3744 | @@ -4016,6 +4568,20 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, | |||
| 3745 | 4016 | reply_len = hostapd_ctrl_iface_driver_cmd(hapd, buf + 7, reply, | 4568 | reply_len = hostapd_ctrl_iface_driver_cmd(hapd, buf + 7, reply, |
| 3746 | 4017 | reply_size); | 4569 | reply_size); |
| 3747 | 4018 | #endif /* ANDROID */ | 4570 | #endif /* ANDROID */ |
| 3748 | 4571 | #ifdef CONFIG_IEEE80211BE | ||
| 3749 | 4572 | } else if (os_strcmp(buf, "ENABLE_MLD") == 0) { | ||
| 3750 | 4573 | if (hostapd_ctrl_iface_enable_mld(hapd->iface)) | ||
| 3751 | 4574 | reply_len = -1; | ||
| 3752 | 4575 | } else if (os_strcmp(buf, "DISABLE_MLD") == 0) { | ||
| 3753 | 4576 | if (hostapd_ctrl_iface_disable_mld(hapd->iface)) | ||
| 3754 | 4577 | reply_len = -1; | ||
| 3755 | 4578 | #ifdef CONFIG_TESTING_OPTIONS | ||
| 3756 | 4579 | } else if (os_strncmp(buf, "LINK_REMOVE ", 12) == 0) { | ||
| 3757 | 4580 | if (hostapd_ctrl_iface_link_remove(hapd, buf + 12, | ||
| 3758 | 4581 | reply, reply_size)) | ||
| 3759 | 4582 | reply_len = -1; | ||
| 3760 | 4583 | #endif /* CONFIG_TESTING_OPTIONS */ | ||
| 3761 | 4584 | #endif /* CONFIG_IEEE80211BE */ | ||
| 3762 | 4019 | } else { | 4585 | } else { |
| 3763 | 4020 | os_memcpy(reply, "UNKNOWN COMMAND\n", 16); | 4586 | os_memcpy(reply, "UNKNOWN COMMAND\n", 16); |
| 3764 | 4021 | reply_len = 16; | 4587 | reply_len = 16; |
| 3765 | @@ -4506,6 +5072,20 @@ static void hostapd_ctrl_iface_flush(struct hapd_interfaces *interfaces) | |||
| 3766 | 4506 | 5072 | ||
| 3767 | 4507 | #ifdef CONFIG_DPP | 5073 | #ifdef CONFIG_DPP |
| 3768 | 4508 | dpp_global_clear(interfaces->dpp); | 5074 | dpp_global_clear(interfaces->dpp); |
| 3769 | 5075 | #ifdef CONFIG_DPP3 | ||
| 3770 | 5076 | interfaces->dpp_pb_bi = NULL; | ||
| 3771 | 5077 | { | ||
| 3772 | 5078 | int i; | ||
| 3773 | 5079 | |||
| 3774 | 5080 | for (i = 0; i < DPP_PB_INFO_COUNT; i++) { | ||
| 3775 | 5081 | struct dpp_pb_info *info; | ||
| 3776 | 5082 | |||
| 3777 | 5083 | info = &interfaces->dpp_pb[i]; | ||
| 3778 | 5084 | info->rx_time.sec = 0; | ||
| 3779 | 5085 | info->rx_time.usec = 0; | ||
| 3780 | 5086 | } | ||
| 3781 | 5087 | } | ||
| 3782 | 5088 | #endif /* CONFIG_DPP3 */ | ||
| 3783 | 4509 | #endif /* CONFIG_DPP */ | 5089 | #endif /* CONFIG_DPP */ |
| 3784 | 4510 | } | 5090 | } |
| 3785 | 4511 | 5091 | ||
| 3786 | @@ -4897,7 +5477,7 @@ static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx, | |||
| 3787 | 4897 | reply_len = -1; | 5477 | reply_len = -1; |
| 3788 | 4898 | } else if (os_strncmp(buf, "INTERFACES", 10) == 0) { | 5478 | } else if (os_strncmp(buf, "INTERFACES", 10) == 0) { |
| 3789 | 4899 | reply_len = hostapd_global_ctrl_iface_interfaces( | 5479 | reply_len = hostapd_global_ctrl_iface_interfaces( |
| 3791 | 4900 | interfaces, buf + 10, reply, sizeof(buffer)); | 5480 | interfaces, buf + 10, reply, reply_size); |
| 3792 | 4901 | } else if (os_strcmp(buf, "TERMINATE") == 0) { | 5481 | } else if (os_strcmp(buf, "TERMINATE") == 0) { |
| 3793 | 4902 | eloop_terminate(); | 5482 | eloop_terminate(); |
| 3794 | 4903 | } else { | 5483 | } else { |
| 3795 | diff --git a/hostapd/defconfig b/hostapd/defconfig | |||
| 3796 | index 6b50b6c..550db69 100644 | |||
| 3797 | --- a/hostapd/defconfig | |||
| 3798 | +++ b/hostapd/defconfig | |||
| 3799 | @@ -141,6 +141,9 @@ CONFIG_PKCS12=y | |||
| 3800 | 141 | # Build IPv6 support for RADIUS operations | 141 | # Build IPv6 support for RADIUS operations |
| 3801 | 142 | CONFIG_IPV6=y | 142 | CONFIG_IPV6=y |
| 3802 | 143 | 143 | ||
| 3803 | 144 | # Include support fo RADIUS/TLS into the RADIUS client | ||
| 3804 | 145 | #CONFIG_RADIUS_TLS=y | ||
| 3805 | 146 | |||
| 3806 | 144 | # IEEE Std 802.11r-2008 (Fast BSS Transition) | 147 | # IEEE Std 802.11r-2008 (Fast BSS Transition) |
| 3807 | 145 | #CONFIG_IEEE80211R=y | 148 | #CONFIG_IEEE80211R=y |
| 3808 | 146 | 149 | ||
| 3809 | @@ -156,10 +159,20 @@ CONFIG_IPV6=y | |||
| 3810 | 156 | #CONFIG_IEEE80211AC=y | 159 | #CONFIG_IEEE80211AC=y |
| 3811 | 157 | 160 | ||
| 3812 | 158 | # IEEE 802.11ax HE support | 161 | # IEEE 802.11ax HE support |
| 3813 | 162 | #CONFIG_IEEE80211AX=y | ||
| 3814 | 163 | |||
| 3815 | 164 | # IEEE 802.11be EHT support | ||
| 3816 | 165 | # CONFIG_IEEE80211AX is mandatory for setting CONFIG_IEEE80211BE. | ||
| 3817 | 159 | # Note: This is experimental and work in progress. The definitions are still | 166 | # Note: This is experimental and work in progress. The definitions are still |
| 3818 | 160 | # subject to change and this should not be expected to interoperate with the | 167 | # subject to change and this should not be expected to interoperate with the |
| 3821 | 161 | # final IEEE 802.11ax version. | 168 | # final IEEE 802.11be version. |
| 3822 | 162 | #CONFIG_IEEE80211AX=y | 169 | #CONFIG_IEEE80211BE=y |
| 3823 | 170 | |||
| 3824 | 171 | # Simultaneous Authentication of Equals (SAE), WPA3-Personal | ||
| 3825 | 172 | #CONFIG_SAE=y | ||
| 3826 | 173 | |||
| 3827 | 174 | # SAE Public Key, WPA3-Personal | ||
| 3828 | 175 | #CONFIG_SAE_PK=y | ||
| 3829 | 163 | 176 | ||
| 3830 | 164 | # Remove debugging code that is printing out debug messages to stdout. | 177 | # Remove debugging code that is printing out debug messages to stdout. |
| 3831 | 165 | # This can be used to reduce the size of the hostapd considerably if debugging | 178 | # This can be used to reduce the size of the hostapd considerably if debugging |
| 3832 | @@ -400,7 +413,6 @@ CONFIG_IPV6=y | |||
| 3833 | 400 | # Experimental implementation based on IEEE P802.11z/D2.6 and the protocol | 413 | # Experimental implementation based on IEEE P802.11z/D2.6 and the protocol |
| 3834 | 401 | # design is still subject to change. As such, this should not yet be enabled in | 414 | # design is still subject to change. As such, this should not yet be enabled in |
| 3835 | 402 | # production use. | 415 | # production use. |
| 3836 | 403 | # This requires CONFIG_IEEE80211W=y to be enabled, too. | ||
| 3837 | 404 | #CONFIG_PASN=y | 416 | #CONFIG_PASN=y |
| 3838 | 405 | 417 | ||
| 3839 | 406 | # Device Provisioning Protocol (DPP) (also known as Wi-Fi Easy Connect) | 418 | # Device Provisioning Protocol (DPP) (also known as Wi-Fi Easy Connect) |
| 3840 | @@ -410,3 +422,6 @@ CONFIG_DPP2=y | |||
| 3841 | 410 | # DPP version 3 support (experimental and still changing; do not enable for | 422 | # DPP version 3 support (experimental and still changing; do not enable for |
| 3842 | 411 | # production use) | 423 | # production use) |
| 3843 | 412 | #CONFIG_DPP3=y | 424 | #CONFIG_DPP3=y |
| 3844 | 425 | |||
| 3845 | 426 | # Wi-Fi Aware unsynchronized service discovery (NAN USD) | ||
| 3846 | 427 | #CONFIG_NAN_USD=y | ||
| 3847 | diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf | |||
| 3848 | index 3c2019f..d875d5f 100644 | |||
| 3849 | --- a/hostapd/hostapd.conf | |||
| 3850 | +++ b/hostapd/hostapd.conf | |||
| 3851 | @@ -225,6 +225,16 @@ channel=1 | |||
| 3852 | 225 | # Default behavior is to include all PSC and non-PSC channels. | 225 | # Default behavior is to include all PSC and non-PSC channels. |
| 3853 | 226 | #acs_exclude_6ghz_non_psc=1 | 226 | #acs_exclude_6ghz_non_psc=1 |
| 3854 | 227 | 227 | ||
| 3855 | 228 | # Enable background radar feature | ||
| 3856 | 229 | # This feature allows CAC to be run on dedicated radio RF chains while the | ||
| 3857 | 230 | # radio(s) are otherwise running normal AP activities on other channels. | ||
| 3858 | 231 | # This requires that the driver and the radio support it before feature will | ||
| 3859 | 232 | # actually be enabled, i.e., this parameter value is ignored with drivers that | ||
| 3860 | 233 | # do not advertise support for the capability. | ||
| 3861 | 234 | # 0: Leave disabled (default) | ||
| 3862 | 235 | # 1: Enable it. | ||
| 3863 | 236 | #enable_background_radar=1 | ||
| 3864 | 237 | |||
| 3865 | 228 | # Set minimum permitted max TX power (in dBm) for ACS and DFS channel selection. | 238 | # Set minimum permitted max TX power (in dBm) for ACS and DFS channel selection. |
| 3866 | 229 | # (default 0, i.e., not constraint) | 239 | # (default 0, i.e., not constraint) |
| 3867 | 230 | #min_tx_power=20 | 240 | #min_tx_power=20 |
| 3868 | @@ -512,6 +522,25 @@ wmm_ac_vo_acm=0 | |||
| 3869 | 512 | # even if they are still in range of the AP. This can be done by setting | 522 | # even if they are still in range of the AP. This can be done by setting |
| 3870 | 513 | # skip_inactivity_poll to 1 (default 0). | 523 | # skip_inactivity_poll to 1 (default 0). |
| 3871 | 514 | #skip_inactivity_poll=0 | 524 | #skip_inactivity_poll=0 |
| 3872 | 525 | # | ||
| 3873 | 526 | # BSS max idle period management | ||
| 3874 | 527 | # 0 = disabled (do not advertise and manage BSS max idle period) | ||
| 3875 | 528 | # 1 = enabled (advertise and manage BSS max idle period; default) | ||
| 3876 | 529 | # 2 = enabled requiring protected frames (advertise and manage BSS max idle | ||
| 3877 | 530 | # period and require STAs to use protected keep-alive frames) | ||
| 3878 | 531 | #bss_max_idle=1 | ||
| 3879 | 532 | # | ||
| 3880 | 533 | # Maximum acceptable BSS maximum idle period | ||
| 3881 | 534 | # If this is set to a nonzero value, the AP allows STAs to request different | ||
| 3882 | 535 | # maximum idle period values. This is in the units to 1000 TUs (1.024 s) | ||
| 3883 | 536 | #max_acceptable_idle_period=600 | ||
| 3884 | 537 | # | ||
| 3885 | 538 | # Allow STA to skip group key handshake without getting disconnection when | ||
| 3886 | 539 | # BSS max idle period management is enabled. | ||
| 3887 | 540 | # 0 = disconnect STA if it does not reply to group key handshake (default) | ||
| 3888 | 541 | # 1 = do not disconnect STA if it does not reply to group key handshake and | ||
| 3889 | 542 | # if BSS max idle period management is enabled | ||
| 3890 | 543 | #no_disconnect_on_group_keyerror=0 | ||
| 3891 | 515 | 544 | ||
| 3892 | 516 | # Disassociate stations based on excessive transmission failures or other | 545 | # Disassociate stations based on excessive transmission failures or other |
| 3893 | 517 | # indications of connection loss. This depends on the driver capabilities and | 546 | # indications of connection loss. This depends on the driver capabilities and |
| 3894 | @@ -636,6 +665,12 @@ wmm_ac_vo_acm=0 | |||
| 3895 | 636 | # no co-existence issues with neighboring devices are found. | 665 | # no co-existence issues with neighboring devices are found. |
| 3896 | 637 | #obss_interval=0 | 666 | #obss_interval=0 |
| 3897 | 638 | 667 | ||
| 3898 | 668 | # ht_vht_twt_responder: Whether TWT responder is enabled in HT and VHT modes | ||
| 3899 | 669 | # 0 = disable; Disable TWT responder support in HT and VHT modes (default). | ||
| 3900 | 670 | # 1 = enable; Enable TWT responder support in HT and VHT modes if supported by | ||
| 3901 | 671 | # the driver. | ||
| 3902 | 672 | #ht_vht_twt_responder=0 | ||
| 3903 | 673 | |||
| 3904 | 639 | ##### IEEE 802.11ac related configuration ##################################### | 674 | ##### IEEE 802.11ac related configuration ##################################### |
| 3905 | 640 | 675 | ||
| 3906 | 641 | # ieee80211ac: Whether IEEE 802.11ac (VHT) is enabled | 676 | # ieee80211ac: Whether IEEE 802.11ac (VHT) is enabled |
| 3907 | @@ -802,6 +837,9 @@ wmm_ac_vo_acm=0 | |||
| 3908 | 802 | # 1 = enabled | 837 | # 1 = enabled |
| 3909 | 803 | #ieee80211ax=1 | 838 | #ieee80211ax=1 |
| 3910 | 804 | 839 | ||
| 3911 | 840 | # Require stations to support HE PHY (reject association if they do not) | ||
| 3912 | 841 | #require_he=1 | ||
| 3913 | 842 | |||
| 3914 | 805 | # disable_11ax: Boolean (0/1) to disable HE for a specific BSS | 843 | # disable_11ax: Boolean (0/1) to disable HE for a specific BSS |
| 3915 | 806 | #disable_11ax=0 | 844 | #disable_11ax=0 |
| 3916 | 807 | 845 | ||
| 3917 | @@ -861,7 +899,7 @@ wmm_ac_vo_acm=0 | |||
| 3918 | 861 | # he_oper_chwidth is ignored, and the channel width is derived from the | 899 | # he_oper_chwidth is ignored, and the channel width is derived from the |
| 3919 | 862 | # configured operating class or center frequency indexes (see | 900 | # configured operating class or center frequency indexes (see |
| 3920 | 863 | # IEEE P802.11ax/D6.1 Annex E, Table E-4). | 901 | # IEEE P802.11ax/D6.1 Annex E, Table E-4). |
| 3922 | 864 | #he_oper_chwidth | 902 | #he_oper_chwidth (see vht_oper_chwidth) |
| 3923 | 865 | #he_oper_centr_freq_seg0_idx | 903 | #he_oper_centr_freq_seg0_idx |
| 3924 | 866 | #he_oper_centr_freq_seg1_idx | 904 | #he_oper_centr_freq_seg1_idx |
| 3925 | 867 | 905 | ||
| 3926 | @@ -965,6 +1003,25 @@ wmm_ac_vo_acm=0 | |||
| 3927 | 965 | # (default) | 1003 | # (default) |
| 3928 | 966 | #he_6ghz_tx_ant_pat=1 | 1004 | #he_6ghz_tx_ant_pat=1 |
| 3929 | 967 | 1005 | ||
| 3930 | 1006 | # 6 GHz Access Point type | ||
| 3931 | 1007 | # This config is to set the 6 GHz Access Point type. Possible options are: | ||
| 3932 | 1008 | # 0 = Indoor AP | ||
| 3933 | 1009 | # 1 = Standard power AP | ||
| 3934 | 1010 | # 2 = Very low power AP (default) | ||
| 3935 | 1011 | # 3 = Indoor enabled AP | ||
| 3936 | 1012 | # 4 = Indoor standard power AP | ||
| 3937 | 1013 | # This has no impact for operation on other bands. | ||
| 3938 | 1014 | # See IEEE P802.11-REVme/D4.0, Table E-12 (Regulatory Info subfield encoding) | ||
| 3939 | 1015 | # for more details. | ||
| 3940 | 1016 | #he_6ghz_reg_pwr_type=0 | ||
| 3941 | 1017 | # | ||
| 3942 | 1018 | # 6 GHz Maximum Tx Power used in Transmit Power Envelope elements, where the | ||
| 3943 | 1019 | # "Transmit Power Interpretation" is set to "Regulatory client EIRP PSD". | ||
| 3944 | 1020 | # For Maximum Transmit Power Category subfield encoding set to default (0): | ||
| 3945 | 1021 | #reg_def_cli_eirp_psd=-1 | ||
| 3946 | 1022 | # For Maximum Transmit Power Category subfield encoding set to subordinate (1): | ||
| 3947 | 1023 | #reg_sub_cli_eirp_psd=-1 | ||
| 3948 | 1024 | |||
| 3949 | 968 | # Unsolicited broadcast Probe Response transmission settings | 1025 | # Unsolicited broadcast Probe Response transmission settings |
| 3950 | 969 | # This is for the 6 GHz band only. If the interval is set to a non-zero value, | 1026 | # This is for the 6 GHz band only. If the interval is set to a non-zero value, |
| 3951 | 970 | # the AP schedules unsolicited broadcast Probe Response frames to be | 1027 | # the AP schedules unsolicited broadcast Probe Response frames to be |
| 3952 | @@ -973,6 +1030,78 @@ wmm_ac_vo_acm=0 | |||
| 3953 | 973 | # Valid range: 0..20 TUs; default is 0 (disabled) | 1030 | # Valid range: 0..20 TUs; default is 0 (disabled) |
| 3954 | 974 | #unsol_bcast_probe_resp_interval=0 | 1031 | #unsol_bcast_probe_resp_interval=0 |
| 3955 | 975 | 1032 | ||
| 3956 | 1033 | ##### IEEE 802.11be related configuration ##################################### | ||
| 3957 | 1034 | |||
| 3958 | 1035 | #ieee80211be: Whether IEEE 802.11be (EHT) is enabled | ||
| 3959 | 1036 | # 0 = disabled (default) | ||
| 3960 | 1037 | # 1 = enabled | ||
| 3961 | 1038 | #ieee80211be=1 | ||
| 3962 | 1039 | |||
| 3963 | 1040 | #disable_11be: Boolean (0/1) to disable EHT for a specific BSS | ||
| 3964 | 1041 | #disable_11be=0 | ||
| 3965 | 1042 | |||
| 3966 | 1043 | #eht_su_beamformer: EHT single user beamformer support | ||
| 3967 | 1044 | # 0 = not supported (default) | ||
| 3968 | 1045 | # 1 = supported | ||
| 3969 | 1046 | #eht_su_beamformer=1 | ||
| 3970 | 1047 | |||
| 3971 | 1048 | #eht_su_beamformee: EHT single user beamformee support | ||
| 3972 | 1049 | # 0 = not supported (default) | ||
| 3973 | 1050 | # 1 = supported | ||
| 3974 | 1051 | #eht_su_beamformee=1 | ||
| 3975 | 1052 | |||
| 3976 | 1053 | #eht_mu_beamformer: EHT multiple user beamformer support | ||
| 3977 | 1054 | # 0 = not supported (default) | ||
| 3978 | 1055 | # 1 = supported | ||
| 3979 | 1056 | #eht_mu_beamformer=1 | ||
| 3980 | 1057 | |||
| 3981 | 1058 | # EHT operating channel information; see matching he_* parameters for details. | ||
| 3982 | 1059 | # The field eht_oper_centr_freq_seg0_idx field is used to indicate center | ||
| 3983 | 1060 | # frequency of 40, 80, and 160 MHz bandwidth operation. | ||
| 3984 | 1061 | # In the 6 GHz band, eht_oper_chwidth is ignored and the channel width is | ||
| 3985 | 1062 | # derived from the configured operating class (IEEE P802.11be/D1.5, | ||
| 3986 | 1063 | # Annex E.1 - Country information and operating classes). | ||
| 3987 | 1064 | #eht_oper_chwidth (see vht_oper_chwidth) | ||
| 3988 | 1065 | #eht_oper_centr_freq_seg0_idx | ||
| 3989 | 1066 | |||
| 3990 | 1067 | #eht_default_pe_duration: The duration of PE field in EHT TB PPDU | ||
| 3991 | 1068 | # 0 = PE field duration is the same as he_default_pe_duration (default) | ||
| 3992 | 1069 | # 1 = PE field duration is 20 us | ||
| 3993 | 1070 | #eht_default_pe_duration=0 | ||
| 3994 | 1071 | |||
| 3995 | 1072 | #eht_bw320_offset: For automatic channel selection (ACS) to indicate a preferred | ||
| 3996 | 1073 | # 320 MHz channelization in EHT mode. | ||
| 3997 | 1074 | # If the channel is decided or the bandwidth is not 320 MHz, this option is | ||
| 3998 | 1075 | # meaningless. | ||
| 3999 | 1076 | # 0 = auto-detect by hostapd | ||
| 4000 | 1077 | # 1 = 320 MHz-1 (channel center frequency 31, 95, 159) | ||
| 4001 | 1078 | # 2 = 320 MHz-2 (channel center frequency 63, 127, 191) | ||
| 4002 | 1079 | #eht_bw320_offset=0 | ||
| 4003 | 1080 | |||
| 4004 | 1081 | # Disabled subchannel bitmap (16 bits) as per IEEE P802.11be/3.0, | ||
| 4005 | 1082 | # Figure 9-1002c (EHT Operation Information field format). Each bit corresponds | ||
| 4006 | 1083 | # to a 20 MHz channel, the lowest bit corresponds to the lowest frequency. A | ||
| 4007 | 1084 | # bit set to 1 indicates that the channel is punctured (disabled). The default | ||
| 4008 | 1085 | # value is 0 indicating that all channels are active. | ||
| 4009 | 1086 | #punct_bitmap=0 | ||
| 4010 | 1087 | |||
| 4011 | 1088 | # Preamble puncturing threshold in automatic channel selection (ACS). | ||
| 4012 | 1089 | # The value indicates the percentage of ideal channel average interference | ||
| 4013 | 1090 | # factor above which a channel should be punctured. | ||
| 4014 | 1091 | # Default is 0, indicates that ACS algorithm should not puncture any channel. | ||
| 4015 | 1092 | #punct_acs_threshold=75 | ||
| 4016 | 1093 | |||
| 4017 | 1094 | # AP MLD - Whether this AP is a part of an AP MLD | ||
| 4018 | 1095 | # 0 = no (no MLO) | ||
| 4019 | 1096 | # 1 = yes (MLO) | ||
| 4020 | 1097 | #mld_ap=0 | ||
| 4021 | 1098 | |||
| 4022 | 1099 | # AP MLD MAC address | ||
| 4023 | 1100 | # The configured address will be set as the interface hardware address and used | ||
| 4024 | 1101 | # as the AP MLD MAC address. If not set, the current interface hardware address | ||
| 4025 | 1102 | # will be used as the AP MLD MAC address. | ||
| 4026 | 1103 | #mld_addr=02:03:04:05:06:07 | ||
| 4027 | 1104 | |||
| 4028 | 976 | ##### IEEE 802.1X-2004 related configuration ################################## | 1105 | ##### IEEE 802.1X-2004 related configuration ################################## |
| 4029 | 977 | 1106 | ||
| 4030 | 978 | # Require IEEE 802.1X authorization | 1107 | # Require IEEE 802.1X authorization |
| 4031 | @@ -1063,6 +1192,14 @@ eapol_key_index_workaround=0 | |||
| 4032 | 1063 | # 0: No replay window, strict check (default) | 1192 | # 0: No replay window, strict check (default) |
| 4033 | 1064 | # 1..2^32-1: number of packets that could be misordered | 1193 | # 1..2^32-1: number of packets that could be misordered |
| 4034 | 1065 | # | 1194 | # |
| 4035 | 1195 | # macsec_offload: IEEE 802.1X/MACsec hardware offload | ||
| 4036 | 1196 | # This setting applies only when MACsec is in use, i.e., | ||
| 4037 | 1197 | # - macsec_policy is enabled | ||
| 4038 | 1198 | # - the key server has decided to enable MACsec | ||
| 4039 | 1199 | # 0 = MACSEC_OFFLOAD_OFF (default) | ||
| 4040 | 1200 | # 1 = MACSEC_OFFLOAD_PHY | ||
| 4041 | 1201 | # 2 = MACSEC_OFFLOAD_MAC | ||
| 4042 | 1202 | # | ||
| 4043 | 1066 | # macsec_port: IEEE 802.1X/MACsec port | 1203 | # macsec_port: IEEE 802.1X/MACsec port |
| 4044 | 1067 | # Port component of the SCI | 1204 | # Port component of the SCI |
| 4045 | 1068 | # Range: 1-65534 (default: 1) | 1205 | # Range: 1-65534 (default: 1) |
| 4046 | @@ -1070,6 +1207,10 @@ eapol_key_index_workaround=0 | |||
| 4047 | 1070 | # mka_priority (Priority of MKA Actor) | 1207 | # mka_priority (Priority of MKA Actor) |
| 4048 | 1071 | # Range: 0..255 (default: 255) | 1208 | # Range: 0..255 (default: 255) |
| 4049 | 1072 | # | 1209 | # |
| 4050 | 1210 | # macsec_csindex: IEEE 802.1X/MACsec cipher suite | ||
| 4051 | 1211 | # 0 = GCM-AES-128 (default) | ||
| 4052 | 1212 | # 1 = GCM-AES-256 (default) | ||
| 4053 | 1213 | # | ||
| 4054 | 1073 | # mka_cak, mka_ckn, and mka_priority: IEEE 802.1X/MACsec pre-shared key mode | 1214 | # mka_cak, mka_ckn, and mka_priority: IEEE 802.1X/MACsec pre-shared key mode |
| 4055 | 1074 | # This allows to configure MACsec with a pre-shared key using a (CAK,CKN) pair. | 1215 | # This allows to configure MACsec with a pre-shared key using a (CAK,CKN) pair. |
| 4056 | 1075 | # In this mode, instances of hostapd can act as MACsec peers. The peer | 1216 | # In this mode, instances of hostapd can act as MACsec peers. The peer |
| 4057 | @@ -1243,12 +1384,11 @@ eap_server=0 | |||
| 4058 | 1243 | 1384 | ||
| 4059 | 1244 | # dh_file: File path to DH/DSA parameters file (in PEM format) | 1385 | # dh_file: File path to DH/DSA parameters file (in PEM format) |
| 4060 | 1245 | # This is an optional configuration file for setting parameters for an | 1386 | # This is an optional configuration file for setting parameters for an |
| 4067 | 1246 | # ephemeral DH key exchange. In most cases, the default RSA authentication does | 1387 | # ephemeral DH key exchange. If the file is in DSA parameters format, it will |
| 4068 | 1247 | # not use this configuration. However, it is possible setup RSA to use | 1388 | # be automatically converted into DH params. If the used TLS library supports |
| 4069 | 1248 | # ephemeral DH key exchange. In addition, ciphers with DSA keys always use | 1389 | # automatic DH parameter selection, that functionality will be used if this |
| 4070 | 1249 | # ephemeral DH keys. This can be used to achieve forward secrecy. If the file | 1390 | # parameter is not set. DH parameters are required if anonymous EAP-FAST is |
| 4071 | 1250 | # is in DSA parameters format, it will be automatically converted into DH | 1391 | # used. |
| 4066 | 1251 | # params. This parameter is required if anonymous EAP-FAST is used. | ||
| 4072 | 1252 | # You can generate DH parameters file with OpenSSL, e.g., | 1392 | # You can generate DH parameters file with OpenSSL, e.g., |
| 4073 | 1253 | # "openssl dhparam -out /etc/hostapd.dh.pem 2048" | 1393 | # "openssl dhparam -out /etc/hostapd.dh.pem 2048" |
| 4074 | 1254 | #dh_file=/etc/hostapd.dh.pem | 1394 | #dh_file=/etc/hostapd.dh.pem |
| 4075 | @@ -1358,6 +1498,12 @@ eap_server=0 | |||
| 4076 | 1358 | # 5 = require both user and machine identity | 1498 | # 5 = require both user and machine identity |
| 4077 | 1359 | #eap_teap_id=0 | 1499 | #eap_teap_id=0 |
| 4078 | 1360 | 1500 | ||
| 4079 | 1501 | # EAP-TEAP tunneled EAP method behavior | ||
| 4080 | 1502 | # 0 = minimize roundtrips by merging start of the next EAP method with the | ||
| 4081 | 1503 | # crypto-binding of the previous one. | ||
| 4082 | 1504 | # 1 = complete crypto-binding before starting the next EAP method | ||
| 4083 | 1505 | #eap_teap_method_sequence=0 | ||
| 4084 | 1506 | |||
| 4085 | 1361 | # EAP-SIM and EAP-AKA protected success/failure indication using AT_RESULT_IND | 1507 | # EAP-SIM and EAP-AKA protected success/failure indication using AT_RESULT_IND |
| 4086 | 1362 | # (default: 0 = disabled). | 1508 | # (default: 0 = disabled). |
| 4087 | 1363 | #eap_sim_aka_result_ind=1 | 1509 | #eap_sim_aka_result_ind=1 |
| 4088 | @@ -1367,8 +1513,25 @@ eap_server=0 | |||
| 4089 | 1367 | # 1 = use pseudonyms, but not fast reauthentication | 1513 | # 1 = use pseudonyms, but not fast reauthentication |
| 4090 | 1368 | # 2 = do not use pseudonyms, but use fast reauthentication | 1514 | # 2 = do not use pseudonyms, but use fast reauthentication |
| 4091 | 1369 | # 3 = use pseudonyms and use fast reauthentication (default) | 1515 | # 3 = use pseudonyms and use fast reauthentication (default) |
| 4092 | 1516 | # 4 = do not use pseudonyms or fast reauthentication and allow | ||
| 4093 | 1517 | # EAP-Response/Identity to be used without method specific identity exchange | ||
| 4094 | 1518 | # 5 = use pseudonyms, but not fast reauthentication and allow | ||
| 4095 | 1519 | # EAP-Response/Identity to be used without method specific identity exchange | ||
| 4096 | 1520 | # 6 = do not use pseudonyms, but use fast reauthentication and allow | ||
| 4097 | 1521 | # EAP-Response/Identity to be used without method specific identity exchange | ||
| 4098 | 1522 | # 7 = use pseudonyms and use fast reauthentication and allow | ||
| 4099 | 1523 | # EAP-Response/Identity to be used without method specific identity exchange | ||
| 4100 | 1370 | #eap_sim_id=3 | 1524 | #eap_sim_id=3 |
| 4101 | 1371 | 1525 | ||
| 4102 | 1526 | # IMSI privacy key (PEM encoded RSA 2048-bit private key) for decrypting | ||
| 4103 | 1527 | # permanent identity when using EAP-SIM/AKA/AKA'. | ||
| 4104 | 1528 | #imsi_privacy_key=imsi-privacy-key.pem | ||
| 4105 | 1529 | |||
| 4106 | 1530 | # EAP-SIM and EAP-AKA fast re-authentication limit | ||
| 4107 | 1531 | # Maximum number of fast re-authentications allowed after each full | ||
| 4108 | 1532 | # authentication. | ||
| 4109 | 1533 | #eap_sim_aka_fast_reauth_limit=1000 | ||
| 4110 | 1534 | |||
| 4111 | 1372 | # Trusted Network Connect (TNC) | 1535 | # Trusted Network Connect (TNC) |
| 4112 | 1373 | # If enabled, TNC validation will be required before the peer is allowed to | 1536 | # If enabled, TNC validation will be required before the peer is allowed to |
| 4113 | 1374 | # connect. Note: This is only used with EAP-TTLS and EAP-FAST. If any other | 1537 | # connect. Note: This is only used with EAP-TTLS and EAP-FAST. If any other |
| 4114 | @@ -1440,6 +1603,16 @@ own_ip_addr=127.0.0.1 | |||
| 4115 | 1440 | #acct_server_port=1813 | 1603 | #acct_server_port=1813 |
| 4116 | 1441 | #acct_server_shared_secret=secret2 | 1604 | #acct_server_shared_secret=secret2 |
| 4117 | 1442 | 1605 | ||
| 4118 | 1606 | # RADIUS/TLS instead of RADIUS/UDP | ||
| 4119 | 1607 | #auth_server_addr=127.0.0.1 | ||
| 4120 | 1608 | #auth_server_port=2083 | ||
| 4121 | 1609 | #auth_server_type=TLS | ||
| 4122 | 1610 | #auth_server_shared_secret=radsec | ||
| 4123 | 1611 | #auth_server_ca_cert=<path to trusted CA certificate(s)> | ||
| 4124 | 1612 | #auth_server_client_cert=<path to client certificate> | ||
| 4125 | 1613 | #auth_server_private_key=<path to private key> | ||
| 4126 | 1614 | #auth_server_private_key_passwd=<password for decrypting private key> | ||
| 4127 | 1615 | |||
| 4128 | 1443 | # Retry interval for trying to return to the primary RADIUS server (in | 1616 | # Retry interval for trying to return to the primary RADIUS server (in |
| 4129 | 1444 | # seconds). RADIUS client code will automatically try to use the next server | 1617 | # seconds). RADIUS client code will automatically try to use the next server |
| 4130 | 1445 | # when the current server is not replying to requests. If this interval is set, | 1618 | # when the current server is not replying to requests. If this interval is set, |
| 4131 | @@ -1447,6 +1620,17 @@ own_ip_addr=127.0.0.1 | |||
| 4132 | 1447 | # currently used secondary server is still working. | 1620 | # currently used secondary server is still working. |
| 4133 | 1448 | #radius_retry_primary_interval=600 | 1621 | #radius_retry_primary_interval=600 |
| 4134 | 1449 | 1622 | ||
| 4135 | 1623 | # Message-Authenticator attribute requirement for non-EAP cases | ||
| 4136 | 1624 | # hostapd requires Message-Authenticator attribute to be included in all cases | ||
| 4137 | 1625 | # where RADIUS is used for EAP authentication. This is also required for cases | ||
| 4138 | 1626 | # where RADIUS is used for MAC ACL (macaddr_acl=2) by default, but that case | ||
| 4139 | 1627 | # can be configured to not require this for compatibility with RADIUS servers | ||
| 4140 | 1628 | # that do not include the attribute. This is not recommended due to potential | ||
| 4141 | 1629 | # security concerns, but can be used as a temporary workaround in networks where | ||
| 4142 | 1630 | # the connection to the RADIUS server is secure. | ||
| 4143 | 1631 | # 0 = Do not require Message-Authenticator in MAC ACL response | ||
| 4144 | 1632 | # 1 = Require Message-Authenticator in all authentication cases (default) | ||
| 4145 | 1633 | #radius_require_message_authenticator=1 | ||
| 4146 | 1450 | 1634 | ||
| 4147 | 1451 | # Interim accounting update interval | 1635 | # Interim accounting update interval |
| 4148 | 1452 | # If this is set (larger than 0) and acct_server is configured, hostapd will | 1636 | # If this is set (larger than 0) and acct_server is configured, hostapd will |
| 4149 | @@ -1651,12 +1835,19 @@ own_ip_addr=127.0.0.1 | |||
| 4150 | 1651 | #wpa_psk_file=/etc/hostapd.wpa_psk | 1835 | #wpa_psk_file=/etc/hostapd.wpa_psk |
| 4151 | 1652 | 1836 | ||
| 4152 | 1653 | # Optionally, WPA passphrase can be received from RADIUS authentication server | 1837 | # Optionally, WPA passphrase can be received from RADIUS authentication server |
| 4154 | 1654 | # This requires macaddr_acl to be set to 2 (RADIUS) | 1838 | # This requires macaddr_acl to be set to 2 (RADIUS) for wpa_psk_radius values |
| 4155 | 1839 | # 1 and 2. | ||
| 4156 | 1655 | # 0 = disabled (default) | 1840 | # 0 = disabled (default) |
| 4157 | 1656 | # 1 = optional; use default passphrase/psk if RADIUS server does not include | 1841 | # 1 = optional; use default passphrase/psk if RADIUS server does not include |
| 4158 | 1657 | # Tunnel-Password | 1842 | # Tunnel-Password |
| 4159 | 1658 | # 2 = required; reject authentication if RADIUS server does not include | 1843 | # 2 = required; reject authentication if RADIUS server does not include |
| 4160 | 1659 | # Tunnel-Password | 1844 | # Tunnel-Password |
| 4161 | 1845 | # 3 = ask RADIUS server during 4-way handshake if there is no locally | ||
| 4162 | 1846 | # configured PSK/passphrase for the STA | ||
| 4163 | 1847 | # | ||
| 4164 | 1848 | # The Tunnel-Password attribute in Access-Accept can contain either the | ||
| 4165 | 1849 | # 8..63 character ASCII passphrase or a 64 hex character encoding of the PSK. | ||
| 4166 | 1850 | # | ||
| 4167 | 1660 | #wpa_psk_radius=0 | 1851 | #wpa_psk_radius=0 |
| 4168 | 1661 | 1852 | ||
| 4169 | 1662 | # Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). The | 1853 | # Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). The |
| 4170 | @@ -1914,6 +2105,10 @@ own_ip_addr=127.0.0.1 | |||
| 4171 | 1914 | #sae_password=really secret|mac=ff:ff:ff:ff:ff:ff | 2105 | #sae_password=really secret|mac=ff:ff:ff:ff:ff:ff |
| 4172 | 1915 | #sae_password=example secret|mac=02:03:04:05:06:07|id=pw identifier | 2106 | #sae_password=example secret|mac=02:03:04:05:06:07|id=pw identifier |
| 4173 | 1916 | #sae_password=example secret|vlanid=3|id=pw identifier | 2107 | #sae_password=example secret|vlanid=3|id=pw identifier |
| 4174 | 2108 | # | ||
| 4175 | 2109 | # SAE passwords can also be read from a separate file in which each line | ||
| 4176 | 2110 | # contains and entry in the same format as sae_password uses. | ||
| 4177 | 2111 | #sae_password_file=/tc/hostapd.sae_passwords | ||
| 4178 | 1917 | 2112 | ||
| 4179 | 1918 | # SAE threshold for anti-clogging mechanism (dot11RSNASAEAntiCloggingThreshold) | 2113 | # SAE threshold for anti-clogging mechanism (dot11RSNASAEAntiCloggingThreshold) |
| 4180 | 1919 | # This parameter defines how many open SAE instances can be in progress at the | 2114 | # This parameter defines how many open SAE instances can be in progress at the |
| 4181 | @@ -1924,7 +2119,7 @@ own_ip_addr=127.0.0.1 | |||
| 4182 | 1924 | # Maximum number of SAE synchronization errors (dot11RSNASAESync) | 2119 | # Maximum number of SAE synchronization errors (dot11RSNASAESync) |
| 4183 | 1925 | # The offending SAE peer will be disconnected if more than this many | 2120 | # The offending SAE peer will be disconnected if more than this many |
| 4184 | 1926 | # synchronization errors happen. | 2121 | # synchronization errors happen. |
| 4186 | 1927 | #sae_sync=5 | 2122 | #sae_sync=3 |
| 4187 | 1928 | 2123 | ||
| 4188 | 1929 | # Enabled SAE finite cyclic groups | 2124 | # Enabled SAE finite cyclic groups |
| 4189 | 1930 | # SAE implementation are required to support group 19 (ECC group defined over a | 2125 | # SAE implementation are required to support group 19 (ECC group defined over a |
| 4190 | @@ -2042,6 +2237,8 @@ own_ip_addr=127.0.0.1 | |||
| 4191 | 2042 | # If fils_discovery_max_interval is non-zero, the AP enables FILS Discovery | 2237 | # If fils_discovery_max_interval is non-zero, the AP enables FILS Discovery |
| 4192 | 2043 | # frame transmission. These values use TUs as the unit and have allowed range | 2238 | # frame transmission. These values use TUs as the unit and have allowed range |
| 4193 | 2044 | # of 0-10000. fils_discovery_min_interval defaults to 20. | 2239 | # of 0-10000. fils_discovery_min_interval defaults to 20. |
| 4194 | 2240 | # This feature is currently supported only when ieee80211ax is enabled for | ||
| 4195 | 2241 | # the radio and disable_11ax is not set for the BSS. | ||
| 4196 | 2045 | #fils_discovery_min_interval=20 | 2242 | #fils_discovery_min_interval=20 |
| 4197 | 2046 | #fils_discovery_max_interval=0 | 2243 | #fils_discovery_max_interval=0 |
| 4198 | 2047 | 2244 | ||
| 4199 | @@ -2077,6 +2274,30 @@ own_ip_addr=127.0.0.1 | |||
| 4200 | 2077 | # (default: 10 TUs) | 2274 | # (default: 10 TUs) |
| 4201 | 2078 | #pasn_comeback_after=10 | 2275 | #pasn_comeback_after=10 |
| 4202 | 2079 | 2276 | ||
| 4203 | 2277 | # Unauthenticated PASN activated (dot11NoAuthPASNActivated) | ||
| 4204 | 2278 | # This indicates whether PASN without mutual authentication is allowed. | ||
| 4205 | 2279 | # (default: 1 = activated) | ||
| 4206 | 2280 | #pasn_noauth=1 | ||
| 4207 | 2281 | |||
| 4208 | 2282 | # SSID protection in 4-way handshake | ||
| 4209 | 2283 | # The IEEE 802.11i-2004 RSN design did not provide means for protecting the | ||
| 4210 | 2284 | # SSID in the general case. IEEE P802.11REVme/D6.0 added support for this in | ||
| 4211 | 2285 | # 4-way handshake. This capability allows a STA to confirm that the AP has the | ||
| 4212 | 2286 | # same understanding on which SSID is being used for an association in a | ||
| 4213 | 2287 | # protected manner in cases where both the AP and the STA has this capability. | ||
| 4214 | 2288 | # This can be used to mitigate CVE-2023-52424 (a.k.a. the SSID Confusion | ||
| 4215 | 2289 | # Attack). | ||
| 4216 | 2290 | # | ||
| 4217 | 2291 | # Ideally, this capability would be enabled by default on the AP, but since this | ||
| 4218 | 2292 | # is new functionality with limited testing, the default is to disable this for | ||
| 4219 | 2293 | # now and require explicitly configuration to enable. The default behavior is | ||
| 4220 | 2294 | # like to change once this capability has received more testing. | ||
| 4221 | 2295 | # | ||
| 4222 | 2296 | # 0 = SSID protection in 4-way handshake disabled (default) | ||
| 4223 | 2297 | # 1 = SSID protection in 4-way handshake enabled | ||
| 4224 | 2298 | # | ||
| 4225 | 2299 | #ssid_protection=0 | ||
| 4226 | 2300 | |||
| 4227 | 2080 | ##### IEEE 802.11r configuration ############################################## | 2301 | ##### IEEE 802.11r configuration ############################################## |
| 4228 | 2081 | 2302 | ||
| 4229 | 2082 | # Mobility Domain identifier (dot11FTMobilityDomainID, MDID) | 2303 | # Mobility Domain identifier (dot11FTMobilityDomainID, MDID) |
| 4230 | @@ -2136,6 +2357,12 @@ own_ip_addr=127.0.0.1 | |||
| 4231 | 2136 | # list and thus will receive push notifications. | 2357 | # list and thus will receive push notifications. |
| 4232 | 2137 | #r1kh=00:00:00:00:00:00 00:00:00:00:00:00 00112233445566778899aabbccddeeff | 2358 | #r1kh=00:00:00:00:00:00 00:00:00:00:00:00 00112233445566778899aabbccddeeff |
| 4233 | 2138 | 2359 | ||
| 4234 | 2360 | # Optionally, the list of RxKHs can be read from a text file. Format is the same | ||
| 4235 | 2361 | # as specified above. File shall contain both r0kh and r1kh. Once this variable | ||
| 4236 | 2362 | # is set, RxKHs can be reloaded at runtime without bringing down an interface | ||
| 4237 | 2363 | # using the RELOAD_RXKHS command. | ||
| 4238 | 2364 | #rxkh_file=<path> | ||
| 4239 | 2365 | |||
| 4240 | 2139 | # Timeout (seconds) for newly discovered R0KH/R1KH (see wildcard entries above) | 2366 | # Timeout (seconds) for newly discovered R0KH/R1KH (see wildcard entries above) |
| 4241 | 2140 | # Special values: 0 -> do not expire | 2367 | # Special values: 0 -> do not expire |
| 4242 | 2141 | # Warning: do not cache implies no sequence number validation with wildcards | 2368 | # Warning: do not cache implies no sequence number validation with wildcards |
| 4243 | @@ -2390,6 +2617,23 @@ own_ip_addr=127.0.0.1 | |||
| 4244 | 2390 | #multi_ap_backhaul_wpa_psk=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef | 2617 | #multi_ap_backhaul_wpa_psk=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef |
| 4245 | 2391 | #multi_ap_backhaul_wpa_passphrase=secret passphrase | 2618 | #multi_ap_backhaul_wpa_passphrase=secret passphrase |
| 4246 | 2392 | 2619 | ||
| 4247 | 2620 | # Multi-AP Profile | ||
| 4248 | 2621 | # Indicate the supported Multi-AP profile (default: 2) | ||
| 4249 | 2622 | # 1 = Supports Multi-AP profile 1 as defined in Wi-Fi EasyMesh specification | ||
| 4250 | 2623 | # 2 = Supports Multi-AP profile 2 as defined in Wi-Fi EasyMesh specification | ||
| 4251 | 2624 | #multi_ap_profile=2 | ||
| 4252 | 2625 | |||
| 4253 | 2626 | # Multi-AP client disallow | ||
| 4254 | 2627 | # Used to disallow profile specific backhaul STA association | ||
| 4255 | 2628 | # Bitmap of the disallowed Profile-X profiles | ||
| 4256 | 2629 | # 1 = Profile-1 Backhaul STA association disallowed | ||
| 4257 | 2630 | # 2 = Profile-2 Backhaul STA association disallowed | ||
| 4258 | 2631 | #multi_ap_client_disallow=0 | ||
| 4259 | 2632 | |||
| 4260 | 2633 | # Multi-AP VLAN ID | ||
| 4261 | 2634 | # A valid non-zero VLAN ID will be used to update Default IEEE 802.1Q Setting | ||
| 4262 | 2635 | #multi_ap_vlanid=0 | ||
| 4263 | 2636 | |||
| 4264 | 2393 | # WPS UPnP interface | 2637 | # WPS UPnP interface |
| 4265 | 2394 | # If set, support for external Registrars is enabled. | 2638 | # If set, support for external Registrars is enabled. |
| 4266 | 2395 | #upnp_iface=br0 | 2639 | #upnp_iface=br0 |
| 4267 | @@ -2453,12 +2697,24 @@ own_ip_addr=127.0.0.1 | |||
| 4268 | 2453 | # MUD URL for Enrollee's DPP Configuration Request (optional) | 2697 | # MUD URL for Enrollee's DPP Configuration Request (optional) |
| 4269 | 2454 | #dpp_mud_url=https://example.com/mud | 2698 | #dpp_mud_url=https://example.com/mud |
| 4270 | 2455 | 2699 | ||
| 4271 | 2700 | # JSON node name of additional data for Enrollee's DPP Configuration Request | ||
| 4272 | 2701 | #dpp_extra_conf_req_name=org.example | ||
| 4273 | 2702 | |||
| 4274 | 2703 | # JSON node data of additional data for Enrollee's DPP Configuration Request | ||
| 4275 | 2704 | #dpp_extra_conf_req_value="abc":123 | ||
| 4276 | 2705 | |||
| 4277 | 2456 | #dpp_connector | 2706 | #dpp_connector |
| 4278 | 2457 | #dpp_netaccesskey | 2707 | #dpp_netaccesskey |
| 4279 | 2458 | #dpp_netaccesskey_expiry | 2708 | #dpp_netaccesskey_expiry |
| 4280 | 2459 | #dpp_csign | 2709 | #dpp_csign |
| 4281 | 2460 | #dpp_controller | 2710 | #dpp_controller |
| 4282 | 2461 | 2711 | ||
| 4283 | 2712 | # DPP Relay port number | ||
| 4284 | 2713 | # TCP port to listen to for incoming connections from a Controller. This can be | ||
| 4285 | 2714 | # used to allow Controller initiated exchanges in addition to the | ||
| 4286 | 2715 | # Controller-as-responder cases covered by the dpp_controller parameter. | ||
| 4287 | 2716 | #dpp_relay_port=12345 | ||
| 4288 | 2717 | |||
| 4289 | 2462 | # Configurator Connectivity indication | 2718 | # Configurator Connectivity indication |
| 4290 | 2463 | # 0: no Configurator is currently connected (default) | 2719 | # 0: no Configurator is currently connected (default) |
| 4291 | 2464 | # 1: advertise that a Configurator is available | 2720 | # 1: advertise that a Configurator is available |
| 4292 | @@ -2726,7 +2982,12 @@ own_ip_addr=127.0.0.1 | |||
| 4293 | 2726 | # If the RADIUS server indicates that the station is not allowed to connect to | 2982 | # If the RADIUS server indicates that the station is not allowed to connect to |
| 4294 | 2727 | # the BSS/ESS, the AP can allow the station some time to download a | 2983 | # the BSS/ESS, the AP can allow the station some time to download a |
| 4295 | 2728 | # notification page (URL included in the message). This parameter sets that | 2984 | # notification page (URL included in the message). This parameter sets that |
| 4297 | 2729 | # timeout in seconds. | 2985 | # timeout in seconds. If the RADIUS server provides no URL, this value is |
| 4298 | 2986 | # reduced to two seconds with an additional trigger for immediate | ||
| 4299 | 2987 | # deauthentication when the STA acknowledges reception of the deauthentication | ||
| 4300 | 2988 | # imminent indication. Note that setting this value to 0 will prevent delivery | ||
| 4301 | 2989 | # of the notification to the STA, so a value of at least 1 should be used here | ||
| 4302 | 2990 | # for normal use cases. | ||
| 4303 | 2730 | #hs20_deauth_req_timeout=60 | 2991 | #hs20_deauth_req_timeout=60 |
| 4304 | 2731 | 2992 | ||
| 4305 | 2732 | # Operator Friendly Name | 2993 | # Operator Friendly Name |
| 4306 | @@ -2906,6 +3167,9 @@ own_ip_addr=127.0.0.1 | |||
| 4307 | 2906 | # Enable neighbor report via radio measurements | 3167 | # Enable neighbor report via radio measurements |
| 4308 | 2907 | #rrm_neighbor_report=1 | 3168 | #rrm_neighbor_report=1 |
| 4309 | 2908 | 3169 | ||
| 4310 | 3170 | # Enable link measurement report via radio measurements | ||
| 4311 | 3171 | #rrm_link_measurement_report=1 | ||
| 4312 | 3172 | |||
| 4313 | 2909 | # Enable beacon report via radio measurements | 3173 | # Enable beacon report via radio measurements |
| 4314 | 2910 | #rrm_beacon_report=1 | 3174 | #rrm_beacon_report=1 |
| 4315 | 2911 | 3175 | ||
| 4316 | @@ -3002,6 +3266,18 @@ own_ip_addr=127.0.0.1 | |||
| 4317 | 3002 | # Include only ECSA IE without CSA IE where possible | 3266 | # Include only ECSA IE without CSA IE where possible |
| 4318 | 3003 | # (channel switch operating class is needed) | 3267 | # (channel switch operating class is needed) |
| 4319 | 3004 | #ecsa_ie_only=0 | 3268 | #ecsa_ie_only=0 |
| 4320 | 3269 | # | ||
| 4321 | 3270 | # Delay EAPOL-Key messages 1/4 and 3/4 by not sending the frame until the last | ||
| 4322 | 3271 | # attempt (wpa_pairwise_update_count). This will trigger a timeout on all | ||
| 4323 | 3272 | # previous attempts and thus delays the frame. (testing only) | ||
| 4324 | 3273 | #delay_eapol_tx=0 | ||
| 4325 | 3274 | # | ||
| 4326 | 3275 | # Additional elements for Probe Response frames. | ||
| 4327 | 3276 | # This parameter can be used to add additional element(s) to the end of the | ||
| 4328 | 3277 | # Probe Response frames. The format for these element(s) is a hexdump of the | ||
| 4329 | 3278 | # raw information elements (id+len+payload for one or more elements). | ||
| 4330 | 3279 | # These elements are added after the 'vendor_elements'. | ||
| 4331 | 3280 | #presp_elements= | ||
| 4332 | 3005 | 3281 | ||
| 4333 | 3006 | ##### Multiple BSSID support ################################################## | 3282 | ##### Multiple BSSID support ################################################## |
| 4334 | 3007 | # | 3283 | # |
| 4335 | @@ -3045,3 +3321,63 @@ own_ip_addr=127.0.0.1 | |||
| 4336 | 3045 | #bss=wlan0_1 | 3321 | #bss=wlan0_1 |
| 4337 | 3046 | #bssid=00:13:10:95:fe:0b | 3322 | #bssid=00:13:10:95:fe:0b |
| 4338 | 3047 | # ... | 3323 | # ... |
| 4339 | 3324 | # | ||
| 4340 | 3325 | # Multiple BSSID Advertisement in IEEE 802.11ax | ||
| 4341 | 3326 | # IEEE Std 802.11ax-2021 added a feature where instead of multiple interfaces | ||
| 4342 | 3327 | # on a common radio transmitting individual Beacon frames, those interfaces can | ||
| 4343 | 3328 | # form a set with a common Beacon frame transmitted for all. The interface | ||
| 4344 | 3329 | # which is brought up first is called the transmitting profile of the MBSSID | ||
| 4345 | 3330 | # set which transmits the Beacon frames. The remaining interfaces are called | ||
| 4346 | 3331 | # the non-transmitting profiles and these are advertised inside the Multiple | ||
| 4347 | 3332 | # BSSID element in the Beacon and Probe Response frames from the first | ||
| 4348 | 3333 | # interface. | ||
| 4349 | 3334 | # | ||
| 4350 | 3335 | # The transmitting interface is visible to all stations in the vicinity, however | ||
| 4351 | 3336 | # the stations that do not support parsing of the Multiple BSSID element will | ||
| 4352 | 3337 | # not be able to connect to the non-transmitting interfaces. | ||
| 4353 | 3338 | # | ||
| 4354 | 3339 | # Enhanced Multiple BSSID Advertisements (EMA) | ||
| 4355 | 3340 | # When enabled, the non-transmitting interfaces are split into multiple | ||
| 4356 | 3341 | # Beacon frames. The number of Beacon frames required to cover all the | ||
| 4357 | 3342 | # non-transmitting profiles is called the profile periodicity. | ||
| 4358 | 3343 | # | ||
| 4359 | 3344 | # Refer to IEEE Std 802.11-2020 for details regarding the procedure and | ||
| 4360 | 3345 | # required MAC address assignment. | ||
| 4361 | 3346 | # | ||
| 4362 | 3347 | # Following configuration is per radio. | ||
| 4363 | 3348 | # 0 = Disabled (default) | ||
| 4364 | 3349 | # 1 = Multiple BSSID advertisement enabled. | ||
| 4365 | 3350 | # 2 = Enhanced multiple BSSID advertisement enabled. | ||
| 4366 | 3351 | #mbssid=0 | ||
| 4367 | 3352 | # | ||
| 4368 | 3353 | # The transmitting interface should be added with the 'interface' option while | ||
| 4369 | 3354 | # the non-transmitting interfaces should be added using the 'bss' option. | ||
| 4370 | 3355 | # Security configuration should be added separately per interface, if required. | ||
| 4371 | 3356 | # | ||
| 4372 | 3357 | # Example: | ||
| 4373 | 3358 | #mbssid=2 | ||
| 4374 | 3359 | #interface=wlan2 | ||
| 4375 | 3360 | #ctrl_interface=/var/run/hostapd | ||
| 4376 | 3361 | #wpa_passphrase=0123456789 | ||
| 4377 | 3362 | #ieee80211w=2 | ||
| 4378 | 3363 | #sae_pwe=1 | ||
| 4379 | 3364 | #auth_algs=1 | ||
| 4380 | 3365 | #wpa=2 | ||
| 4381 | 3366 | #wpa_pairwise=CCMP | ||
| 4382 | 3367 | #ssid=<SSID-0> | ||
| 4383 | 3368 | #bridge=br-lan | ||
| 4384 | 3369 | #wpa_key_mgmt=SAE | ||
| 4385 | 3370 | #bssid=00:03:7f:12:84:84 | ||
| 4386 | 3371 | # | ||
| 4387 | 3372 | #bss=wlan2-1 | ||
| 4388 | 3373 | #ctrl_interface=/var/run/hostapd | ||
| 4389 | 3374 | #wpa_passphrase=0123456789 | ||
| 4390 | 3375 | #ieee80211w=2 | ||
| 4391 | 3376 | #sae_pwe=1 | ||
| 4392 | 3377 | #auth_algs=1 | ||
| 4393 | 3378 | #wpa=2 | ||
| 4394 | 3379 | #wpa_pairwise=CCMP | ||
| 4395 | 3380 | #ssid=<SSID-1> | ||
| 4396 | 3381 | #bridge=br-lan | ||
| 4397 | 3382 | #wpa_key_mgmt=SAE | ||
| 4398 | 3383 | #bssid=00:03:7f:12:84:85 | ||
| 4399 | diff --git a/hostapd/hostapd.eap_user b/hostapd/hostapd.eap_user | |||
| 4400 | index 00edc95..61ef937 100644 | |||
| 4401 | --- a/hostapd/hostapd.eap_user | |||
| 4402 | +++ b/hostapd/hostapd.eap_user | |||
| 4403 | @@ -52,8 +52,8 @@ | |||
| 4404 | 52 | # Arbitrary RADIUS attributes can be added into Access-Accept packets similarly | 52 | # Arbitrary RADIUS attributes can be added into Access-Accept packets similarly |
| 4405 | 53 | # to the way radius_auth_req_attr is used for Access-Request packet in | 53 | # to the way radius_auth_req_attr is used for Access-Request packet in |
| 4406 | 54 | # hostapd.conf. For EAP server, this is configured separately for each user | 54 | # hostapd.conf. For EAP server, this is configured separately for each user |
| 4409 | 55 | # entry with radius_accept_attr=<value> line(s) following the main user entry | 55 | # entry with radius_accept_attr=<attr_id>[:<syntax:value>] line(s) following |
| 4410 | 56 | # line. | 56 | # the main user entry line. |
| 4411 | 57 | 57 | ||
| 4412 | 58 | # Phase 1 users | 58 | # Phase 1 users |
| 4413 | 59 | "user" MD5 "password" | 59 | "user" MD5 "password" |
| 4414 | diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c | |||
| 4415 | index 2609121..eb8a383 100644 | |||
| 4416 | --- a/hostapd/hostapd_cli.c | |||
| 4417 | +++ b/hostapd/hostapd_cli.c | |||
| 4418 | @@ -21,7 +21,7 @@ | |||
| 4419 | 21 | 21 | ||
| 4420 | 22 | static const char *const hostapd_cli_version = | 22 | static const char *const hostapd_cli_version = |
| 4421 | 23 | "hostapd_cli v" VERSION_STR "\n" | 23 | "hostapd_cli v" VERSION_STR "\n" |
| 4423 | 24 | "Copyright (c) 2004-2022, Jouni Malinen <j@w1.fi> and contributors"; | 24 | "Copyright (c) 2004-2024, Jouni Malinen <j@w1.fi> and contributors"; |
| 4424 | 25 | 25 | ||
| 4425 | 26 | static struct wpa_ctrl *ctrl_conn; | 26 | static struct wpa_ctrl *ctrl_conn; |
| 4426 | 27 | static int hostapd_cli_quit = 0; | 27 | static int hostapd_cli_quit = 0; |
| 4427 | @@ -252,6 +252,13 @@ static int hostapd_cli_cmd_relog(struct wpa_ctrl *ctrl, int argc, char *argv[]) | |||
| 4428 | 252 | } | 252 | } |
| 4429 | 253 | 253 | ||
| 4430 | 254 | 254 | ||
| 4431 | 255 | static int hostapd_cli_cmd_close_log(struct wpa_ctrl *ctrl, int argc, | ||
| 4432 | 256 | char *argv[]) | ||
| 4433 | 257 | { | ||
| 4434 | 258 | return wpa_ctrl_command(ctrl, "CLOSE_LOG"); | ||
| 4435 | 259 | } | ||
| 4436 | 260 | |||
| 4437 | 261 | |||
| 4438 | 255 | static int hostapd_cli_cmd_status(struct wpa_ctrl *ctrl, int argc, char *argv[]) | 262 | static int hostapd_cli_cmd_status(struct wpa_ctrl *ctrl, int argc, char *argv[]) |
| 4439 | 256 | { | 263 | { |
| 4440 | 257 | if (argc > 0 && os_strcmp(argv[0], "driver") == 0) | 264 | if (argc > 0 && os_strcmp(argv[0], "driver") == 0) |
| 4441 | @@ -307,6 +314,12 @@ static void hostapd_cli_action_process(char *msg, size_t len) | |||
| 4442 | 307 | } | 314 | } |
| 4443 | 308 | 315 | ||
| 4444 | 309 | 316 | ||
| 4445 | 317 | static void hostapd_cli_action_cb(char *msg, size_t len) | ||
| 4446 | 318 | { | ||
| 4447 | 319 | hostapd_cli_action_process(msg, len); | ||
| 4448 | 320 | } | ||
| 4449 | 321 | |||
| 4450 | 322 | |||
| 4451 | 310 | static int hostapd_cli_cmd_sta(struct wpa_ctrl *ctrl, int argc, char *argv[]) | 323 | static int hostapd_cli_cmd_sta(struct wpa_ctrl *ctrl, int argc, char *argv[]) |
| 4452 | 311 | { | 324 | { |
| 4453 | 312 | char buf[64]; | 325 | char buf[64]; |
| 4454 | @@ -1155,6 +1168,15 @@ static int hostapd_cli_cmd_fst(struct wpa_ctrl *ctrl, int argc, char *argv[]) | |||
| 4455 | 1155 | #endif /* CONFIG_FST */ | 1168 | #endif /* CONFIG_FST */ |
| 4456 | 1156 | 1169 | ||
| 4457 | 1157 | 1170 | ||
| 4458 | 1171 | #ifdef CONFIG_IEEE80211AX | ||
| 4459 | 1172 | static int hostapd_cli_cmd_color_change(struct wpa_ctrl *ctrl, | ||
| 4460 | 1173 | int argc, char *argv[]) | ||
| 4461 | 1174 | { | ||
| 4462 | 1175 | return hostapd_cli_cmd(ctrl, "COLOR_CHANGE", 1, argc, argv); | ||
| 4463 | 1176 | } | ||
| 4464 | 1177 | #endif /* CONFIG_IEEE80211AX */ | ||
| 4465 | 1178 | |||
| 4466 | 1179 | |||
| 4467 | 1158 | static int hostapd_cli_cmd_chan_switch(struct wpa_ctrl *ctrl, | 1180 | static int hostapd_cli_cmd_chan_switch(struct wpa_ctrl *ctrl, |
| 4468 | 1159 | int argc, char *argv[]) | 1181 | int argc, char *argv[]) |
| 4469 | 1160 | { | 1182 | { |
| 4470 | @@ -1169,7 +1191,7 @@ static int hostapd_cli_cmd_chan_switch(struct wpa_ctrl *ctrl, | |||
| 4471 | 1169 | "arguments (count and freq)\n" | 1191 | "arguments (count and freq)\n" |
| 4472 | 1170 | "usage: <cs_count> <freq> [sec_channel_offset=] " | 1192 | "usage: <cs_count> <freq> [sec_channel_offset=] " |
| 4473 | 1171 | "[center_freq1=] [center_freq2=] [bandwidth=] " | 1193 | "[center_freq1=] [center_freq2=] [bandwidth=] " |
| 4475 | 1172 | "[blocktx] [ht|vht]\n"); | 1194 | "[blocktx] [ht|vht|he|eht]\n"); |
| 4476 | 1173 | return -1; | 1195 | return -1; |
| 4477 | 1174 | } | 1196 | } |
| 4478 | 1175 | 1197 | ||
| 4479 | @@ -1194,34 +1216,76 @@ static int hostapd_cli_cmd_chan_switch(struct wpa_ctrl *ctrl, | |||
| 4480 | 1194 | } | 1216 | } |
| 4481 | 1195 | 1217 | ||
| 4482 | 1196 | 1218 | ||
| 4483 | 1219 | static int hostapd_cli_cmd_notify_cw_change(struct wpa_ctrl *ctrl, | ||
| 4484 | 1220 | int argc, char *argv[]) | ||
| 4485 | 1221 | { | ||
| 4486 | 1222 | return hostapd_cli_cmd(ctrl, "NOTIFY_CW_CHANGE", 1, argc, argv); | ||
| 4487 | 1223 | } | ||
| 4488 | 1224 | |||
| 4489 | 1225 | |||
| 4490 | 1197 | static int hostapd_cli_cmd_enable(struct wpa_ctrl *ctrl, int argc, | 1226 | static int hostapd_cli_cmd_enable(struct wpa_ctrl *ctrl, int argc, |
| 4492 | 1198 | char *argv[]) | 1227 | char *argv[]) |
| 4493 | 1199 | { | 1228 | { |
| 4494 | 1200 | return wpa_ctrl_command(ctrl, "ENABLE"); | 1229 | return wpa_ctrl_command(ctrl, "ENABLE"); |
| 4495 | 1201 | } | 1230 | } |
| 4496 | 1202 | 1231 | ||
| 4497 | 1203 | 1232 | ||
| 4498 | 1204 | static int hostapd_cli_cmd_reload(struct wpa_ctrl *ctrl, int argc, | 1233 | static int hostapd_cli_cmd_reload(struct wpa_ctrl *ctrl, int argc, |
| 4500 | 1205 | char *argv[]) | 1234 | char *argv[]) |
| 4501 | 1206 | { | 1235 | { |
| 4502 | 1207 | return wpa_ctrl_command(ctrl, "RELOAD"); | 1236 | return wpa_ctrl_command(ctrl, "RELOAD"); |
| 4503 | 1208 | } | 1237 | } |
| 4504 | 1209 | 1238 | ||
| 4505 | 1210 | 1239 | ||
| 4507 | 1211 | static int hostapd_cli_cmd_disable(struct wpa_ctrl *ctrl, int argc, | 1240 | static int hostapd_cli_cmd_reload_bss(struct wpa_ctrl *ctrl, int argc, |
| 4508 | 1212 | char *argv[]) | 1241 | char *argv[]) |
| 4509 | 1213 | { | 1242 | { |
| 4510 | 1243 | return wpa_ctrl_command(ctrl, "RELOAD_BSS"); | ||
| 4511 | 1244 | } | ||
| 4512 | 1245 | |||
| 4513 | 1246 | |||
| 4514 | 1247 | static int hostapd_cli_cmd_reload_config(struct wpa_ctrl *ctrl, int argc, | ||
| 4515 | 1248 | char *argv[]) | ||
| 4516 | 1249 | { | ||
| 4517 | 1250 | return wpa_ctrl_command(ctrl, "RELOAD_CONFIG"); | ||
| 4518 | 1251 | } | ||
| 4519 | 1252 | |||
| 4520 | 1253 | |||
| 4521 | 1254 | static int hostapd_cli_cmd_disable(struct wpa_ctrl *ctrl, int argc, | ||
| 4522 | 1255 | char *argv[]) | ||
| 4523 | 1256 | { | ||
| 4524 | 1214 | return wpa_ctrl_command(ctrl, "DISABLE"); | 1257 | return wpa_ctrl_command(ctrl, "DISABLE"); |
| 4525 | 1215 | } | 1258 | } |
| 4526 | 1216 | 1259 | ||
| 4527 | 1217 | 1260 | ||
| 4529 | 1218 | static int hostapd_cli_cmd_update_beacon(struct wpa_ctrl *ctrl, int argc, | 1261 | static int hostapd_cli_cmd_enable_mld(struct wpa_ctrl *ctrl, int argc, |
| 4530 | 1219 | char *argv[]) | 1262 | char *argv[]) |
| 4531 | 1220 | { | 1263 | { |
| 4532 | 1264 | return wpa_ctrl_command(ctrl, "ENABLE_MLD"); | ||
| 4533 | 1265 | } | ||
| 4534 | 1266 | |||
| 4535 | 1267 | |||
| 4536 | 1268 | static int hostapd_cli_cmd_disable_mld(struct wpa_ctrl *ctrl, int argc, | ||
| 4537 | 1269 | char *argv[]) | ||
| 4538 | 1270 | { | ||
| 4539 | 1271 | return wpa_ctrl_command(ctrl, "DISABLE_MLD"); | ||
| 4540 | 1272 | } | ||
| 4541 | 1273 | |||
| 4542 | 1274 | |||
| 4543 | 1275 | static int hostapd_cli_cmd_update_beacon(struct wpa_ctrl *ctrl, int argc, | ||
| 4544 | 1276 | char *argv[]) | ||
| 4545 | 1277 | { | ||
| 4546 | 1221 | return wpa_ctrl_command(ctrl, "UPDATE_BEACON"); | 1278 | return wpa_ctrl_command(ctrl, "UPDATE_BEACON"); |
| 4547 | 1222 | } | 1279 | } |
| 4548 | 1223 | 1280 | ||
| 4549 | 1224 | 1281 | ||
| 4550 | 1282 | static int hostapd_cli_cmd_stop_ap(struct wpa_ctrl *ctrl, int argc, | ||
| 4551 | 1283 | char *argv[]) | ||
| 4552 | 1284 | { | ||
| 4553 | 1285 | return wpa_ctrl_command(ctrl, "STOP_AP"); | ||
| 4554 | 1286 | } | ||
| 4555 | 1287 | |||
| 4556 | 1288 | |||
| 4557 | 1225 | static int hostapd_cli_cmd_vendor(struct wpa_ctrl *ctrl, int argc, char *argv[]) | 1289 | static int hostapd_cli_cmd_vendor(struct wpa_ctrl *ctrl, int argc, char *argv[]) |
| 4558 | 1226 | { | 1290 | { |
| 4559 | 1227 | char cmd[256]; | 1291 | char cmd[256]; |
| 4560 | @@ -1366,6 +1430,13 @@ static int hostapd_cli_cmd_driver_flags(struct wpa_ctrl *ctrl, int argc, | |||
| 4561 | 1366 | } | 1430 | } |
| 4562 | 1367 | 1431 | ||
| 4563 | 1368 | 1432 | ||
| 4564 | 1433 | static int hostapd_cli_cmd_driver_flags2(struct wpa_ctrl *ctrl, int argc, | ||
| 4565 | 1434 | char *argv[]) | ||
| 4566 | 1435 | { | ||
| 4567 | 1436 | return wpa_ctrl_command(ctrl, "DRIVER_FLAGS2"); | ||
| 4568 | 1437 | } | ||
| 4569 | 1438 | |||
| 4570 | 1439 | |||
| 4571 | 1369 | #ifdef CONFIG_DPP | 1440 | #ifdef CONFIG_DPP |
| 4572 | 1370 | 1441 | ||
| 4573 | 1371 | static int hostapd_cli_cmd_dpp_qr_code(struct wpa_ctrl *ctrl, int argc, | 1442 | static int hostapd_cli_cmd_dpp_qr_code(struct wpa_ctrl *ctrl, int argc, |
| 4574 | @@ -1478,7 +1549,7 @@ static int hostapd_cli_cmd_dpp_pkex_remove(struct wpa_ctrl *ctrl, int argc, | |||
| 4575 | 1478 | static int hostapd_cli_cmd_dpp_controller_start(struct wpa_ctrl *ctrl, int argc, | 1549 | static int hostapd_cli_cmd_dpp_controller_start(struct wpa_ctrl *ctrl, int argc, |
| 4576 | 1479 | char *argv[]) | 1550 | char *argv[]) |
| 4577 | 1480 | { | 1551 | { |
| 4579 | 1481 | return hostapd_cli_cmd(ctrl, "DPP_CONTROLLER_START", 1, argc, argv); | 1552 | return hostapd_cli_cmd(ctrl, "DPP_CONTROLLER_START", 0, argc, argv); |
| 4580 | 1482 | } | 1553 | } |
| 4581 | 1483 | 1554 | ||
| 4582 | 1484 | 1555 | ||
| 4583 | @@ -1503,6 +1574,15 @@ static int hostapd_cli_cmd_dpp_stop_chirp(struct wpa_ctrl *ctrl, int argc, | |||
| 4584 | 1503 | } | 1574 | } |
| 4585 | 1504 | 1575 | ||
| 4586 | 1505 | #endif /* CONFIG_DPP2 */ | 1576 | #endif /* CONFIG_DPP2 */ |
| 4587 | 1577 | |||
| 4588 | 1578 | |||
| 4589 | 1579 | #ifdef CONFIG_DPP3 | ||
| 4590 | 1580 | static int hostapd_cli_cmd_dpp_push_button(struct wpa_ctrl *ctrl, int argc, | ||
| 4591 | 1581 | char *argv[]) | ||
| 4592 | 1582 | { | ||
| 4593 | 1583 | return hostapd_cli_cmd(ctrl, "DPP_PUSH_BUTTON", 0, argc, argv); | ||
| 4594 | 1584 | } | ||
| 4595 | 1585 | #endif /* CONFIG_DPP3 */ | ||
| 4596 | 1506 | #endif /* CONFIG_DPP */ | 1586 | #endif /* CONFIG_DPP */ |
| 4597 | 1507 | 1587 | ||
| 4598 | 1508 | 1588 | ||
| 4599 | @@ -1534,6 +1614,13 @@ static int hostapd_cli_cmd_req_beacon(struct wpa_ctrl *ctrl, int argc, | |||
| 4600 | 1534 | } | 1614 | } |
| 4601 | 1535 | 1615 | ||
| 4602 | 1536 | 1616 | ||
| 4603 | 1617 | static int hostapd_cli_cmd_req_link_measurement(struct wpa_ctrl *ctrl, int argc, | ||
| 4604 | 1618 | char *argv[]) | ||
| 4605 | 1619 | { | ||
| 4606 | 1620 | return hostapd_cli_cmd(ctrl, "REQ_LINK_MEASUREMENT", 1, argc, argv); | ||
| 4607 | 1621 | } | ||
| 4608 | 1622 | |||
| 4609 | 1623 | |||
| 4610 | 1537 | static int hostapd_cli_cmd_reload_wpa_psk(struct wpa_ctrl *ctrl, int argc, | 1624 | static int hostapd_cli_cmd_reload_wpa_psk(struct wpa_ctrl *ctrl, int argc, |
| 4611 | 1538 | char *argv[]) | 1625 | char *argv[]) |
| 4612 | 1539 | { | 1626 | { |
| 4613 | @@ -1541,6 +1628,24 @@ static int hostapd_cli_cmd_reload_wpa_psk(struct wpa_ctrl *ctrl, int argc, | |||
| 4614 | 1541 | } | 1628 | } |
| 4615 | 1542 | 1629 | ||
| 4616 | 1543 | 1630 | ||
| 4617 | 1631 | #ifdef CONFIG_IEEE80211R_AP | ||
| 4618 | 1632 | |||
| 4619 | 1633 | static int hostapd_cli_cmd_get_rxkhs(struct wpa_ctrl *ctrl, int argc, | ||
| 4620 | 1634 | char *argv[]) | ||
| 4621 | 1635 | { | ||
| 4622 | 1636 | return wpa_ctrl_command(ctrl, "GET_RXKHS"); | ||
| 4623 | 1637 | } | ||
| 4624 | 1638 | |||
| 4625 | 1639 | |||
| 4626 | 1640 | static int hostapd_cli_cmd_reload_rxkhs(struct wpa_ctrl *ctrl, int argc, | ||
| 4627 | 1641 | char *argv[]) | ||
| 4628 | 1642 | { | ||
| 4629 | 1643 | return wpa_ctrl_command(ctrl, "RELOAD_RXKHS"); | ||
| 4630 | 1644 | } | ||
| 4631 | 1645 | |||
| 4632 | 1646 | #endif /* CONFIG_IEEE80211R_AP */ | ||
| 4633 | 1647 | |||
| 4634 | 1648 | |||
| 4635 | 1544 | #ifdef ANDROID | 1649 | #ifdef ANDROID |
| 4636 | 1545 | static int hostapd_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[]) | 1650 | static int hostapd_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[]) |
| 4637 | 1546 | { | 1651 | { |
| 4638 | @@ -1563,6 +1668,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { | |||
| 4639 | 1563 | "= get MIB variables (dot1x, dot11, radius)" }, | 1668 | "= get MIB variables (dot1x, dot11, radius)" }, |
| 4640 | 1564 | { "relog", hostapd_cli_cmd_relog, NULL, | 1669 | { "relog", hostapd_cli_cmd_relog, NULL, |
| 4641 | 1565 | "= reload/truncate debug log output file" }, | 1670 | "= reload/truncate debug log output file" }, |
| 4642 | 1671 | { "close_log", hostapd_cli_cmd_close_log, NULL, | ||
| 4643 | 1672 | "= disable debug log output file" }, | ||
| 4644 | 1566 | { "status", hostapd_cli_cmd_status, NULL, | 1673 | { "status", hostapd_cli_cmd_status, NULL, |
| 4645 | 1567 | "= show interface status info" }, | 1674 | "= show interface status info" }, |
| 4646 | 1568 | { "sta", hostapd_cli_cmd_sta, hostapd_complete_stations, | 1675 | { "sta", hostapd_cli_cmd_sta, hostapd_complete_stations, |
| 4647 | @@ -1648,6 +1755,13 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { | |||
| 4648 | 1648 | "<cs_count> <freq> [sec_channel_offset=] [center_freq1=]\n" | 1755 | "<cs_count> <freq> [sec_channel_offset=] [center_freq1=]\n" |
| 4649 | 1649 | " [center_freq2=] [bandwidth=] [blocktx] [ht|vht]\n" | 1756 | " [center_freq2=] [bandwidth=] [blocktx] [ht|vht]\n" |
| 4650 | 1650 | " = initiate channel switch announcement" }, | 1757 | " = initiate channel switch announcement" }, |
| 4651 | 1758 | #ifdef CONFIG_IEEE80211AX | ||
| 4652 | 1759 | { "color_change", hostapd_cli_cmd_color_change, NULL, | ||
| 4653 | 1760 | "<color> = initiate BSS color change to set the specified color\n" | ||
| 4654 | 1761 | "Value 0 will disable the color.\n"}, | ||
| 4655 | 1762 | #endif /* CONFIG_IEEE80211AX */ | ||
| 4656 | 1763 | { "notify_cw_change", hostapd_cli_cmd_notify_cw_change, NULL, | ||
| 4657 | 1764 | "<channel_width> = 0 - 20 MHz, 1 - 40 MHz, 2 - 80 MHz, 3 - 160 MHz" }, | ||
| 4658 | 1651 | { "hs20_wnm_notif", hostapd_cli_cmd_hs20_wnm_notif, NULL, | 1765 | { "hs20_wnm_notif", hostapd_cli_cmd_hs20_wnm_notif, NULL, |
| 4659 | 1652 | "<addr> <url>\n" | 1766 | "<addr> <url>\n" |
| 4660 | 1653 | " = send WNM-Notification Subscription Remediation Request" }, | 1767 | " = send WNM-Notification Subscription Remediation Request" }, |
| 4661 | @@ -1661,10 +1775,20 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { | |||
| 4662 | 1661 | "= enable hostapd on current interface" }, | 1775 | "= enable hostapd on current interface" }, |
| 4663 | 1662 | { "reload", hostapd_cli_cmd_reload, NULL, | 1776 | { "reload", hostapd_cli_cmd_reload, NULL, |
| 4664 | 1663 | "= reload configuration for current interface" }, | 1777 | "= reload configuration for current interface" }, |
| 4665 | 1778 | { "reload_bss", hostapd_cli_cmd_reload_bss, NULL, | ||
| 4666 | 1779 | "= reload configuration for current BSS" }, | ||
| 4667 | 1780 | { "reload_config", hostapd_cli_cmd_reload_config, NULL, | ||
| 4668 | 1781 | "= reload configuration for current interface" }, | ||
| 4669 | 1664 | { "disable", hostapd_cli_cmd_disable, NULL, | 1782 | { "disable", hostapd_cli_cmd_disable, NULL, |
| 4670 | 1665 | "= disable hostapd on current interface" }, | 1783 | "= disable hostapd on current interface" }, |
| 4671 | 1784 | { "enable_mld", hostapd_cli_cmd_enable_mld, NULL, | ||
| 4672 | 1785 | "= enable AP MLD to which the interface is affiliated" }, | ||
| 4673 | 1786 | { "disable_mld", hostapd_cli_cmd_disable_mld, NULL, | ||
| 4674 | 1787 | "= disable AP MLD to which the interface is affiliated" }, | ||
| 4675 | 1666 | { "update_beacon", hostapd_cli_cmd_update_beacon, NULL, | 1788 | { "update_beacon", hostapd_cli_cmd_update_beacon, NULL, |
| 4676 | 1667 | "= update Beacon frame contents\n"}, | 1789 | "= update Beacon frame contents\n"}, |
| 4677 | 1790 | { "stop_ap", hostapd_cli_cmd_stop_ap, NULL, | ||
| 4678 | 1791 | "= stop AP\n"}, | ||
| 4679 | 1668 | { "erp_flush", hostapd_cli_cmd_erp_flush, NULL, | 1792 | { "erp_flush", hostapd_cli_cmd_erp_flush, NULL, |
| 4680 | 1669 | "= drop all ERP keys"}, | 1793 | "= drop all ERP keys"}, |
| 4681 | 1670 | { "log_level", hostapd_cli_cmd_log_level, NULL, | 1794 | { "log_level", hostapd_cli_cmd_log_level, NULL, |
| 4682 | @@ -1686,6 +1810,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { | |||
| 4683 | 1686 | " = send FTM range request"}, | 1810 | " = send FTM range request"}, |
| 4684 | 1687 | { "driver_flags", hostapd_cli_cmd_driver_flags, NULL, | 1811 | { "driver_flags", hostapd_cli_cmd_driver_flags, NULL, |
| 4685 | 1688 | " = show supported driver flags"}, | 1812 | " = show supported driver flags"}, |
| 4686 | 1813 | { "driver_flags2", hostapd_cli_cmd_driver_flags2, NULL, | ||
| 4687 | 1814 | " = show supported driver flags2"}, | ||
| 4688 | 1689 | #ifdef CONFIG_DPP | 1815 | #ifdef CONFIG_DPP |
| 4689 | 1690 | { "dpp_qr_code", hostapd_cli_cmd_dpp_qr_code, NULL, | 1816 | { "dpp_qr_code", hostapd_cli_cmd_dpp_qr_code, NULL, |
| 4690 | 1691 | "report a scanned DPP URI from a QR Code" }, | 1817 | "report a scanned DPP URI from a QR Code" }, |
| 4691 | @@ -1729,6 +1855,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { | |||
| 4692 | 1729 | { "dpp_stop_chirp", hostapd_cli_cmd_dpp_stop_chirp, NULL, | 1855 | { "dpp_stop_chirp", hostapd_cli_cmd_dpp_stop_chirp, NULL, |
| 4693 | 1730 | "= stop DPP chirp" }, | 1856 | "= stop DPP chirp" }, |
| 4694 | 1731 | #endif /* CONFIG_DPP2 */ | 1857 | #endif /* CONFIG_DPP2 */ |
| 4695 | 1858 | #ifdef CONFIG_DPP3 | ||
| 4696 | 1859 | { "dpp_push_button", hostapd_cli_cmd_dpp_push_button, NULL, | ||
| 4697 | 1860 | "= press DPP push button" }, | ||
| 4698 | 1861 | #endif /* CONFIG_DPP3 */ | ||
| 4699 | 1732 | #endif /* CONFIG_DPP */ | 1862 | #endif /* CONFIG_DPP */ |
| 4700 | 1733 | { "accept_acl", hostapd_cli_cmd_accept_macacl, NULL, | 1863 | { "accept_acl", hostapd_cli_cmd_accept_macacl, NULL, |
| 4701 | 1734 | "=Add/Delete/Show/Clear accept MAC ACL" }, | 1864 | "=Add/Delete/Show/Clear accept MAC ACL" }, |
| 4702 | @@ -1738,8 +1868,16 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { | |||
| 4703 | 1738 | "<addr> = poll a STA to check connectivity with a QoS null frame" }, | 1868 | "<addr> = poll a STA to check connectivity with a QoS null frame" }, |
| 4704 | 1739 | { "req_beacon", hostapd_cli_cmd_req_beacon, NULL, | 1869 | { "req_beacon", hostapd_cli_cmd_req_beacon, NULL, |
| 4705 | 1740 | "<addr> [req_mode=] <measurement request hexdump> = send a Beacon report request to a station" }, | 1870 | "<addr> [req_mode=] <measurement request hexdump> = send a Beacon report request to a station" }, |
| 4706 | 1871 | { "req_link_measurement", hostapd_cli_cmd_req_link_measurement, NULL, | ||
| 4707 | 1872 | "<addr> = send a link measurement report request to a station"}, | ||
| 4708 | 1741 | { "reload_wpa_psk", hostapd_cli_cmd_reload_wpa_psk, NULL, | 1873 | { "reload_wpa_psk", hostapd_cli_cmd_reload_wpa_psk, NULL, |
| 4709 | 1742 | "= reload wpa_psk_file only" }, | 1874 | "= reload wpa_psk_file only" }, |
| 4710 | 1875 | #ifdef CONFIG_IEEE80211R_AP | ||
| 4711 | 1876 | { "reload_rxkhs", hostapd_cli_cmd_reload_rxkhs, NULL, | ||
| 4712 | 1877 | "= reload R0KHs and R1KHs" }, | ||
| 4713 | 1878 | { "get_rxkhs", hostapd_cli_cmd_get_rxkhs, NULL, | ||
| 4714 | 1879 | "= get R0KHs and R1KHs" }, | ||
| 4715 | 1880 | #endif /* CONFIG_IEEE80211R_AP */ | ||
| 4716 | 1743 | #ifdef ANDROID | 1881 | #ifdef ANDROID |
| 4717 | 1744 | { "driver", hostapd_cli_cmd_driver, NULL, | 1882 | { "driver", hostapd_cli_cmd_driver, NULL, |
| 4718 | 1745 | "<driver sub command> [<hex formatted data>] = send driver command data" }, | 1883 | "<driver sub command> [<hex formatted data>] = send driver command data" }, |
| 4719 | @@ -2002,7 +2140,6 @@ static void hostapd_cli_interactive(void) | |||
| 4720 | 2002 | os_snprintf(hfile, hfile_len, "%s/%s", home, fname); | 2140 | os_snprintf(hfile, hfile_len, "%s/%s", home, fname); |
| 4721 | 2003 | } | 2141 | } |
| 4722 | 2004 | 2142 | ||
| 4723 | 2005 | eloop_register_signal_terminate(hostapd_cli_eloop_terminate, NULL); | ||
| 4724 | 2006 | edit_init(hostapd_cli_edit_cmd_cb, hostapd_cli_edit_eof_cb, | 2143 | edit_init(hostapd_cli_edit_cmd_cb, hostapd_cli_edit_eof_cb, |
| 4725 | 2007 | hostapd_cli_edit_completion_cb, NULL, hfile, NULL); | 2144 | hostapd_cli_edit_completion_cb, NULL, hfile, NULL); |
| 4726 | 2008 | eloop_register_timeout(ping_interval, 0, hostapd_cli_ping, NULL, NULL); | 2145 | eloop_register_timeout(ping_interval, 0, hostapd_cli_ping, NULL, NULL); |
| 4727 | @@ -2026,40 +2163,46 @@ static void hostapd_cli_cleanup(void) | |||
| 4728 | 2026 | } | 2163 | } |
| 4729 | 2027 | 2164 | ||
| 4730 | 2028 | 2165 | ||
| 4732 | 2029 | static void hostapd_cli_action(struct wpa_ctrl *ctrl) | 2166 | static void hostapd_cli_action_ping(void *eloop_ctx, void *timeout_ctx) |
| 4733 | 2030 | { | 2167 | { |
| 4737 | 2031 | fd_set rfds; | 2168 | struct wpa_ctrl *ctrl = eloop_ctx; |
| 4735 | 2032 | int fd, res; | ||
| 4736 | 2033 | struct timeval tv; | ||
| 4738 | 2034 | char buf[256]; | 2169 | char buf[256]; |
| 4739 | 2035 | size_t len; | 2170 | size_t len; |
| 4740 | 2036 | 2171 | ||
| 4742 | 2037 | fd = wpa_ctrl_get_fd(ctrl); | 2172 | /* verify that connection is still working */ |
| 4743 | 2173 | len = sizeof(buf) - 1; | ||
| 4744 | 2174 | if (wpa_ctrl_request(ctrl, "PING", 4, buf, &len, | ||
| 4745 | 2175 | hostapd_cli_action_cb) < 0 || | ||
| 4746 | 2176 | len < 4 || os_memcmp(buf, "PONG", 4) != 0) { | ||
| 4747 | 2177 | printf("hostapd did not reply to PING command - exiting\n"); | ||
| 4748 | 2178 | eloop_terminate(); | ||
| 4749 | 2179 | return; | ||
| 4750 | 2180 | } | ||
| 4751 | 2181 | eloop_register_timeout(ping_interval, 0, hostapd_cli_action_ping, | ||
| 4752 | 2182 | ctrl, NULL); | ||
| 4753 | 2183 | } | ||
| 4754 | 2038 | 2184 | ||
| 4755 | 2039 | while (!hostapd_cli_quit) { | ||
| 4756 | 2040 | FD_ZERO(&rfds); | ||
| 4757 | 2041 | FD_SET(fd, &rfds); | ||
| 4758 | 2042 | tv.tv_sec = ping_interval; | ||
| 4759 | 2043 | tv.tv_usec = 0; | ||
| 4760 | 2044 | res = select(fd + 1, &rfds, NULL, NULL, &tv); | ||
| 4761 | 2045 | if (res < 0 && errno != EINTR) { | ||
| 4762 | 2046 | perror("select"); | ||
| 4763 | 2047 | break; | ||
| 4764 | 2048 | } | ||
| 4765 | 2049 | 2185 | ||
| 4779 | 2050 | if (FD_ISSET(fd, &rfds)) | 2186 | static void hostapd_cli_action_receive(int sock, void *eloop_ctx, |
| 4780 | 2051 | hostapd_cli_recv_pending(ctrl, 0, 1); | 2187 | void *sock_ctx) |
| 4781 | 2052 | else { | 2188 | { |
| 4782 | 2053 | len = sizeof(buf) - 1; | 2189 | struct wpa_ctrl *ctrl = eloop_ctx; |
| 4783 | 2054 | if (wpa_ctrl_request(ctrl, "PING", 4, buf, &len, | 2190 | |
| 4784 | 2055 | hostapd_cli_action_process) < 0 || | 2191 | hostapd_cli_recv_pending(ctrl, 0, 1); |
| 4785 | 2056 | len < 4 || os_memcmp(buf, "PONG", 4) != 0) { | 2192 | } |
| 4786 | 2057 | printf("hostapd did not reply to PING " | 2193 | |
| 4787 | 2058 | "command - exiting\n"); | 2194 | |
| 4788 | 2059 | break; | 2195 | static void hostapd_cli_action(struct wpa_ctrl *ctrl) |
| 4789 | 2060 | } | 2196 | { |
| 4790 | 2061 | } | 2197 | int fd; |
| 4791 | 2062 | } | 2198 | |
| 4792 | 2199 | fd = wpa_ctrl_get_fd(ctrl); | ||
| 4793 | 2200 | eloop_register_timeout(ping_interval, 0, hostapd_cli_action_ping, | ||
| 4794 | 2201 | ctrl, NULL); | ||
| 4795 | 2202 | eloop_register_read_sock(fd, hostapd_cli_action_receive, ctrl, NULL); | ||
| 4796 | 2203 | eloop_run(); | ||
| 4797 | 2204 | eloop_cancel_timeout(hostapd_cli_action_ping, ctrl, NULL); | ||
| 4798 | 2205 | eloop_unregister_read_sock(fd); | ||
| 4799 | 2063 | } | 2206 | } |
| 4800 | 2064 | 2207 | ||
| 4801 | 2065 | 2208 | ||
| 4802 | @@ -2162,6 +2305,8 @@ int main(int argc, char *argv[]) | |||
| 4803 | 2162 | continue; | 2305 | continue; |
| 4804 | 2163 | } | 2306 | } |
| 4805 | 2164 | 2307 | ||
| 4806 | 2308 | eloop_register_signal_terminate(hostapd_cli_eloop_terminate, NULL); | ||
| 4807 | 2309 | |||
| 4808 | 2165 | if (action_file && !hostapd_cli_attached) | 2310 | if (action_file && !hostapd_cli_attached) |
| 4809 | 2166 | return -1; | 2311 | return -1; |
| 4810 | 2167 | if (daemonize && os_daemonize(pid_file) && eloop_sock_requeue()) | 2312 | if (daemonize && os_daemonize(pid_file) && eloop_sock_requeue()) |
| 4811 | diff --git a/hostapd/main.c b/hostapd/main.c | |||
| 4812 | index c9ec38d..00e02bb 100644 | |||
| 4813 | --- a/hostapd/main.c | |||
| 4814 | +++ b/hostapd/main.c | |||
| 4815 | @@ -15,6 +15,7 @@ | |||
| 4816 | 15 | #include "utils/common.h" | 15 | #include "utils/common.h" |
| 4817 | 16 | #include "utils/eloop.h" | 16 | #include "utils/eloop.h" |
| 4818 | 17 | #include "utils/uuid.h" | 17 | #include "utils/uuid.h" |
| 4819 | 18 | #include "crypto/crypto.h" | ||
| 4820 | 18 | #include "crypto/random.h" | 19 | #include "crypto/random.h" |
| 4821 | 19 | #include "crypto/tls.h" | 20 | #include "crypto/tls.h" |
| 4822 | 20 | #include "common/version.h" | 21 | #include "common/version.h" |
| 4823 | @@ -157,14 +158,50 @@ static int hostapd_driver_init(struct hostapd_iface *iface) | |||
| 4824 | 157 | struct hostapd_bss_config *conf = hapd->conf; | 158 | struct hostapd_bss_config *conf = hapd->conf; |
| 4825 | 158 | u8 *b = conf->bssid; | 159 | u8 *b = conf->bssid; |
| 4826 | 159 | struct wpa_driver_capa capa; | 160 | struct wpa_driver_capa capa; |
| 4827 | 161 | #ifdef CONFIG_IEEE80211BE | ||
| 4828 | 162 | struct hostapd_data *h_hapd = NULL; | ||
| 4829 | 163 | #endif /* CONFIG_IEEE80211BE */ | ||
| 4830 | 160 | 164 | ||
| 4831 | 161 | if (hapd->driver == NULL || hapd->driver->hapd_init == NULL) { | 165 | if (hapd->driver == NULL || hapd->driver->hapd_init == NULL) { |
| 4832 | 162 | wpa_printf(MSG_ERROR, "No hostapd driver wrapper available"); | 166 | wpa_printf(MSG_ERROR, "No hostapd driver wrapper available"); |
| 4833 | 163 | return -1; | 167 | return -1; |
| 4834 | 164 | } | 168 | } |
| 4835 | 165 | 169 | ||
| 4836 | 170 | #ifdef CONFIG_IEEE80211BE | ||
| 4837 | 171 | if (conf->mld_ap) | ||
| 4838 | 172 | h_hapd = hostapd_mld_get_first_bss(hapd); | ||
| 4839 | 173 | |||
| 4840 | 174 | if (h_hapd) { | ||
| 4841 | 175 | hapd->drv_priv = h_hapd->drv_priv; | ||
| 4842 | 176 | hapd->interface_added = h_hapd->interface_added; | ||
| 4843 | 177 | |||
| 4844 | 178 | /* | ||
| 4845 | 179 | * All interfaces participating in the AP MLD would have | ||
| 4846 | 180 | * the same MLD address, which is the interface hardware | ||
| 4847 | 181 | * address, while the interface address would be | ||
| 4848 | 182 | * derived from the original interface address if BSSID | ||
| 4849 | 183 | * is not configured, and otherwise it would be the | ||
| 4850 | 184 | * configured BSSID. | ||
| 4851 | 185 | */ | ||
| 4852 | 186 | if (is_zero_ether_addr(b)) { | ||
| 4853 | 187 | os_memcpy(hapd->own_addr, h_hapd->mld->mld_addr, | ||
| 4854 | 188 | ETH_ALEN); | ||
| 4855 | 189 | random_mac_addr_keep_oui(hapd->own_addr); | ||
| 4856 | 190 | } else { | ||
| 4857 | 191 | os_memcpy(hapd->own_addr, b, ETH_ALEN); | ||
| 4858 | 192 | } | ||
| 4859 | 193 | |||
| 4860 | 194 | hostapd_mld_add_link(hapd); | ||
| 4861 | 195 | wpa_printf(MSG_DEBUG, | ||
| 4862 | 196 | "Setup of non first link (%d) BSS of MLD %s", | ||
| 4863 | 197 | hapd->mld_link_id, hapd->conf->iface); | ||
| 4864 | 198 | |||
| 4865 | 199 | goto setup_mld; | ||
| 4866 | 200 | } | ||
| 4867 | 201 | #endif /* CONFIG_IEEE80211BE */ | ||
| 4868 | 202 | |||
| 4869 | 166 | /* Initialize the driver interface */ | 203 | /* Initialize the driver interface */ |
| 4871 | 167 | if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5])) | 204 | if (is_zero_ether_addr(b)) |
| 4872 | 168 | b = NULL; | 205 | b = NULL; |
| 4873 | 169 | 206 | ||
| 4874 | 170 | os_memset(¶ms, 0, sizeof(params)); | 207 | os_memset(¶ms, 0, sizeof(params)); |
| 4875 | @@ -188,6 +225,19 @@ static int hostapd_driver_init(struct hostapd_iface *iface) | |||
| 4876 | 188 | break; | 225 | break; |
| 4877 | 189 | } | 226 | } |
| 4878 | 190 | params.bssid = b; | 227 | params.bssid = b; |
| 4879 | 228 | #ifdef CONFIG_IEEE80211BE | ||
| 4880 | 229 | /* | ||
| 4881 | 230 | * Use the configured MLD MAC address as the interface hardware address | ||
| 4882 | 231 | * if this AP is a part of an AP MLD. | ||
| 4883 | 232 | */ | ||
| 4884 | 233 | if (hapd->conf->mld_ap) { | ||
| 4885 | 234 | if (!is_zero_ether_addr(hapd->conf->mld_addr)) | ||
| 4886 | 235 | params.bssid = hapd->conf->mld_addr; | ||
| 4887 | 236 | else | ||
| 4888 | 237 | params.bssid = NULL; | ||
| 4889 | 238 | } | ||
| 4890 | 239 | #endif /* CONFIG_IEEE80211BE */ | ||
| 4891 | 240 | |||
| 4892 | 191 | params.ifname = hapd->conf->iface; | 241 | params.ifname = hapd->conf->iface; |
| 4893 | 192 | params.driver_params = hapd->iconf->driver_params; | 242 | params.driver_params = hapd->iconf->driver_params; |
| 4894 | 193 | params.use_pae_group_addr = hapd->conf->use_pae_group_addr; | 243 | params.use_pae_group_addr = hapd->conf->use_pae_group_addr; |
| 4895 | @@ -213,12 +263,36 @@ static int hostapd_driver_init(struct hostapd_iface *iface) | |||
| 4896 | 213 | return -1; | 263 | return -1; |
| 4897 | 214 | } | 264 | } |
| 4898 | 215 | 265 | ||
| 4899 | 266 | #ifdef CONFIG_IEEE80211BE | ||
| 4900 | 267 | /* | ||
| 4901 | 268 | * This is the first interface added to the AP MLD, so have the | ||
| 4902 | 269 | * interface hardware address be the MLD address, while the link address | ||
| 4903 | 270 | * would be derived from the original interface address if BSSID is not | ||
| 4904 | 271 | * configured, and otherwise it would be the configured BSSID. | ||
| 4905 | 272 | */ | ||
| 4906 | 273 | if (hapd->conf->mld_ap) { | ||
| 4907 | 274 | os_memcpy(hapd->mld->mld_addr, hapd->own_addr, ETH_ALEN); | ||
| 4908 | 275 | |||
| 4909 | 276 | if (!b) | ||
| 4910 | 277 | random_mac_addr_keep_oui(hapd->own_addr); | ||
| 4911 | 278 | else | ||
| 4912 | 279 | os_memcpy(hapd->own_addr, b, ETH_ALEN); | ||
| 4913 | 280 | |||
| 4914 | 281 | hostapd_mld_add_link(hapd); | ||
| 4915 | 282 | wpa_printf(MSG_DEBUG, "Setup of first link (%d) BSS of MLD %s", | ||
| 4916 | 283 | hapd->mld_link_id, hapd->conf->iface); | ||
| 4917 | 284 | } | ||
| 4918 | 285 | |||
| 4919 | 286 | setup_mld: | ||
| 4920 | 287 | #endif /* CONFIG_IEEE80211BE */ | ||
| 4921 | 288 | |||
| 4922 | 216 | if (hapd->driver->get_capa && | 289 | if (hapd->driver->get_capa && |
| 4923 | 217 | hapd->driver->get_capa(hapd->drv_priv, &capa) == 0) { | 290 | hapd->driver->get_capa(hapd->drv_priv, &capa) == 0) { |
| 4924 | 218 | struct wowlan_triggers *triggs; | 291 | struct wowlan_triggers *triggs; |
| 4925 | 219 | 292 | ||
| 4926 | 220 | iface->drv_flags = capa.flags; | 293 | iface->drv_flags = capa.flags; |
| 4927 | 221 | iface->drv_flags2 = capa.flags2; | 294 | iface->drv_flags2 = capa.flags2; |
| 4928 | 295 | iface->drv_rrm_flags = capa.rrm_flags; | ||
| 4929 | 222 | iface->probe_resp_offloads = capa.probe_resp_offloads; | 296 | iface->probe_resp_offloads = capa.probe_resp_offloads; |
| 4930 | 223 | /* | 297 | /* |
| 4931 | 224 | * Use default extended capa values from per-radio information | 298 | * Use default extended capa values from per-radio information |
| 4932 | @@ -234,14 +308,41 @@ static int hostapd_driver_init(struct hostapd_iface *iface) | |||
| 4933 | 234 | */ | 308 | */ |
| 4934 | 235 | hostapd_get_ext_capa(iface); | 309 | hostapd_get_ext_capa(iface); |
| 4935 | 236 | 310 | ||
| 4936 | 311 | hostapd_get_mld_capa(iface); | ||
| 4937 | 312 | |||
| 4938 | 237 | triggs = wpa_get_wowlan_triggers(conf->wowlan_triggers, &capa); | 313 | triggs = wpa_get_wowlan_triggers(conf->wowlan_triggers, &capa); |
| 4939 | 238 | if (triggs && hapd->driver->set_wowlan) { | 314 | if (triggs && hapd->driver->set_wowlan) { |
| 4940 | 239 | if (hapd->driver->set_wowlan(hapd->drv_priv, triggs)) | 315 | if (hapd->driver->set_wowlan(hapd->drv_priv, triggs)) |
| 4941 | 240 | wpa_printf(MSG_ERROR, "set_wowlan failed"); | 316 | wpa_printf(MSG_ERROR, "set_wowlan failed"); |
| 4942 | 241 | } | 317 | } |
| 4943 | 242 | os_free(triggs); | 318 | os_free(triggs); |
| 4944 | 319 | |||
| 4945 | 320 | iface->mbssid_max_interfaces = capa.mbssid_max_interfaces; | ||
| 4946 | 321 | iface->ema_max_periodicity = capa.ema_max_periodicity; | ||
| 4947 | 243 | } | 322 | } |
| 4948 | 244 | 323 | ||
| 4949 | 324 | #ifdef CONFIG_IEEE80211BE | ||
| 4950 | 325 | if (hapd->conf->mld_ap) { | ||
| 4951 | 326 | if (!(iface->drv_flags2 & WPA_DRIVER_FLAGS2_MLO)) { | ||
| 4952 | 327 | wpa_printf(MSG_INFO, | ||
| 4953 | 328 | "MLD: Not supported by the driver"); | ||
| 4954 | 329 | return -1; | ||
| 4955 | 330 | } | ||
| 4956 | 331 | |||
| 4957 | 332 | /* Initialize the BSS parameter change to 1 */ | ||
| 4958 | 333 | hapd->eht_mld_bss_param_change = 1; | ||
| 4959 | 334 | |||
| 4960 | 335 | wpa_printf(MSG_DEBUG, | ||
| 4961 | 336 | "MLD: Set link_id=%u, mld_addr=" MACSTR | ||
| 4962 | 337 | ", own_addr=" MACSTR, | ||
| 4963 | 338 | hapd->mld_link_id, MAC2STR(hapd->mld->mld_addr), | ||
| 4964 | 339 | MAC2STR(hapd->own_addr)); | ||
| 4965 | 340 | |||
| 4966 | 341 | hostapd_drv_link_add(hapd, hapd->mld_link_id, | ||
| 4967 | 342 | hapd->own_addr); | ||
| 4968 | 343 | } | ||
| 4969 | 344 | #endif /* CONFIG_IEEE80211BE */ | ||
| 4970 | 345 | |||
| 4971 | 245 | return 0; | 346 | return 0; |
| 4972 | 246 | } | 347 | } |
| 4973 | 247 | 348 | ||
| 4974 | @@ -454,7 +555,7 @@ static void show_version(void) | |||
| 4975 | 454 | "hostapd v%s\n" | 555 | "hostapd v%s\n" |
| 4976 | 455 | "User space daemon for IEEE 802.11 AP management,\n" | 556 | "User space daemon for IEEE 802.11 AP management,\n" |
| 4977 | 456 | "IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator\n" | 557 | "IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator\n" |
| 4979 | 457 | "Copyright (c) 2002-2022, Jouni Malinen <j@w1.fi> " | 558 | "Copyright (c) 2002-2024, Jouni Malinen <j@w1.fi> " |
| 4980 | 458 | "and contributors\n", | 559 | "and contributors\n", |
| 4981 | 459 | VERSION_STR); | 560 | VERSION_STR); |
| 4982 | 460 | } | 561 | } |
| 4983 | @@ -465,7 +566,7 @@ static void usage(void) | |||
| 4984 | 465 | show_version(); | 566 | show_version(); |
| 4985 | 466 | fprintf(stderr, | 567 | fprintf(stderr, |
| 4986 | 467 | "\n" | 568 | "\n" |
| 4988 | 468 | "usage: hostapd [-hdBKtv] [-P <PID file>] [-e <entropy file>] " | 569 | "usage: hostapd [-hdBKtvq] [-P <PID file>] [-e <entropy file>] " |
| 4989 | 469 | "\\\n" | 570 | "\\\n" |
| 4990 | 470 | " [-g <global ctrl_iface>] [-G <group>]\\\n" | 571 | " [-g <global ctrl_iface>] [-G <group>]\\\n" |
| 4991 | 471 | " [-i <comma-separated list of interface names>]\\\n" | 572 | " [-i <comma-separated list of interface names>]\\\n" |
| 4992 | @@ -493,7 +594,8 @@ static void usage(void) | |||
| 4993 | 493 | #endif /* CONFIG_DEBUG_SYSLOG */ | 594 | #endif /* CONFIG_DEBUG_SYSLOG */ |
| 4994 | 494 | " -S start all the interfaces synchronously\n" | 595 | " -S start all the interfaces synchronously\n" |
| 4995 | 495 | " -t include timestamps in some debug messages\n" | 596 | " -t include timestamps in some debug messages\n" |
| 4997 | 496 | " -v show hostapd version\n"); | 597 | " -v show hostapd version\n" |
| 4998 | 598 | " -q show less debug messages (-qq for even less)\n"); | ||
| 4999 | 497 | 599 | ||
| 5000 | 498 | exit(1); | 600 | exit(1); |
The diff has been truncated for viewing.

See https:/ /code.launchpad .net/~antoinela ssagne/ ubuntu/ +source/ wpa/+git/ wpa/+merge/ 493296/ comments/ 1345054