check_mib(dev[0], [ ("dot11RSNAAuthenticationSuiteRequested", "00-0f-ac-5"),
("dot11RSNAAuthenticationSuiteSelected", "00-0f-ac-5") ])
+ bss = dev[0].get_bss(apdev[0]['bssid'])
+ if 'flags' not in bss:
+ raise Exception("Could not get BSS flags from BSS table")
+ if "[WPA2-EAP-SHA256-CCMP]" not in bss['flags']:
+ raise Exception("Unexpected BSS flags: " + bss['flags'])
+
logger.info("Negative test with incorrect password")
dev[0].request("REMOVE_NETWORK all")
eap_connect(dev[0], apdev[0], "PSK", "psk.user@example.com",
dev[0].set_cred_quoted(id, "realm", "no.match.example.com");
interworking_select(dev[0], bssid, no_match=True, freq="2412")
+ res = dev[0].request("SCAN_RESULTS")
+ if "[HS20]" not in res:
+ raise Exception("HS20 flag missing from scan results: " + res)
+
bssid2 = apdev[1]['bssid']
params = hs20_ap_params()
params['nai_realm'] = [ "0,example.org,21" ]
print bssid1
print bssid2
+ bss = dev[0].get_bss(bssid0)
+ if not bss:
+ bss = dev[1].get_bss(bssid1)
+ if not bss:
+ raise Exception("Could not find BSS entry for IBSS")
+ if 'flags' not in bss:
+ raise Exception("Could not get BSS flags from BSS table")
+ if "[WPA-None-TKIP]" not in bss['flags']:
+ raise Exception("Unexpected BSS flags: " + bss['flags'])
+
# Allow some time for all peers to complete key setup
time.sleep(1)
if bssid0 != bssid1:
logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1)
+ res = dev[0].request("SCAN_RESULTS")
+ if "[IBSS]" not in res:
+ res = dev[1].request("SCAN_RESULTS")
+ if "[IBSS]" not in res:
+ raise Exception("IBSS flag missing from scan results: " + res)
+ bss = dev[0].get_bss(bssid0)
+ if not bss:
+ bss = dev[1].get_bss(bssid1)
+ if not bss:
+ raise Exception("Could not find BSS entry for IBSS")
+ if 'flags' not in bss:
+ raise Exception("Could not get BSS flags from BSS table")
+ if "[IBSS]" not in bss['flags']:
+ raise Exception("Unexpected BSS flags: " + bss['flags'])
+
def test_ibss_open_fixed_bssid(dev):
"""IBSS open (no security) and fixed BSSID"""
ssid="ibss"
if "id=" + id not in res:
raise Exception("Could not find BSS entry based on id range")
+ res = dev[1].request("SCAN_RESULTS")
+ if "[P2P]" not in res:
+ raise Exception("P2P flag missing from scan results: " + res)
+
# Presence request to increase testing coverage
if "FAIL" in dev[1].group_request("P2P_PRESENCE_REQ 30000 102400"):
raise Exception("Could not send presence request")
scan_freq="2412")
if dev[0].get_status_field('sae_group') != '19':
raise Exception("Expected default SAE group not used")
+ bss = dev[0].get_bss(apdev[0]['bssid'])
+ if 'flags' not in bss:
+ raise Exception("Could not get BSS flags from BSS table")
+ if "[WPA2-SAE-CCMP]" not in bss['flags']:
+ raise Exception("Unexpected BSS flags: " + bss['flags'])
def test_sae_pmksa_caching(dev, apdev):
"""SAE and PMKSA caching"""
client_cert="auth_serv/user.pem",
private_key="auth_serv/user.key",
pairwise="GCMP", group="GCMP", scan_freq="2412")
+
+ bss = dev[0].get_bss(apdev[0]['bssid'])
+ if 'flags' not in bss:
+ raise Exception("Could not get BSS flags from BSS table")
+ if "[WPA2-EAP-SUITE-B-GCMP]" not in bss['flags']:
+ raise Exception("Unexpected BSS flags: " + bss['flags'])
+
dev[0].request("DISCONNECT")
ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=20)
if ev is None:
if "[WEP]" not in dev[0].request("SCAN_RESULTS"):
raise Exception("WEP flag not indicated in scan results")
+ bss = dev[0].get_bss(apdev[0]['bssid'])
+ if 'flags' not in bss:
+ raise Exception("Could not get BSS flags from BSS table")
+ if "[WEP]" not in bss['flags']:
+ raise Exception("Unexpected BSS flags: " + bss['flags'])
+
def test_wep_shared_key_auth(dev, apdev):
"""WEP Shared Key authentication"""
hapd = hostapd.add_ap(apdev[0]['ifname'],