From 6db556b21d8a5605f5f31d51ece5c8bf9b99ba0e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 5 Aug 2017 17:07:36 +0300 Subject: [PATCH] tests: Allow wpa_supplicant to maintain GTK in memory during association This is needed to allow GTK configuration triggers to verify whether the key has changed. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_eap.py | 5 ++--- tests/hwsim/test_ap_ft.py | 5 ++--- tests/hwsim/test_ap_psk.py | 5 ++--- tests/hwsim/test_erp.py | 5 ++--- tests/hwsim/test_sae.py | 5 ++--- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index f0f5e38ef..0acb39a36 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -5032,9 +5032,6 @@ def test_wpa2_eap_ttls_pap_key_lifetime_in_memory(dev, apdev, params): raise Exception("KEK not found while associated") 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") buf = read_process_memory(pid, password) @@ -5049,6 +5046,8 @@ def test_wpa2_eap_ttls_pap_key_lifetime_in_memory(dev, apdev, params): verify_not_present(buf, kck, fname, "KCK") verify_not_present(buf, kek, fname, "KEK") verify_not_present(buf, tk, fname, "TK") + if gtk in buf: + get_key_locations(buf, gtk, "GTK") verify_not_present(buf, gtk, fname, "GTK") dev[0].request("PMKSA_FLUSH") diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index 935753e15..bc03c3c77 100644 --- a/tests/hwsim/test_ap_ft.py +++ b/tests/hwsim/test_ap_ft.py @@ -913,9 +913,6 @@ def test_ft_psk_key_lifetime_in_memory(dev, apdev, params): raise Exception("KEK not found while associated") 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") buf = read_process_memory(pid, pmk) @@ -932,6 +929,8 @@ def test_ft_psk_key_lifetime_in_memory(dev, apdev, params): verify_not_present(buf, kck, fname, "KCK") verify_not_present(buf, kek, fname, "KEK") verify_not_present(buf, tk, fname, "TK") + if gtk in buf: + get_key_locations(buf, gtk, "GTK") verify_not_present(buf, gtk, fname, "GTK") dev[0].request("REMOVE_NETWORK all") diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index 21523e0cb..67f6d7403 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -1839,9 +1839,6 @@ def test_wpa2_psk_key_lifetime_in_memory(dev, apdev, params): raise Exception("KEK not found while associated") 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") buf = read_process_memory(pid, pmk) @@ -1854,6 +1851,8 @@ def test_wpa2_psk_key_lifetime_in_memory(dev, apdev, params): verify_not_present(buf, kck, fname, "KCK") verify_not_present(buf, kek, fname, "KEK") verify_not_present(buf, tk, fname, "TK") + if gtk in buf: + get_key_locations(buf, gtk, "GTK") verify_not_present(buf, gtk, fname, "GTK") dev[0].request("REMOVE_NETWORK all") diff --git a/tests/hwsim/test_erp.py b/tests/hwsim/test_erp.py index 17d4cfd0e..718521147 100644 --- a/tests/hwsim/test_erp.py +++ b/tests/hwsim/test_erp.py @@ -318,9 +318,6 @@ def test_erp_key_lifetime_in_memory(dev, apdev, params): raise Exception("KEK not found while associated") 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") buf = read_process_memory(pid, password) @@ -337,6 +334,8 @@ def test_erp_key_lifetime_in_memory(dev, apdev, params): verify_not_present(buf, kck, fname, "KCK") verify_not_present(buf, kek, fname, "KEK") verify_not_present(buf, tk, fname, "TK") + if gtk in buf: + get_key_locations(buf, gtk, "GTK") verify_not_present(buf, gtk, fname, "GTK") dev[0].request("RECONNECT") diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py index 79ddae1da..0611e4b3b 100644 --- a/tests/hwsim/test_sae.py +++ b/tests/hwsim/test_sae.py @@ -346,9 +346,6 @@ def test_sae_key_lifetime_in_memory(dev, apdev, params): raise Exception("KEK not found while associated") 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)") verify_not_present(buf, sae_kck, fname, "SAE(KCK)") @@ -364,6 +361,8 @@ def test_sae_key_lifetime_in_memory(dev, apdev, params): verify_not_present(buf, kck, fname, "KCK") verify_not_present(buf, kek, fname, "KEK") verify_not_present(buf, tk, fname, "TK") + if gtk in buf: + get_key_locations(buf, gtk, "GTK") verify_not_present(buf, gtk, fname, "GTK") verify_not_present(buf, sae_k, fname, "SAE(k)") verify_not_present(buf, sae_keyseed, fname, "SAE(keyseed)")