Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/wpa/dist Merge local changes from v2.7 -> v2.9 ...



details:   https://anonhg.NetBSD.org/src/rev/b8a9c03741eb
branches:  trunk
changeset: 953204:b8a9c03741eb
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 01 01:40:13 2021 +0000

description:
Merge local changes from v2.7 -> v2.9 for wpa_supplicant and hostapd

diffstat:

 external/bsd/wpa/dist/hostapd/hostapd_cli.c                                          |    40 +-
 external/bsd/wpa/dist/hostapd/main.c                                                 |    16 +-
 external/bsd/wpa/dist/src/ap/ap_drv_ops.c                                            |    66 +-
 external/bsd/wpa/dist/src/ap/drv_callbacks.c                                         |   225 +-
 external/bsd/wpa/dist/src/ap/hostapd.c                                               |   349 +-
 external/bsd/wpa/dist/src/ap/hostapd.h                                               |    42 +-
 external/bsd/wpa/dist/src/ap/ieee802_11.c                                            |   842 +++++-
 external/bsd/wpa/dist/src/ap/wmm.c                                                   |    68 +-
 external/bsd/wpa/dist/src/ap/wpa_auth.c                                              |   438 ++-
 external/bsd/wpa/dist/src/ap/wpa_auth.h                                              |    28 +-
 external/bsd/wpa/dist/src/ap/wpa_auth_ft.c                                           |   188 +-
 external/bsd/wpa/dist/src/ap/wpa_auth_i.h                                            |    13 +-
 external/bsd/wpa/dist/src/common/sae.c                                               |   276 +-
 external/bsd/wpa/dist/src/common/wpa_common.h                                        |    15 +-
 external/bsd/wpa/dist/src/crypto/.gitignore                                          |     1 -
 external/bsd/wpa/dist/src/crypto/crypto_openssl.c                                    |   126 +-
 external/bsd/wpa/dist/src/drivers/.gitignore                                         |     2 -
 external/bsd/wpa/dist/src/drivers/driver.h                                           |   275 +-
 external/bsd/wpa/dist/src/drivers/driver_bsd.c                                       |    12 +-
 external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c                                |   149 +-
 external/bsd/wpa/dist/src/eap_common/eap_pwd_common.h                                |     3 +
 external/bsd/wpa/dist/src/eap_peer/eap_pwd.c                                         |   127 +-
 external/bsd/wpa/dist/src/eap_server/eap_server.c                                    |    34 +-
 external/bsd/wpa/dist/src/eap_server/eap_server_pwd.c                                |    93 +-
 external/bsd/wpa/dist/src/eap_server/eap_server_tls_common.c                         |    34 +-
 external/bsd/wpa/dist/src/p2p/p2p.c                                                  |   121 +-
 external/bsd/wpa/dist/src/radius/.gitignore                                          |     1 -
 external/bsd/wpa/dist/src/radius/radius_client.c                                     |    86 +-
 external/bsd/wpa/dist/src/rsn_supp/tdls.c                                            |     2 +-
 external/bsd/wpa/dist/src/rsn_supp/wpa.c                                             |   392 ++-
 external/bsd/wpa/dist/src/rsn_supp/wpa_ft.c                                          |    60 +-
 external/bsd/wpa/dist/src/rsn_supp/wpa_i.h                                           |    20 +-
 external/bsd/wpa/dist/src/tls/.gitignore                                             |     1 -
 external/bsd/wpa/dist/src/utils/.gitignore                                           |     1 -
 external/bsd/wpa/dist/src/utils/common.c                                             |    69 +-
 external/bsd/wpa/dist/src/utils/common.h                                             |     4 +
 external/bsd/wpa/dist/src/utils/eloop.c                                              |    29 +-
 external/bsd/wpa/dist/src/utils/os_unix.c                                            |    12 +-
 external/bsd/wpa/dist/wpa_supplicant/.gitignore                                      |     1 -
 external/bsd/wpa/dist/wpa_supplicant/Makefile                                        |    99 +-
 external/bsd/wpa/dist/wpa_supplicant/README                                          |     4 +-
 external/bsd/wpa/dist/wpa_supplicant/config.c                                        |   138 +-
 external/bsd/wpa/dist/wpa_supplicant/ctrl_iface.c                                    |   337 +-
 external/bsd/wpa/dist/wpa_supplicant/dbus/.gitignore                                 |     1 -
 external/bsd/wpa/dist/wpa_supplicant/dbus/dbus_old.c                                 |   745 -----
 external/bsd/wpa/dist/wpa_supplicant/dbus/dbus_old.h                                 |   142 -
 external/bsd/wpa/dist/wpa_supplicant/dbus/dbus_old_handlers.c                        |  1393 ----------
 external/bsd/wpa/dist/wpa_supplicant/dbus/dbus_old_handlers.h                        |   101 -
 external/bsd/wpa/dist/wpa_supplicant/dbus/dbus_old_handlers_wps.c                    |   152 -
 external/bsd/wpa/dist/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in |     5 -
 external/bsd/wpa/dist/wpa_supplicant/defconfig                                       |    90 +-
 external/bsd/wpa/dist/wpa_supplicant/doc/docbook/.gitignore                          |     6 -
 external/bsd/wpa/dist/wpa_supplicant/driver_i.h                                      |    38 +-
 external/bsd/wpa/dist/wpa_supplicant/events.c                                        |   254 +-
 external/bsd/wpa/dist/wpa_supplicant/examples/wpas-test.py                           |    91 -
 external/bsd/wpa/dist/wpa_supplicant/main.c                                          |    12 +-
 external/bsd/wpa/dist/wpa_supplicant/op_classes.c                                    |    70 +-
 external/bsd/wpa/dist/wpa_supplicant/wnm_sta.c                                       |   102 +-
 external/bsd/wpa/dist/wpa_supplicant/wpa_cli.c                                       |   159 +-
 external/bsd/wpa/dist/wpa_supplicant/wpa_gui-qt4/.gitignore                          |     4 -
 external/bsd/wpa/dist/wpa_supplicant/wpa_gui-qt4/lang/.gitignore                     |     1 -
 external/bsd/wpa/dist/wpa_supplicant/wpa_supplicant.c                                |   496 ++-
 external/bsd/wpa/dist/wpa_supplicant/wpa_supplicant_i.h                              |    77 +-
 63 files changed, 4575 insertions(+), 4203 deletions(-)

