P2PS: Fix persistent group reporting in wpas_p2ps_prov_complete()
authorMax Stepanov <Max.Stepanov@intel.com>
Thu, 8 Oct 2015 09:36:03 +0000 (12:36 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 11 Oct 2015 18:42:03 +0000 (21:42 +0300)
commitcd571e14dda862c64202ab7bf590d14d6c0e9fb6
tree52d498080a9512d998444ad8be1bb54fd627edf7
parentecf56c7270aa3f1672e139d3baedc2394874758b
P2PS: Fix persistent group reporting in wpas_p2ps_prov_complete()

When one peer doesn't include a persistent group info in PD Request
the other peer shouldn't report a persistent group usage with this
peer even if such a persistent group exists locally. This condition
could be violated in the previous implementation.

In case a local persistent group exists and the
wpas_p2ps_prov_complete() function is called with persist_ssid parameter
set to NULL, wpa_supplicant reported P2PS-PROV-DONE with persist=<idx>
instead of conncap=<role> parameter.

This happened because the wpas_p2p_get_persistent() function was called
without verification whether the persist_ssid was set to NULL. In this
case the wpas_p2p_get_persistent() returns the first existing persistent
group matching the P2P Device Address without verifying the group's
SSID. After that the group ID is used as persist=<idx> parameter of
P2PS-PROV-DONE event.

Fix the issue by adding persist_ssid and persist_ssid_size verification
as a condition for the wpas_p2p_get_persistent() call.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
wpa_supplicant/p2p_supplicant.c