From 8eb45bde3814504e3242e2c6c24bd6440312fae6 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 6 Dec 2015 17:48:43 +0200 Subject: [PATCH] tests: Write GTK locations into debug log in key_lifetime_in_memory It looks like it is possible for the GTK to be found from memory every now and then. This makes these test cases fail. Write the memory addresses in which the GTK was found to the log to make it somewhat easier to try to figure out where the key can be left in memory. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_eap.py | 1 + tests/hwsim/test_ap_ft.py | 1 + tests/hwsim/test_ap_psk.py | 1 + tests/hwsim/test_erp.py | 1 + tests/hwsim/test_sae.py | 1 + 5 files changed, 5 insertions(+) diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index 5ec67f05e..da1d2e3c4 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -3424,6 +3424,7 @@ def test_wpa2_eap_ttls_pap_key_lifetime_in_memory(dev, apdev, params): if tk in buf: raise Exception("TK found from memory") if gtk in buf: + get_key_locations(buf, gtk, "GTK") raise Exception("GTK found from memory") logger.info("Checking keys in memory after disassociation") diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index a342c5343..d2995c8ca 100644 --- a/tests/hwsim/test_ap_ft.py +++ b/tests/hwsim/test_ap_ft.py @@ -652,6 +652,7 @@ def test_ft_psk_key_lifetime_in_memory(dev, apdev, params): if tk in buf: raise Exception("TK found from memory") if gtk in buf: + get_key_locations(buf, gtk, "GTK") raise Exception("GTK found from memory") logger.info("Checking keys in memory after disassociation") diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index cdf67b93f..f3d4b04b4 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -1792,6 +1792,7 @@ def test_wpa2_psk_key_lifetime_in_memory(dev, apdev, params): if tk in buf: raise Exception("TK found from memory") if gtk in buf: + get_key_locations(buf, gtk, "GTK") raise Exception("GTK found from memory") logger.info("Checking keys in memory after disassociation") diff --git a/tests/hwsim/test_erp.py b/tests/hwsim/test_erp.py index c4f2fa521..1388337bc 100644 --- a/tests/hwsim/test_erp.py +++ b/tests/hwsim/test_erp.py @@ -313,6 +313,7 @@ def test_erp_key_lifetime_in_memory(dev, apdev, params): if tk in buf: raise Exception("TK found from memory") if gtk in buf: + get_key_locations(buf, gtk, "GTK") raise Exception("GTK found from memory") logger.info("Checking keys in memory after disassociation") diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py index ba70f75f9..32ee8b113 100644 --- a/tests/hwsim/test_sae.py +++ b/tests/hwsim/test_sae.py @@ -331,6 +331,7 @@ def test_sae_key_lifetime_in_memory(dev, apdev, params): if tk in buf: raise Exception("TK found from memory") if gtk in buf: + get_key_locations(buf, gtk, "GTK") raise Exception("GTK found from memory") verify_not_present(buf, sae_k, fname, "SAE(k)") verify_not_present(buf, sae_keyseed, fname, "SAE(keyseed)")