tests: GET_PMK and PMKSA_GET match
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
31d7fe9171
commit
6478f4375b
3 changed files with 20 additions and 2 deletions
|
@ -34,8 +34,12 @@ def test_owe(dev, apdev):
|
|||
if "[WPA2-OWE-CCMP]" not in bss['flags']:
|
||||
raise Exception("OWE AKM not recognized: " + bss['flags'])
|
||||
|
||||
dev[0].connect("owe", key_mgmt="OWE", ieee80211w="2",
|
||||
scan_freq="2412")
|
||||
id = dev[0].connect("owe", key_mgmt="OWE", ieee80211w="2", scan_freq="2412")
|
||||
hapd.wait_sta()
|
||||
pmk_h = hapd.request("GET_PMK " + dev[0].own_addr())
|
||||
pmk_w = dev[0].get_pmk(id)
|
||||
if pmk_h != pmk_w:
|
||||
raise Exception("Fetched PMK does not match: hostapd %s, wpa_supplicant %s" % (pmk_h, pmk_w))
|
||||
hwsim_utils.test_connectivity(dev[0], hapd)
|
||||
val = dev[0].get_status_field("key_mgmt")
|
||||
if val != "OWE":
|
||||
|
|
|
@ -39,6 +39,7 @@ def test_sae(dev, apdev):
|
|||
dev[0].request("SET sae_groups ")
|
||||
id = dev[0].connect("test-sae", psk="12345678", key_mgmt="SAE",
|
||||
scan_freq="2412")
|
||||
hapd.wait_sta()
|
||||
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'])
|
||||
|
@ -51,6 +52,11 @@ def test_sae(dev, apdev):
|
|||
if "sae_group=19" not in res.splitlines():
|
||||
raise Exception("hostapd STA output did not specify SAE group")
|
||||
|
||||
pmk_h = hapd.request("GET_PMK " + dev[0].own_addr())
|
||||
pmk_w = dev[0].get_pmk(id)
|
||||
if pmk_h != pmk_w:
|
||||
raise Exception("Fetched PMK does not match: hostapd %s, wpa_supplicant %s" % (pmk_h, pmk_w))
|
||||
|
||||
@remote_compatible
|
||||
def test_sae_password_ecc(dev, apdev):
|
||||
"""SAE with number of different passwords (ECC)"""
|
||||
|
|
|
@ -1300,6 +1300,14 @@ class WpaSupplicant:
|
|||
return vals
|
||||
return None
|
||||
|
||||
def get_pmk(self, network_id):
|
||||
bssid = self.get_status_field('bssid')
|
||||
res = self.request("PMKSA_GET %d" % network_id)
|
||||
for val in res.splitlines():
|
||||
if val.startswith(bssid):
|
||||
return val.split(' ')[2]
|
||||
return None
|
||||
|
||||
def get_sta(self, addr, info=None, next=False):
|
||||
cmd = "STA-NEXT " if next else "STA "
|
||||
if addr is None:
|
||||
|
|
Loading…
Reference in a new issue