aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/p2p_supplicant.c
diff options
context:
space:
mode:
authorPurushottam Kushwaha <pkushwah@qti.qualcomm.com>2016-04-29 10:50:12 (GMT)
committerJouni Malinen <j@w1.fi>2016-05-19 16:16:26 (GMT)
commit31d7fb14af96aa745b5acdf03d8b4f0569c964e5 (patch)
treeb80f69f7863e573a27fb9188d09a82cbae0a270d /wpa_supplicant/p2p_supplicant.c
parent467fc149d357ddda1dbed57617989252fb4d61d9 (diff)
downloadhostap-31d7fb14af96aa745b5acdf03d8b4f0569c964e5.zip
hostap-31d7fb14af96aa745b5acdf03d8b4f0569c964e5.tar.gz
hostap-31d7fb14af96aa745b5acdf03d8b4f0569c964e5.tar.bz2
P2PS: Allow P2P_CONNECT command for P2PS connection with/without PIN
This allows using P2PS config method with or without PIN for connection. wpa_supplicant should internally handle the default PIN "12345670" and shall also allow connection irrespective of PIN used in P2P_CONNECT. For example, 1. P2P_CONNECT 02:2a:fb:22:22:33 p2ps 2. P2P_CONNECT 02:2a:fb:22:22:33 xxxxxxxx p2ps Where the second one is maintained for backwards compatibility. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/p2p_supplicant.c')
-rw-r--r--wpa_supplicant/p2p_supplicant.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index a9443f3..8f6acd6 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -5383,6 +5383,9 @@ int wpas_p2p_connect(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
wpa_s->p2p_pin[sizeof(wpa_s->p2p_pin) - 1] = '\0';
wpa_printf(MSG_DEBUG, "P2P: Randomly generated PIN: %s",
wpa_s->p2p_pin);
+ } else if (wps_method == WPS_P2PS) {
+ /* Force the P2Ps default PIN to be used */
+ os_strlcpy(wpa_s->p2p_pin, "12345670", sizeof(wpa_s->p2p_pin));
} else
wpa_s->p2p_pin[0] = '\0';