diffs (truncated from 14769 to 300 lines):

diff -r dae25e8e8ef7 -r b8a9c03741eb external/bsd/wpa/dist/hostapd/hostapd_cli.c
--- a/external/bsd/wpa/dist/hostapd/hostapd_cli.c       Mon Mar 01 01:37:49 2021 +0000
+++ b/external/bsd/wpa/dist/hostapd/hostapd_cli.c       Mon Mar 01 01:40:13 2021 +0000
@@ -1,6 +1,6 @@
 /*
  * hostapd - command line interface for hostapd daemon
- * Copyright (c) 2004-2018, Jouni Malinen <j%w1.fi@localhost>
+ * Copyright (c) 2004-2019, Jouni Malinen <j%w1.fi@localhost>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -21,7 +21,7 @@
 
 static const char *const hostapd_cli_version =
 "hostapd_cli v" VERSION_STR "\n"
-"Copyright (c) 2004-2018, Jouni Malinen <j%w1.fi@localhost> and contributors";
+"Copyright (c) 2004-2019, Jouni Malinen <j%w1.fi@localhost> and contributors";
 
 static struct wpa_ctrl *ctrl_conn;
 static int hostapd_cli_quit = 0;
@@ -1214,6 +1214,13 @@
 }
 
 
+static int hostapd_cli_cmd_update_beacon(struct wpa_ctrl *ctrl, int argc,
+                                     char *argv[])
+{
+       return wpa_ctrl_command(ctrl, "UPDATE_BEACON");
+}
+
+
 static int hostapd_cli_cmd_vendor(struct wpa_ctrl *ctrl, int argc, char *argv[])
 {
        char cmd[256];
@@ -1443,6 +1450,13 @@
 }
 
 
+static int hostapd_cli_cmd_dpp_configurator_sign(struct wpa_ctrl *ctrl,
+                                                int argc, char *argv[])
+{
+       return hostapd_cli_cmd(ctrl, "DPP_CONFIGURATOR_SIGN", 1, argc, argv);
+}
+
+
 static int hostapd_cli_cmd_dpp_pkex_add(struct wpa_ctrl *ctrl, int argc,
                                        char *argv[])
 {
@@ -1480,6 +1494,20 @@
 }
 
 
+static int hostapd_cli_cmd_req_beacon(struct wpa_ctrl *ctrl, int argc,
+                                     char *argv[])
+{
+       return hostapd_cli_cmd(ctrl, "REQ_BEACON", 2, argc, argv);
+}
+
+
+static int hostapd_cli_cmd_reload_wpa_psk(struct wpa_ctrl *ctrl, int argc,
+                                         char *argv[])
+{
+       return wpa_ctrl_command(ctrl, "RELOAD_WPA_PSK");
+}
+
+
 struct hostapd_cli_cmd {
        const char *cmd;
        int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
@@ -1596,6 +1624,8 @@
          "= reload configuration for current interface" },
        { "disable", hostapd_cli_cmd_disable, NULL,
          "= disable hostapd on current interface" },
+       { "update_beacon", hostapd_cli_cmd_update_beacon, NULL,
+         "= update Beacon frame contents\n"},
        { "erp_flush", hostapd_cli_cmd_erp_flush, NULL,
          "= drop all ERP keys"},
        { "log_level", hostapd_cli_cmd_log_level, NULL,
@@ -1640,6 +1670,8 @@
        { "dpp_configurator_get_key", hostapd_cli_cmd_dpp_configurator_get_key,
          NULL,
          "<id> = Get DPP configurator's private key" },
+       { "dpp_configurator_sign", hostapd_cli_cmd_dpp_configurator_sign, NULL,
+         "conf=<role> configurator=<id> = generate self DPP configuration" },
        { "dpp_pkex_add", hostapd_cli_cmd_dpp_pkex_add, NULL,
          "add PKEX code" },
        { "dpp_pkex_remove", hostapd_cli_cmd_dpp_pkex_remove, NULL,
@@ -1651,6 +1683,10 @@
          "=Add/Delete/Show/Clear deny MAC ACL" },
        { "poll_sta", hostapd_cli_cmd_poll_sta, hostapd_complete_stations,
          "<addr> = poll a STA to check connectivity with a QoS null frame" },
+       { "req_beacon", hostapd_cli_cmd_req_beacon, NULL,
+         "<addr> [req_mode=] <measurement request hexdump>  = send a Beacon report request to a station" },
+       { "reload_wpa_psk", hostapd_cli_cmd_reload_wpa_psk, NULL,
+         "= reload wpa_psk_file only" },
        { NULL, NULL, NULL, NULL }
 };
 
diff -r dae25e8e8ef7 -r b8a9c03741eb external/bsd/wpa/dist/hostapd/main.c
--- a/external/bsd/wpa/dist/hostapd/main.c      Mon Mar 01 01:37:49 2021 +0000
+++ b/external/bsd/wpa/dist/hostapd/main.c      Mon Mar 01 01:40:13 2021 +0000
@@ -1,6 +1,6 @@
 /*
  * hostapd / main()
- * Copyright (c) 2002-2018, Jouni Malinen <j%w1.fi@localhost>
+ * Copyright (c) 2002-2019, Jouni Malinen <j%w1.fi@localhost>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -18,6 +18,7 @@
 #include "crypto/random.h"
 #include "crypto/tls.h"
 #include "common/version.h"
+#include "common/dpp.h"
 #include "drivers/driver.h"
 #include "eap_server/eap.h"
 #include "eap_server/tncs.h"
@@ -456,7 +457,7 @@
                "hostapd v" VERSION_STR "\n"
                "User space daemon for IEEE 802.11 AP management,\n"
                "IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator\n"
-               "Copyright (c) 2002-2018, Jouni Malinen <j%w1.fi@localhost> "
+               "Copyright (c) 2002-2019, Jouni Malinen <j%w1.fi@localhost> "
                "and contributors\n");
 }
 
@@ -652,6 +653,9 @@
        int start_ifaces_in_sync = 0;
        char **if_names = NULL;
        size_t if_names_size = 0;
+#ifdef CONFIG_DPP
+       struct dpp_global_config dpp_conf;
+#endif /* CONFIG_DPP */
 
        if (os_program_init())
                return -1;
