Browse Source

tests: Fix ft_psk_key_lifetime_in_memory with new PTK derivation debug

PTK is not printed out anymore as a single entry, so fetch KCK, KEK, and
TK separately.

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 10 years ago
parent
commit
f918b95b9d
1 changed files with 9 additions and 7 deletions
  1. 9 7
      tests/hwsim/test_ap_ft.py

+ 9 - 7
tests/hwsim/test_ap_ft.py

@@ -499,21 +499,23 @@ def test_ft_psk_key_lifetime_in_memory(dev, apdev, params):
             if "FT: PMK-R1 - hexdump" in l:
                 val = l.strip().split(':')[3].replace(' ', '')
                 pmkr1 = binascii.unhexlify(val)
-            if "FT: PTK - hexdump" in l:
+            if "FT: KCK - hexdump" in l:
                 val = l.strip().split(':')[3].replace(' ', '')
-                ptk = binascii.unhexlify(val)
+                kck = binascii.unhexlify(val)
+            if "FT: KEK - hexdump" in l:
+                val = l.strip().split(':')[3].replace(' ', '')
+                kek = binascii.unhexlify(val)
+            if "FT: TK - hexdump" in l:
+                val = l.strip().split(':')[3].replace(' ', '')
+                tk = binascii.unhexlify(val)
             if "WPA: Group Key - hexdump" in l:
                 val = l.strip().split(':')[3].replace(' ', '')
                 gtk = binascii.unhexlify(val)
-    if not pmkr0 or not pmkr1 or not ptk or not gtk:
+    if not pmkr0 or not pmkr1 or not kck or not kek or not tk or not gtk:
         raise Exception("Could not find keys from debug log")
     if len(gtk) != 16:
         raise Exception("Unexpected GTK length")
 
-    kck = ptk[0:16]
-    kek = ptk[16:32]
-    tk = ptk[32:48]
-
     logger.info("Checking keys in memory while associated")
     get_key_locations(buf, pmk, "PMK")
     get_key_locations(buf, pmkr0, "PMK-R0")