Cumulative patch from commit f95a4524c2c00476e46b7999426ffdcbc7cd538f
f95a452 nl80211: Improve debug output by printing SA and DA in frames
dedfa44 Print frame type name in debug output
57a8f8a nl80211: Use low-priority scan for OBSS scan
1b928f9 P2P: Allow passphrase length to be configured
e985246 eapol_test: Add PC/SC reader and PIN command line arguments
5a62060 Use pcsc_reader configuration in one for scard_init() call
f3c6b23 EAP-SIM': Fix AT_KDF parser to avoid infinite loop
79122f9 EAP-SIM/AKA: Remove unused RESULT_FAILURE state
Change-Id: I142bed35a75ed228e145e50c961dcde22a9815f7
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 4cea2ef..8fd8ea1 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -1736,6 +1736,9 @@
#ifdef CONFIG_MACSEC
{ INT_RANGE(macsec_policy, 0, 1) },
#endif /* CONFIG_MACSEC */
+#ifdef CONFIG_HS20
+ { INT(update_identifier) },
+#endif /* CONFIG_HS20 */
};
#undef OFFSET
@@ -3836,6 +3839,8 @@
{ INT_RANGE(persistent_reconnect, 0, 1), 0 },
{ INT_RANGE(p2p_intra_bss, 0, 1), CFG_CHANGED_P2P_INTRA_BSS },
{ INT(p2p_group_idle), 0 },
+ { INT_RANGE(p2p_passphrase_len, 8, 63),
+ CFG_CHANGED_P2P_PASSPHRASE_LEN },
{ FUNC(p2p_pref_chan), CFG_CHANGED_P2P_PREF_CHAN },
{ FUNC(p2p_no_go_freq), CFG_CHANGED_P2P_PREF_CHAN },
{ INT_RANGE(p2p_add_cli_chan, 0, 1), 0 },
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 3c2fc4a..52add9d 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -317,6 +317,7 @@
#define CFG_CHANGED_P2P_PREF_CHAN BIT(13)
#define CFG_CHANGED_EXT_PW_BACKEND BIT(14)
#define CFG_CHANGED_NFC_PASSWORD_TOKEN BIT(15)
+#define CFG_CHANGED_P2P_PASSPHRASE_LEN BIT(16)
/**
* struct wpa_config - wpa_supplicant configuration data
@@ -716,6 +717,14 @@
int p2p_group_idle;
/**
+ * p2p_passphrase_len - Passphrase length (8..63) for P2P GO
+ *
+ * This parameter controls the length of the random passphrase that is
+ * generated at the GO.
+ */
+ unsigned int p2p_passphrase_len;
+
+ /**
* bss_max_count - Maximum number of BSS entries to keep in memory
*/
unsigned int bss_max_count;
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 58e7111..98855d8 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -739,6 +739,9 @@
#ifdef CONFIG_MACSEC
INT(macsec_policy);
#endif /* CONFIG_MACSEC */
+#ifdef CONFIG_HS20
+ INT(update_identifier);
+#endif /* CONFIG_HS20 */
#undef STR
#undef INT
@@ -1016,6 +1019,9 @@
fprintf(f, "p2p_intra_bss=%u\n", config->p2p_intra_bss);
if (config->p2p_group_idle)
fprintf(f, "p2p_group_idle=%u\n", config->p2p_group_idle);
+ if (config->p2p_passphrase_len)
+ fprintf(f, "p2p_passphrase_len=%u\n",
+ config->p2p_passphrase_len);
if (config->p2p_pref_chan) {
unsigned int i;
fprintf(f, "p2p_pref_chan=");
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index 76b0632..ab474ff 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -647,6 +647,10 @@
*/
int macsec_policy;
#endif /* CONFIG_MACSEC */
+
+#ifdef CONFIG_HS20
+ int update_identifier;
+#endif /* CONFIG_HS20 */
};
#endif /* CONFIG_SSID_H */
diff --git a/wpa_supplicant/config_winreg.c b/wpa_supplicant/config_winreg.c
index 00a1004..199f04f 100644
--- a/wpa_supplicant/config_winreg.c
+++ b/wpa_supplicant/config_winreg.c
@@ -930,6 +930,9 @@
MGMT_FRAME_PROTECTION_DEFAULT);
#endif /* CONFIG_IEEE80211W */
STR(id_str);
+#ifdef CONFIG_HS20
+ INT(update_identifier);
+#endif /* CONFIG_HS20 */
#undef STR
#undef INT
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
index 88d4241..06a696e 100644
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -73,6 +73,9 @@
struct extra_radius_attr *extra_attrs;
FILE *server_cert_file;
+
+ const char *pcsc_reader;
+ const char *pcsc_pin;
};
static struct eapol_test_data eapol_test;
@@ -954,7 +957,7 @@
}
-static int scard_test(void)
+static int scard_test(struct eapol_test_data *e)
{
struct scard_data *scard;
size_t len;
@@ -985,10 +988,10 @@
unsigned char aka_ik[IK_LEN];
unsigned char aka_ck[CK_LEN];
- scard = scard_init(NULL);
+ scard = scard_init(e->pcsc_reader);
if (scard == NULL)
return -1;
- if (scard_set_pin(scard, "1234")) {
+ if (scard_set_pin(scard, e->pcsc_pin)) {
wpa_printf(MSG_WARNING, "PIN validation failed");
scard_deinit(scard);
return -1;
@@ -1063,7 +1066,7 @@
}
-static int scard_get_triplets(int argc, char *argv[])
+static int scard_get_triplets(struct eapol_test_data *e, int argc, char *argv[])
{
struct scard_data *scard;
size_t len;
@@ -1085,7 +1088,7 @@
wpa_debug_level = 99;
}
- scard = scard_init(NULL);
+ scard = scard_init(e->pcsc_reader);
if (scard == NULL) {
printf("Failed to open smartcard connection\n");
return -1;
@@ -1143,7 +1146,8 @@
"[-s<AS secret>]\\\n"
" [-r<count>] [-t<timeout>] [-C<Connect-Info>] \\\n"
" [-M<client MAC address>] [-o<server cert file] \\\n"
- " [-N<attr spec>] \\\n"
+ " [-N<attr spec>] [-R<PC/SC reader>] "
+ "[-P<PC/SC PIN>] \\\n"
" [-A<client IP>]\n"
"eapol_test scard\n"
"eapol_test sim <PIN> <num triplets> [debug]\n"
@@ -1208,12 +1212,13 @@
os_memset(&eapol_test, 0, sizeof(eapol_test));
eapol_test.connect_info = "CONNECT 11Mbps 802.11b";
os_memcpy(eapol_test.own_addr, "\x02\x00\x00\x00\x00\x01", ETH_ALEN);
+ eapol_test.pcsc_pin = "1234";
wpa_debug_level = 0;
wpa_debug_show_keys = 1;
for (;;) {
- c = getopt(argc, argv, "a:A:c:C:eM:nN:o:p:r:s:St:W");
+ c = getopt(argc, argv, "a:A:c:C:eM:nN:o:p:P:r:R:s:St:W");
if (c < 0)
break;
switch (c) {
@@ -1254,9 +1259,14 @@
case 'p':
as_port = atoi(optarg);
break;
+ case 'P':
+ eapol_test.pcsc_pin = optarg;
+ break;
case 'r':
eapol_test.eapol_test_num_reauths = atoi(optarg);
break;
+ case 'R':
+ eapol_test.pcsc_reader = optarg;
case 's':
as_secret = optarg;
break;
@@ -1304,11 +1314,11 @@
}
if (argc > optind && os_strcmp(argv[optind], "scard") == 0) {
- return scard_test();
+ return scard_test(&eapol_test);
}
if (argc > optind && os_strcmp(argv[optind], "sim") == 0) {
- return scard_get_triplets(argc - optind - 1,
+ return scard_get_triplets(&eapol_test, argc - optind - 1,
&argv[optind + 1]);
}
@@ -1344,6 +1354,11 @@
return -1;
}
+ if (eapol_test.pcsc_reader) {
+ os_free(wpa_s.conf->pcsc_reader);
+ wpa_s.conf->pcsc_reader = os_strdup(eapol_test.pcsc_reader);
+ }
+
wpa_init_conf(&eapol_test, &wpa_s, as_addr, as_port, as_secret,
cli_addr);
wpa_s.ctrl_iface = wpa_supplicant_ctrl_iface_init(&wpa_s);
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 147836b..ad24d4e 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -342,7 +342,7 @@
wpa_dbg(wpa_s, MSG_DEBUG, "Selected network is configured to use SIM "
"(sim=%d aka=%d) - initialize PCSC", sim, aka);
- wpa_s->scard = scard_init(NULL);
+ wpa_s->scard = scard_init(wpa_s->conf->pcsc_reader);
if (wpa_s->scard == NULL) {
wpa_msg(wpa_s, MSG_WARNING, "Failed to initialize SIM "
"(pcsc-lite)");
diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c
index ab8b66b..257aa6d 100644
--- a/wpa_supplicant/hs20_supplicant.c
+++ b/wpa_supplicant/hs20_supplicant.c
@@ -109,7 +109,13 @@
{
struct wpa_cred *cred;
- if (ssid == NULL || ssid->parent_cred == NULL)
+ if (ssid == NULL)
+ return 0;
+
+ if (ssid->update_identifier)
+ return ssid->update_identifier;
+
+ if (ssid->parent_cred == NULL)
return 0;
for (cred = wpa_s->conf->cred; cred; cred = cred->next) {
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 6b85efe..afa8121 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -3949,6 +3949,12 @@
p2p.max_listen = wpa_s->max_remain_on_chan;
+ if (wpa_s->conf->p2p_passphrase_len >= 8 &&
+ wpa_s->conf->p2p_passphrase_len <= 63)
+ p2p.passphrase_len = wpa_s->conf->p2p_passphrase_len;
+ else
+ p2p.passphrase_len = 8;
+
global->p2p = p2p_init(&p2p);
if (global->p2p == NULL)
return -1;
@@ -6334,6 +6340,9 @@
"update failed");
}
}
+
+ if (wpa_s->conf->changed_parameters & CFG_CHANGED_P2P_PASSPHRASE_LEN)
+ p2p_set_passphrase_len(p2p, wpa_s->conf->p2p_passphrase_len);
}
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index aaef3c3..a2b996f 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1857,6 +1857,7 @@
params->filter_rssi = src->filter_rssi;
params->p2p_probe = src->p2p_probe;
params->only_new_results = src->only_new_results;
+ params->low_priority = src->low_priority;
return params;
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 81a1ede..1b04398 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -1167,6 +1167,7 @@
os_memset(¶ms, 0, sizeof(params));
wpa_setband_scan_freqs_list(wpa_s, HOSTAPD_MODE_IEEE80211G, ¶ms);
+ params.low_priority = 1;
wpa_printf(MSG_DEBUG, "SME OBSS: Request an OBSS scan");
if (wpa_supplicant_trigger_scan(wpa_s, ¶ms))
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index 191f206..2a0dc20 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -269,6 +269,12 @@
# inactive stations.
#p2p_go_max_inactivity=300
+# Passphrase length (8..63) for P2P GO
+#
+# This parameter controls the length of the random passphrase that is
+# generated at the GO. Default: 8.
+#p2p_passphrase_len=8
+
# Extra delay between concurrent P2P search iterations
#
# This value adds extra delay in milliseconds between concurrent search