@@ -671,7 +675,11 @@
        dl_list_init(&interfaces.eth_p_oui);
 #endif /* CONFIG_ETH_P_OUI */
 #ifdef CONFIG_DPP
-       hostapd_dpp_init_global(&interfaces);
+       os_memset(&dpp_conf, 0, sizeof(dpp_conf));
+       /* TODO: dpp_conf.msg_ctx? */
+       interfaces.dpp = dpp_global_init(&dpp_conf);
+       if (!interfaces.dpp)
+               return -1;
 #endif /* CONFIG_DPP */
 
        for (;;) {
@@ -901,7 +909,7 @@
        os_free(interfaces.iface);
 
 #ifdef CONFIG_DPP
-       hostapd_dpp_deinit_global(&interfaces);
+       dpp_global_deinit(interfaces.dpp);
 #endif /* CONFIG_DPP */
 
        if (interfaces.eloop_initialized)
diff -r dae25e8e8ef7 -r b8a9c03741eb external/bsd/wpa/dist/src/ap/ap_drv_ops.c
--- a/external/bsd/wpa/dist/src/ap/ap_drv_ops.c Mon Mar 01 01:37:49 2021 +0000
+++ b/external/bsd/wpa/dist/src/ap/ap_drv_ops.c Mon Mar 01 01:40:13 2021 +0000
@@ -413,6 +413,8 @@
                    u16 listen_interval,
                    const struct ieee80211_ht_capabilities *ht_capab,
                    const struct ieee80211_vht_capabilities *vht_capab,
+                   const struct ieee80211_he_capabilities *he_capab,
+                   size_t he_capab_len,
                    u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
                    int set)
 {
@@ -432,6 +434,8 @@
        params.listen_interval = listen_interval;
        params.ht_capabilities = ht_capab;
        params.vht_capabilities = vht_capab;
+       params.he_capab = he_capab;
+       params.he_capab_len = he_capab_len;
        params.vht_opmode_enabled = !!(flags & WLAN_STA_VHT_OPMODE_ENABLED);
        params.vht_opmode = vht_opmode;
        params.flags = hostapd_sta_flags_to_drv(flags);
@@ -537,18 +541,21 @@
 
 int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,
                     int freq, int channel, int ht_enabled, int vht_enabled,
-                    int sec_channel_offset, int vht_oper_chwidth,
+                    int he_enabled,
+                    int sec_channel_offset, int oper_chwidth,
                     int center_segment0, int center_segment1)
 {
        struct hostapd_freq_params data;
+       struct hostapd_hw_modes *cmode = hapd->iface->current_mode;
 
        if (hapd->iface->current_mode &&
            hostapd_set_freq_params(&data, mode, freq, channel, ht_enabled,
-                                   vht_enabled, sec_channel_offset,
-                                   vht_oper_chwidth,
+                                   vht_enabled, he_enabled, sec_channel_offset,
+                                   oper_chwidth,
                                    center_segment0, center_segment1,
-                                   hapd->iface->current_mode ?
-                                   hapd->iface->current_mode->vht_capab : 0))
+                                   cmode ? cmode->vht_capab : 0,
+                                   cmode ?
+                                   &cmode->he_capab[IEEE80211_MODE_AP] : NULL))
                return -1;
 
        if (hapd->driver == NULL)
