Cumulative patch from commit 01a025937c67f0eca6021d94b8ec3b144f8b1730
01a0259 WPS: Add support for 60 GHz band
0ef1e29 WPS: Fix shorter authentication timeout during no-SelReg iteration
3465176 nl80211: Verify that cipher suite conversion succeeds
a250722 Try to set PMK only with key mgmt offload support in the driver
4a7ce98 Make IPv6 NA multicast-to-unicast conversion configurable
9f390f4 Interworking: Fix network selection warning without SIM/USIM support
a0ad9e8 Remove WPA per-VLAN groups when no more stations remain
87b5b53 Make VLAN ID available in STA info over control interface
5678a2d P2P: Allow wpa_supplicant to start if social channels are not supported
209214b vlan: Move CONFIG_FULL_DYNAMIC_VLAN includes to proper places
a6da824 Do not use C++ reserved words as variable names
eaa3728 wpa_gui: Themed icon loader
9a3cb41 Fix wpa_priv (CONFIG_PRIVSEP=y) build
8b423ed Declare all read only data structures as const
fd4fb28 OpenSSL: Try to ensure we don't throw away the PIN unnecessarily
fabc6dd mesh: Retransmit the last Commit Message in the Committed state
068669f vlan: Verify RADIUS returned VLAN-ID and dynamic_vlan=required
5add410 WPS: Use shorter authentication timeout during no-SelReg iteration
e7d2034 WPS: Enforce five second minimum time before AP iteration
bd143cc Remove trailing whitespace from Makefile
74802c0 P2P: Do not create a P2P Device interface if P2P is disabled
579674e Document p2p_disabled option in wpa_supplicant.conf
8ea8a89 nl80211: Extend unique MAC address assignment for station iftype
Change-Id: I8bc8a63f37c0892b83376b9d5a5859827ae50554
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index af2d924..39d3d28 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -988,6 +988,7 @@
endif
OBJS += ../src/crypto/crypto_openssl.o
OBJS_p += ../src/crypto/crypto_openssl.o
+OBJS_priv += ../src/crypto/crypto_openssl.o
ifdef NEED_FIPS186_2_PRF
OBJS += ../src/crypto/fips_prf_openssl.o
endif
@@ -1006,6 +1007,7 @@
endif
OBJS += ../src/crypto/crypto_gnutls.o
OBJS_p += ../src/crypto/crypto_gnutls.o
+OBJS_priv += ../src/crypto/crypto_gnutls.o
ifdef NEED_FIPS186_2_PRF
OBJS += ../src/crypto/fips_prf_internal.o
SHA1OBJS += ../src/crypto/sha1-internal.o
@@ -1216,6 +1218,7 @@
endif
OBJS += $(MD5OBJS)
OBJS_p += $(MD5OBJS)
+OBJS_priv += $(MD5OBJS)
endif
ifdef NEED_MD4
@@ -1452,6 +1455,7 @@
OBJS_p += $(SHA1OBJS)
OBJS_p += $(SHA256OBJS)
+OBJS_priv += $(SHA1OBJS)
ifdef CONFIG_BGSCAN_SIMPLE
CFLAGS += -DCONFIG_BGSCAN_SIMPLE
@@ -1720,7 +1724,7 @@
@echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement"
wpa_gui-qt4/Makefile:
- qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
+ qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
lrelease wpa_gui-qt4/wpa_gui.pro
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index 46ed5aa..8134562 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -398,7 +398,7 @@
static int are_ies_equal(const struct wpa_bss *old,
- const struct wpa_scan_res *new, u32 ie)
+ const struct wpa_scan_res *new_res, u32 ie)
{
const u8 *old_ie, *new_ie;
struct wpabuf *old_ie_buff = NULL;
@@ -408,19 +408,19 @@
switch (ie) {
case WPA_IE_VENDOR_TYPE:
old_ie = wpa_bss_get_vendor_ie(old, ie);
- new_ie = wpa_scan_get_vendor_ie(new, ie);
+ new_ie = wpa_scan_get_vendor_ie(new_res, ie);
is_multi = 0;
break;
case WPS_IE_VENDOR_TYPE:
old_ie_buff = wpa_bss_get_vendor_ie_multi(old, ie);
- new_ie_buff = wpa_scan_get_vendor_ie_multi(new, ie);
+ new_ie_buff = wpa_scan_get_vendor_ie_multi(new_res, ie);
is_multi = 1;
break;
case WLAN_EID_RSN:
case WLAN_EID_SUPP_RATES:
case WLAN_EID_EXT_SUPP_RATES:
old_ie = wpa_bss_get_ie(old, ie);
- new_ie = wpa_scan_get_ie(new, ie);
+ new_ie = wpa_scan_get_ie(new_res, ie);
is_multi = 0;
break;
default:
@@ -454,15 +454,15 @@
static u32 wpa_bss_compare_res(const struct wpa_bss *old,
- const struct wpa_scan_res *new)
+ const struct wpa_scan_res *new_res)
{
u32 changes = 0;
- int caps_diff = old->caps ^ new->caps;
+ int caps_diff = old->caps ^ new_res->caps;
- if (old->freq != new->freq)
+ if (old->freq != new_res->freq)
changes |= WPA_BSS_FREQ_CHANGED_FLAG;
- if (old->level != new->level)
+ if (old->level != new_res->level)
changes |= WPA_BSS_SIGNAL_CHANGED_FLAG;
if (caps_diff & IEEE80211_CAP_PRIVACY)
@@ -471,22 +471,22 @@
if (caps_diff & IEEE80211_CAP_IBSS)
changes |= WPA_BSS_MODE_CHANGED_FLAG;
- if (old->ie_len == new->ie_len &&
- os_memcmp(old + 1, new + 1, old->ie_len) == 0)
+ if (old->ie_len == new_res->ie_len &&
+ os_memcmp(old + 1, new_res + 1, old->ie_len) == 0)
return changes;
changes |= WPA_BSS_IES_CHANGED_FLAG;
- if (!are_ies_equal(old, new, WPA_IE_VENDOR_TYPE))
+ if (!are_ies_equal(old, new_res, WPA_IE_VENDOR_TYPE))
changes |= WPA_BSS_WPAIE_CHANGED_FLAG;
- if (!are_ies_equal(old, new, WLAN_EID_RSN))
+ if (!are_ies_equal(old, new_res, WLAN_EID_RSN))
changes |= WPA_BSS_RSNIE_CHANGED_FLAG;
- if (!are_ies_equal(old, new, WPS_IE_VENDOR_TYPE))
+ if (!are_ies_equal(old, new_res, WPS_IE_VENDOR_TYPE))
changes |= WPA_BSS_WPS_CHANGED_FLAG;
- if (!are_ies_equal(old, new, WLAN_EID_SUPP_RATES) ||
- !are_ies_equal(old, new, WLAN_EID_EXT_SUPP_RATES))
+ if (!are_ies_equal(old, new_res, WLAN_EID_SUPP_RATES) ||
+ !are_ies_equal(old, new_res, WLAN_EID_EXT_SUPP_RATES))
changes |= WPA_BSS_RATES_CHANGED_FLAG;
return changes;
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index a6aafee..91617fb 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -8686,7 +8686,7 @@
char *pos, *end;
for (i = 0; wpa_drivers[i]; i++) {
- struct wpa_driver_ops *drv = wpa_drivers[i];
+ const struct wpa_driver_ops *drv = wpa_drivers[i];
if (drv->get_interfaces == NULL)
continue;
tmp = drv->get_interfaces(global->drv_priv[i]);
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
index 9b7af30..983bbcd 100644
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -30,7 +30,7 @@
#include "wpas_glue.h"
-struct wpa_driver_ops *wpa_drivers[] = { NULL };
+const struct wpa_driver_ops *const wpa_drivers[] = { NULL };
struct extra_radius_attr {
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index 4a39665..35885ee 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -2058,7 +2058,7 @@
int *excluded)
{
struct wpa_cred *cred, *cred2;
- int excluded1, excluded2;
+ int excluded1, excluded2 = 0;
if (disallowed_bssid(wpa_s, bss->bssid) ||
disallowed_ssid(wpa_s, bss->ssid, bss->ssid_len)) {
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 4c71ef4..def959f 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -3099,7 +3099,7 @@
enum { BW20, BW40PLUS, BW40MINUS, BW80, BW2160 } bw;
};
-static struct p2p_oper_class_map op_class[] = {
+static const struct p2p_oper_class_map op_class[] = {
{ HOSTAPD_MODE_IEEE80211G, 81, 1, 13, 1, BW20 },
#if 0 /* Do not enable HT40 on 2 GHz for now */
{ HOSTAPD_MODE_IEEE80211G, 83, 1, 9, 1, BW40PLUS },
@@ -3232,7 +3232,7 @@
cla = cli_cla = 0;
for (op = 0; op_class[op].op_class; op++) {
- struct p2p_oper_class_map *o = &op_class[op];
+ const struct p2p_oper_class_map *o = &op_class[op];
u8 ch;
struct p2p_reg_class *reg = NULL, *cli_reg = NULL;
@@ -3291,7 +3291,7 @@
enum chan_allowed ret;
for (op = 0; op_class[op].op_class; op++) {
- struct p2p_oper_class_map *o = &op_class[op];
+ const struct p2p_oper_class_map *o = &op_class[op];
u8 ch;
for (ch = o->min_chan; ch <= o->max_chan; ch += o->inc) {
@@ -3931,9 +3931,9 @@
*/
if (p2p_config_get_random_social(&p2p, &p2p.reg_class,
&p2p.channel) != 0) {
- wpa_printf(MSG_ERROR,
- "P2P: Failed to select random social channel as listen channel");
- return -1;
+ wpa_printf(MSG_INFO,
+ "P2P: No social channels supported by the driver - do not enable P2P");
+ return 0;
}
p2p.channel_forced = 0;
}
diff --git a/wpa_supplicant/preauth_test.c b/wpa_supplicant/preauth_test.c
index ed57085..f4bba98 100644
--- a/wpa_supplicant/preauth_test.c
+++ b/wpa_supplicant/preauth_test.c
@@ -27,7 +27,7 @@
#include "drivers/driver.h"
-struct wpa_driver_ops *wpa_drivers[] = { NULL };
+const struct wpa_driver_ops *const wpa_drivers[] = { NULL };
struct preauth_test_data {
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 9fbc532..bf0a03f 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -26,16 +26,16 @@
#endif /* ANDROID */
-static const char *wpa_cli_version =
+static const char *const wpa_cli_version =
"wpa_cli v" VERSION_STR "\n"
"Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors";
-static const char *wpa_cli_license =
+static const char *const wpa_cli_license =
"This software may be distributed under the terms of the BSD license.\n"
"See README for more details.\n";
-static const char *wpa_cli_full_license =
+static const char *const wpa_cli_full_license =
"This software may be distributed under the terms of the BSD license.\n"
"\n"
"Redistribution and use in source and binary forms, with or without\n"
@@ -2805,7 +2805,7 @@
const char *usage;
};
-static struct wpa_cli_cmd wpa_cli_commands[] = {
+static const struct wpa_cli_cmd wpa_cli_commands[] = {
{ "status", wpa_cli_cmd_status, NULL,
cli_cmd_flag_none,
"[verbose] = get current WPA/EAPOL/EAP status" },
@@ -3350,7 +3350,7 @@
/*
* Prints command usage, lines are padded with the specified string.
*/
-static void print_cmd_help(struct wpa_cli_cmd *cmd, const char *pad)
+static void print_cmd_help(const struct wpa_cli_cmd *cmd, const char *pad)
{
char c;
size_t n;
@@ -3488,7 +3488,7 @@
static int wpa_request(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
- struct wpa_cli_cmd *cmd, *match = NULL;
+ const struct wpa_cli_cmd *cmd, *match = NULL;
int count;
int ret = 0;
diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
index 408e387..d2d76f1 100644
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
@@ -1503,8 +1503,8 @@
if (!tray_icon || currentIconType == type)
return;
- QIcon icon;
QIcon fallback_icon;
+ QStringList names;
if (QImageReader::supportedImageFormats().contains(QByteArray("svg")))
fallback_icon = QIcon(":/icons/wpa_gui.svg");
@@ -1513,41 +1513,59 @@
switch (type) {
case TrayIconOffline:
- icon = QIcon::fromTheme("network-wireless-offline",
- fallback_icon);
+ names << "network-wireless-offline-symbolic"
+ << "network-wireless-offline"
+ << "network-wireless-signal-none-symbolic"
+ << "network-wireless-signal-none";
break;
case TrayIconAcquiring:
- icon = QIcon::fromTheme("network-wireless-acquiring",
- fallback_icon);
+ names << "network-wireless-acquiring-symbolic"
+ << "network-wireless-acquiring";
break;
case TrayIconConnected:
- icon = QIcon::fromTheme("network-wireless-connected",
- fallback_icon);
+ names << "network-wireless-connected-symbolic"
+ << "network-wireless-connected";
break;
case TrayIconSignalNone:
- icon = QIcon::fromTheme("network-wireless-signal-none",
- fallback_icon);
+ names << "network-wireless-signal-none-symbolic"
+ << "network-wireless-signal-none";
break;
case TrayIconSignalWeak:
- icon = QIcon::fromTheme("network-wireless-signal-weak",
- fallback_icon);
+ names << "network-wireless-signal-weak-symbolic"
+ << "network-wireless-signal-weak";
break;
case TrayIconSignalOk:
- icon = QIcon::fromTheme("network-wireless-signal-ok",
- fallback_icon);
+ names << "network-wireless-signal-ok-symbolic"
+ << "network-wireless-signal-ok";
break;
case TrayIconSignalGood:
- icon = QIcon::fromTheme("network-wireless-signal-good",
- fallback_icon);
+ names << "network-wireless-signal-good-symbolic"
+ << "network-wireless-signal-good";
break;
case TrayIconSignalExcellent:
- icon = QIcon::fromTheme("network-wireless-signal-excellent",
- fallback_icon);
+ names << "network-wireless-signal-excellent-symbolic"
+ << "network-wireless-signal-excellent";
break;
}
currentIconType = type;
- tray_icon->setIcon(icon);
+ tray_icon->setIcon(loadThemedIcon(names, fallback_icon));
+}
+
+
+QIcon WpaGui::loadThemedIcon(const QStringList &names,
+ const QIcon &fallback)
+{
+ QIcon icon;
+
+ for (QStringList::ConstIterator it = names.begin();
+ it != names.end(); it++) {
+ icon = QIcon::fromTheme(*it);
+ if (!icon.isNull())
+ return icon;
+ }
+
+ return fallback;
}
diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.h b/wpa_supplicant/wpa_gui-qt4/wpagui.h
index c0de67b..58c655d 100644
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.h
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.h
@@ -85,6 +85,8 @@
virtual void showTrayStatus();
virtual void updateTrayIcon(TrayIconType type);
virtual void updateTrayToolTip(const QString &msg);
+ virtual QIcon loadThemedIcon(const QStringList &names,
+ const QIcon &fallback);
virtual void wpsDialog();
virtual void peersDialog();
virtual void tabChanged(int index);
diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index 6bd60b9..4611a1d 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -29,7 +29,7 @@
char *sock_name;
int fd;
- struct wpa_driver_ops *driver;
+ const struct wpa_driver_ops *driver;
void *drv_priv;
struct sockaddr_un drv_addr;
int wpas_registered;
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index b96fd8e..06a1696 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -55,11 +55,11 @@
#include "wpas_kay.h"
#include "mesh.h"
-const char *wpa_supplicant_version =
+const char *const wpa_supplicant_version =
"wpa_supplicant v" VERSION_STR "\n"
"Copyright (c) 2003-2015, Jouni Malinen <j@w1.fi> and contributors";
-const char *wpa_supplicant_license =
+const char *const wpa_supplicant_license =
"This software may be distributed under the terms of the BSD license.\n"
"See README for more details.\n"
#ifdef EAP_TLS_OPENSSL
@@ -70,16 +70,16 @@
#ifndef CONFIG_NO_STDOUT_DEBUG
/* Long text divided into parts in order to fit in C89 strings size limits. */
-const char *wpa_supplicant_full_license1 =
+const char *const wpa_supplicant_full_license1 =
"";
-const char *wpa_supplicant_full_license2 =
+const char *const wpa_supplicant_full_license2 =
"This software may be distributed under the terms of the BSD license.\n"
"\n"
"Redistribution and use in source and binary forms, with or without\n"
"modification, are permitted provided that the following conditions are\n"
"met:\n"
"\n";
-const char *wpa_supplicant_full_license3 =
+const char *const wpa_supplicant_full_license3 =
"1. Redistributions of source code must retain the above copyright\n"
" notice, this list of conditions and the following disclaimer.\n"
"\n"
@@ -87,7 +87,7 @@
" notice, this list of conditions and the following disclaimer in the\n"
" documentation and/or other materials provided with the distribution.\n"
"\n";
-const char *wpa_supplicant_full_license4 =
+const char *const wpa_supplicant_full_license4 =
"3. Neither the name(s) of the above-listed copyright holder(s) nor the\n"
" names of its contributors may be used to endorse or promote products\n"
" derived from this software without specific prior written permission.\n"
@@ -96,7 +96,7 @@
"\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n"
"LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n"
"A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n";
-const char *wpa_supplicant_full_license5 =
+const char *const wpa_supplicant_full_license5 =
"OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n"
"SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n"
"LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n"
@@ -3077,12 +3077,34 @@
(wpa_s->current_ssid == NULL ||
wpa_s->current_ssid->mode != IEEE80211_MODE_IBSS)) {
/* Timeout for completing IEEE 802.1X and WPA authentication */
- wpa_supplicant_req_auth_timeout(
- wpa_s,
- (wpa_key_mgmt_wpa_ieee8021x(wpa_s->key_mgmt) ||
- wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA ||
- wpa_s->key_mgmt == WPA_KEY_MGMT_WPS) ?
- 70 : 10, 0);
+ int timeout = 10;
+
+ if (wpa_key_mgmt_wpa_ieee8021x(wpa_s->key_mgmt) ||
+ wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA ||
+ wpa_s->key_mgmt == WPA_KEY_MGMT_WPS) {
+ /* Use longer timeout for IEEE 802.1X/EAP */
+ timeout = 70;
+ }
+
+ if (wpa_s->current_ssid && wpa_s->current_bss &&
+ (wpa_s->current_ssid->key_mgmt & WPA_KEY_MGMT_WPS) &&
+ eap_is_wps_pin_enrollee(&wpa_s->current_ssid->eap)) {
+ /*
+ * Use shorter timeout if going through WPS AP iteration
+ * for PIN config method with an AP that does not
+ * advertise Selected Registrar.
+ */
+ struct wpabuf *wps_ie;
+
+ wps_ie = wpa_bss_get_vendor_ie_multi(
+ wpa_s->current_bss, WPS_IE_VENDOR_TYPE);
+ if (wps_ie &&
+ !wps_is_addr_authorized(wps_ie, wpa_s->own_addr, 1))
+ timeout = 10;
+ wpabuf_free(wps_ie);
+ }
+
+ wpa_supplicant_req_auth_timeout(wpa_s, timeout, 0);
}
wpa_s->eapol_received++;
@@ -4386,6 +4408,7 @@
#ifdef CONFIG_P2P
if (wpa_s->global->p2p == NULL &&
+ !wpa_s->global->p2p_disabled && !wpa_s->conf->p2p_disabled &&
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE) &&
wpas_p2p_add_p2pdev_interface(wpa_s, iface->conf_p2p_dev) < 0) {
wpa_printf(MSG_INFO,
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index eb7434a..c1bcbd4 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -297,6 +297,10 @@
# format: <backend name>[:<optional backend parameters>]
#ext_password_backend=test:pw1=password|pw2=testing
+
+# Disable P2P functionality
+# p2p_disabled=1
+
# Timeout in seconds to detect STA inactivity (default: 300 seconds)
#
# This timeout value is used in P2P GO mode to clean up
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index 1b9753c..8ed8b72 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -17,14 +17,14 @@
#include "config_ssid.h"
#include "wmm_ac.h"
-extern const char *wpa_supplicant_version;
-extern const char *wpa_supplicant_license;
+extern const char *const wpa_supplicant_version;
+extern const char *const wpa_supplicant_license;
#ifndef CONFIG_NO_STDOUT_DEBUG
-extern const char *wpa_supplicant_full_license1;
-extern const char *wpa_supplicant_full_license2;
-extern const char *wpa_supplicant_full_license3;
-extern const char *wpa_supplicant_full_license4;
-extern const char *wpa_supplicant_full_license5;
+extern const char *const wpa_supplicant_full_license1;
+extern const char *const wpa_supplicant_full_license2;
+extern const char *const wpa_supplicant_full_license3;
+extern const char *const wpa_supplicant_full_license4;
+extern const char *const wpa_supplicant_full_license5;
#endif /* CONFIG_NO_STDOUT_DEBUG */
struct wpa_sm;
@@ -518,7 +518,7 @@
unsigned int last_scan_res_size;
struct os_reltime last_scan;
- struct wpa_driver_ops *driver;
+ const struct wpa_driver_ops *driver;
int interface_removed; /* whether the network interface has been
* removed */
struct wpa_sm *wpa;
@@ -639,6 +639,7 @@
int wps_success; /* WPS success event received */
struct wps_er *wps_er;
unsigned int wps_run;
+ struct os_reltime wps_pin_start_time;
int blacklist_cleared;
struct wpabuf *pending_eapol_rx;
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index 48a5d69..29c22ba 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -1021,7 +1021,8 @@
{
struct wpa_supplicant *wpa_s = ctx;
- if (wpa_s->conf->key_mgmt_offload)
+ if (wpa_s->conf->key_mgmt_offload &&
+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD))
return wpa_drv_set_key(wpa_s, WPA_ALG_PMK, NULL, 0, 0,
NULL, 0, pmk, pmk_len);
else
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 52594a1..8a5cb8e 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -39,6 +39,14 @@
#define WPS_PIN_SCAN_IGNORE_SEL_REG 3
#endif /* WPS_PIN_SCAN_IGNORE_SEL_REG */
+/*
+ * The minimum time in seconds before trying to associate to a WPS PIN AP that
+ * does not have Selected Registrar TRUE.
+ */
+#ifndef WPS_PIN_TIME_IGNORE_SEL_REG
+#define WPS_PIN_TIME_IGNORE_SEL_REG 5
+#endif /* WPS_PIN_TIME_IGNORE_SEL_REG */
+
static void wpas_wps_timeout(void *eloop_ctx, void *timeout_ctx);
static void wpas_clear_wps(struct wpa_supplicant *wpa_s);
@@ -880,7 +888,8 @@
if (!wpa_s->current_ssid || !wpa_s->assoc_freq)
return 0;
- return (wpa_s->assoc_freq > 2484) ? WPS_RF_50GHZ : WPS_RF_24GHZ;
+ return (wpa_s->assoc_freq > 50000) ? WPS_RF_60GHZ :
+ (wpa_s->assoc_freq > 2484) ? WPS_RF_50GHZ : WPS_RF_24GHZ;
}
@@ -1216,6 +1225,7 @@
int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
const char *pin, int p2p_group, u16 dev_pw_id)
{
+ os_get_reltime(&wpa_s->wps_pin_start_time);
return wpas_wps_start_dev_pw(wpa_s, NULL, bssid, pin, p2p_group,
dev_pw_id, NULL, NULL, 0, 0);
}
@@ -1487,6 +1497,8 @@
wps->dev.rf_bands |= WPS_RF_24GHZ;
else if (modes[m].mode == HOSTAPD_MODE_IEEE80211A)
wps->dev.rf_bands |= WPS_RF_50GHZ;
+ else if (modes[m].mode == HOSTAPD_MODE_IEEE80211AD)
+ wps->dev.rf_bands |= WPS_RF_60GHZ;
}
}
if (wps->dev.rf_bands == 0) {
@@ -1609,9 +1621,15 @@
* external Registrar.
*/
if (!wps_is_addr_authorized(wps_ie, wpa_s->own_addr, 1)) {
- if (wpa_s->scan_runs < WPS_PIN_SCAN_IGNORE_SEL_REG) {
- wpa_printf(MSG_DEBUG, " skip - WPS AP "
- "without active PIN Registrar");
+ struct os_reltime age;
+
+ os_reltime_age(&wpa_s->wps_pin_start_time, &age);
+
+ if (wpa_s->scan_runs < WPS_PIN_SCAN_IGNORE_SEL_REG ||
+ age.sec < WPS_PIN_TIME_IGNORE_SEL_REG) {
+ wpa_printf(MSG_DEBUG,
+ " skip - WPS AP without active PIN Registrar (scan_runs=%d age=%d)",
+ wpa_s->scan_runs, (int) age.sec);
wpabuf_free(wps_ie);
return 0;
}
@@ -2582,6 +2600,10 @@
(attr.rf_bands == NULL ||
*attr.rf_bands & WPS_RF_50GHZ))
freq = 5000 + 5 * chan;
+ else if (chan >= 1 && chan <= 4 &&
+ (attr.rf_bands == NULL ||
+ *attr.rf_bands & WPS_RF_60GHZ))
+ freq = 56160 + 2160 * chan;
if (freq) {
wpa_printf(MSG_DEBUG,