aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-06-27 05:49:41 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-09 14:17:19 (GMT)
commit3c5126a41f9de5ae6d5666328b5046efc824d03a (patch)
treefc01ab540dc34a3514e71bd470444116cc20b397 /wpa_supplicant/wps_supplicant.c
parentef922c4a340e4a05ec273568b2f99e26e71c6617 (diff)
downloadhostap-3c5126a41f9de5ae6d5666328b5046efc824d03a.zip
hostap-3c5126a41f9de5ae6d5666328b5046efc824d03a.tar.gz
hostap-3c5126a41f9de5ae6d5666328b5046efc824d03a.tar.bz2
P2P: Set Device Password ID in WPS M1/M2 per new rules
If the P2P client (WPS Enrollee) uses a PIN from the GO (Registrar), Device Password ID in M1 & M2 is set to Registrar-specified.
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 6d95921..8f5329a 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -702,7 +702,7 @@ int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
- const char *pin, int p2p_group)
+ const char *pin, int p2p_group, u16 dev_pw_id)
{
struct wpa_ssid *ssid;
char val[128];
@@ -715,10 +715,12 @@ int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
ssid->temporary = 1;
ssid->p2p_group = p2p_group;
if (pin)
- os_snprintf(val, sizeof(val), "\"pin=%s\"", pin);
+ os_snprintf(val, sizeof(val), "\"pin=%s dev_pw_id=%u\"",
+ pin, dev_pw_id);
else {
rpin = wps_generate_pin();
- os_snprintf(val, sizeof(val), "\"pin=%08d\"", rpin);
+ os_snprintf(val, sizeof(val), "\"pin=%08d dev_pw_id=%u\"",
+ rpin, dev_pw_id);
}
wpa_config_set(ssid, "phase1", val, 0);
if (wpa_s->wps_fragment_size)