aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVitaly Wool <vitalywool@gmail.com>2011-12-11 10:03:18 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-11 10:03:18 (GMT)
commitc3daaf3325563ccbe0d8c3a8c8b729683a9d68c2 (patch)
treed6646bbac99a9b168d4e1b4a1b535f1b28b6c395 /src
parent5ed3354617fc252d16079c11203062c14049ac55 (diff)
downloadhostap-c3daaf3325563ccbe0d8c3a8c8b729683a9d68c2.zip
hostap-c3daaf3325563ccbe0d8c3a8c8b729683a9d68c2.tar.gz
hostap-c3daaf3325563ccbe0d8c3a8c8b729683a9d68c2.tar.bz2
Skip WPS PBC overlap detection if P2P address is the same
WPS overlap detection can detect false overlap if a P2P peer changes UUID while authentication is ongoing. Changing UUID is of course wrong but this is what some popular devices do so we need to work around it in order to keep compatibility with these devices. There already is a mechanism in WPS registrar to skip overlap detection if P2P addresses of two sessions match but it wasn't really triggered because the address wasn't filled in in the caller function. Let's fill in this address and also clean up WPS PBC sessions on WSC process completion if UUID was changed. Signed-hostap: Vitaly Wool<vitalywool@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/wps/wps_registrar.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c
index e59edb8..eda1c70 100644
--- a/src/wps/wps_registrar.c
+++ b/src/wps/wps_registrar.c
@@ -310,13 +310,17 @@ static void wps_registrar_add_pbc_session(struct wps_registrar *reg,
static void wps_registrar_remove_pbc_session(struct wps_registrar *reg,
- const u8 *uuid_e)
+ const u8 *uuid_e,
+ const u8 *p2p_dev_addr)
{
struct wps_pbc_session *pbc, *prev = NULL, *tmp;
pbc = reg->pbc_sessions;
while (pbc) {
- if (os_memcmp(pbc->uuid_e, uuid_e, WPS_UUID_LEN) == 0) {
+ if (os_memcmp(pbc->uuid_e, uuid_e, WPS_UUID_LEN) == 0 ||
+ (p2p_dev_addr && !is_zero_ether_addr(reg->p2p_dev_addr) &&
+ os_memcmp(reg->p2p_dev_addr, p2p_dev_addr, ETH_ALEN) ==
+ 0)) {
if (prev)
prev->next = pbc->next;
else
@@ -945,7 +949,7 @@ void wps_registrar_complete(struct wps_registrar *registrar, const u8 *uuid_e)
{
if (registrar->pbc) {
wps_registrar_remove_pbc_session(registrar,
- uuid_e);
+ uuid_e, NULL);
wps_registrar_pbc_completed(registrar);
} else {
wps_registrar_pin_completed(registrar);
@@ -3047,7 +3051,8 @@ static enum wps_process_res wps_process_wsc_done(struct wps_data *wps,
if (wps->pbc) {
wps_registrar_remove_pbc_session(wps->wps->registrar,
- wps->uuid_e);
+ wps->uuid_e,
+ wps->p2p_dev_addr);
wps_registrar_pbc_completed(wps->wps->registrar);
} else {
wps_registrar_pin_completed(wps->wps->registrar);