aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2005-11-20 20:05:19 (GMT)
committerJouni Malinen <j@w1.fi>2005-11-20 20:05:19 (GMT)
commit7fe0e2177ffb67eead5073a1be4bbba13482cbf7 (patch)
tree66967228c061b0a3e72cad9b50cbf7ee5beaa180 /wpa_supplicant
parent4c8ce73ebd5795245058477629b1fe96146bc4c9 (diff)
downloadhostap-history-7fe0e2177ffb67eead5073a1be4bbba13482cbf7.zip
hostap-history-7fe0e2177ffb67eead5073a1be4bbba13482cbf7.tar.gz
hostap-history-7fe0e2177ffb67eead5073a1be4bbba13482cbf7.tar.bz2
Include Beacon IEs in AssocInfo in order to notice if the new AP is
using different WPA/RSN IE. The IEs are read from OID_802_11_BSSID_LIST when processing the AssocInfo.
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/ChangeLog2
-rw-r--r--wpa_supplicant/driver_ndis.c47
2 files changed, 47 insertions, 2 deletions
diff --git a/wpa_supplicant/ChangeLog b/wpa_supplicant/ChangeLog
index 13e4998..3e0f18c 100644
--- a/wpa_supplicant/ChangeLog
+++ b/wpa_supplicant/ChangeLog
@@ -21,6 +21,8 @@ ChangeLog for wpa_supplicant
* wpa_gui: do not display password/PSK field contents
* wpa_gui: added CA certificate configuration
* driver_ndis: fixed scan request in ap_scan=2 mode not to change SSID
+ * driver_ndis: include Beacon IEs in AssocInfo in order to notice if
+ the new AP is using different WPA/RSN IE
2005-10-27 - v0.4.6
* allow fallback to WPA, if mixed WPA+WPA2 networks have mismatch in
diff --git a/wpa_supplicant/driver_ndis.c b/wpa_supplicant/driver_ndis.c
index 3e70c33..5ad2a31 100644
--- a/wpa_supplicant/driver_ndis.c
+++ b/wpa_supplicant/driver_ndis.c
@@ -599,6 +599,8 @@ static int wpa_driver_ndis_get_scan_results(void *priv,
}
wpa_driver_ndis_get_ies(&results[i], bss->IEs, bss->IELength);
pos += bss->Length;
+ if (pos > (char *) b + blen)
+ break;
}
free(b);
@@ -953,10 +955,12 @@ static int wpa_driver_ndis_flush_pmkid(void *priv)
static int wpa_driver_ndis_get_associnfo(struct wpa_driver_ndis_data *drv)
{
- char buf[512];
+ char buf[512], *pos;
NDIS_802_11_ASSOCIATION_INFORMATION *ai;
- int len;
+ int len, i;
union wpa_event_data data;
+ NDIS_802_11_BSSID_LIST_EX *b;
+ size_t blen;
len = ndis_get_oid(drv, OID_802_11_ASSOCIATION_INFORMATION, buf,
sizeof(buf));
@@ -1015,8 +1019,47 @@ static int wpa_driver_ndis_get_associnfo(struct wpa_driver_ndis_data *drv)
data.assoc_info.req_ies_len = ai->RequestIELength;
data.assoc_info.resp_ies = buf + ai->OffsetResponseIEs;
data.assoc_info.resp_ies_len = ai->ResponseIELength;
+
+ blen = 65535;
+ b = malloc(blen);
+ if (b == NULL)
+ goto skip_scan_results;
+ memset(b, 0, blen);
+ len = ndis_get_oid(drv, OID_802_11_BSSID_LIST, (char *) b, blen);
+ if (len < 0) {
+ wpa_printf(MSG_DEBUG, "NDIS: failed to get scan results");
+ free(b);
+ b = NULL;
+ goto skip_scan_results;
+ }
+ wpa_printf(MSG_DEBUG, "NDIS: %d BSSID items to process for AssocInfo",
+ (unsigned int) b->NumberOfItems);
+
+ pos = (char *) &b->Bssid[0];
+ for (i = 0; i < b->NumberOfItems; i++) {
+ NDIS_WLAN_BSSID_EX *bss = (NDIS_WLAN_BSSID_EX *) pos;
+ if (memcmp(drv->bssid, bss->MacAddress, ETH_ALEN) == 0 &&
+ bss->IELength > sizeof(NDIS_802_11_FIXED_IEs)) {
+ data.assoc_info.beacon_ies =
+ ((u8 *) bss->IEs) +
+ sizeof(NDIS_802_11_FIXED_IEs);
+ data.assoc_info.beacon_ies_len =
+ bss->IELength - sizeof(NDIS_802_11_FIXED_IEs);
+ wpa_hexdump(MSG_MSGDUMP, "NDIS: Beacon IEs",
+ data.assoc_info.beacon_ies,
+ data.assoc_info.beacon_ies_len);
+ break;
+ }
+ pos += bss->Length;
+ if (pos > (char *) b + blen)
+ break;
+ }
+
+skip_scan_results:
wpa_supplicant_event(drv->ctx, EVENT_ASSOCINFO, &data);
+ free(b);
+
return 0;
}