@@ -584,6 +591,16 @@
 }
 
 
+int hostapd_sta_set_airtime_weight(struct hostapd_data *hapd, const u8 *addr,
+                                  unsigned int weight)
+{
+       if (!hapd->driver || !hapd->driver->sta_set_airtime_weight)
+               return 0;
+       return hapd->driver->sta_set_airtime_weight(hapd->drv_priv, addr,
+                                                   weight);
+}
+
+
 int hostapd_set_country(struct hostapd_data *hapd, const char *country)
 {
        if (hapd->driver == NULL ||
@@ -776,14 +793,16 @@
 int hostapd_start_dfs_cac(struct hostapd_iface *iface,
                          enum hostapd_hw_mode mode, int freq,
                          int channel, int ht_enabled, int vht_enabled,
-                         int sec_channel_offset, int vht_oper_chwidth,
+                         int he_enabled,
+                         int sec_channel_offset, int oper_chwidth,
                          int center_segment0, int center_segment1)
 {
        struct hostapd_data *hapd = iface->bss[0];
        struct hostapd_freq_params data;
        int res;
+       struct hostapd_hw_modes *cmode = iface->current_mode;
 
-       if (!hapd->driver || !hapd->driver->start_dfs_cac)
+       if (!hapd->driver || !hapd->driver->start_dfs_cac || !cmode)
                return 0;
 
        if (!iface->conf->ieee80211h) {
@@ -794,10 +813,11 @@
 
        if (iface->current_mode &&
            hostapd_set_freq_params(&data, mode, freq, channel, ht_enabled,
-                                   vht_enabled, sec_channel_offset,
-                                   vht_oper_chwidth, center_segment0,
+                                   vht_enabled, he_enabled, sec_channel_offset,
+                                   oper_chwidth, center_segment0,
                                    center_segment1,
-                                   iface->current_mode->vht_capab)) {
+                                   cmode->vht_capab,
+                                   &cmode->he_capab[IEEE80211_MODE_AP])) {
                wpa_printf(MSG_ERROR, "Can't set freq params");
                return -1;
        }
@@ -921,15 +941,17 @@
        if (hapd->iface->conf->ieee80211n && params.ht40_enabled)
                params.ch_width = 40;
 
-       /* Note: VHT20 is defined by combination of ht_capab & vht_oper_chwidth
+       /* Note: VHT20 is defined by combination of ht_capab & oper_chwidth
         */
-       if (hapd->iface->conf->ieee80211ac && params.ht40_enabled) {
-               if (hapd->iface->conf->vht_oper_chwidth == VHT_CHANWIDTH_80MHZ)
+       if ((hapd->iface->conf->ieee80211ax ||
+            hapd->iface->conf->ieee80211ac) &&
+           params.ht40_enabled) {
+               u8 oper_chwidth = hostapd_get_oper_chwidth(hapd->iface->conf);
+
+               if (oper_chwidth == CHANWIDTH_80MHZ)
                        params.ch_width = 80;
-               else if (hapd->iface->conf->vht_oper_chwidth ==
-                        VHT_CHANWIDTH_160MHZ ||
-                        hapd->iface->conf->vht_oper_chwidth ==
-                        VHT_CHANWIDTH_80P80MHZ)
+               else if (oper_chwidth == CHANWIDTH_160MHZ ||
+                        oper_chwidth == CHANWIDTH_80P80MHZ)
                        params.ch_width = 160;
        }
 
@@ -938,3 +960,13 @@
 
        return ret;
 }
+
+
+int hostapd_drv_update_dh_ie(struct hostapd_data *hapd, const u8 *peer,
+                            u16 reason_code, const u8 *ie, size_t ielen)
+{
+       if (!hapd->driver || !hapd->driver->update_dh_ie || !hapd->drv_priv)
+               return 0;
+       return hapd->driver->update_dh_ie(hapd->drv_priv, peer, reason_code,
+                                         ie, ielen);
+}
diff -r dae25e8e8ef7 -r b8a9c03741eb external/bsd/wpa/dist/src/ap/drv_callbacks.c
--- a/external/bsd/wpa/dist/src/ap/drv_callbacks.c      Mon Mar 01 01:37:49 2021 +0000
+++ b/external/bsd/wpa/dist/src/ap/drv_callbacks.c      Mon Mar 01 01:40:13 2021 +0000
@@ -15,6 +15,7 @@



Home | Main Index | Thread Index | Old Index