From f918b95b9d919f752a1ec2566d359e009eefe190 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 26 Jan 2015 02:07:32 +0200 Subject: [PATCH] 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 --- tests/hwsim/test_ap_ft.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index 648f123e4..18e8dd6cb 100644 --- a/tests/hwsim/test_ap_ft.py +++ b/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")