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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-12-06 17:48:43 +02:00
parent 1d32bc2c1c
commit 8eb45bde38
5 changed files with 5 additions and 0 deletions

View file

@ -3424,6 +3424,7 @@ def test_wpa2_eap_ttls_pap_key_lifetime_in_memory(dev, apdev, params):
if tk in buf: if tk in buf:
raise Exception("TK found from memory") raise Exception("TK found from memory")
if gtk in buf: if gtk in buf:
get_key_locations(buf, gtk, "GTK")
raise Exception("GTK found from memory") raise Exception("GTK found from memory")
logger.info("Checking keys in memory after disassociation") logger.info("Checking keys in memory after disassociation")

View file

@ -652,6 +652,7 @@ def test_ft_psk_key_lifetime_in_memory(dev, apdev, params):
if tk in buf: if tk in buf:
raise Exception("TK found from memory") raise Exception("TK found from memory")
if gtk in buf: if gtk in buf:
get_key_locations(buf, gtk, "GTK")
raise Exception("GTK found from memory") raise Exception("GTK found from memory")
logger.info("Checking keys in memory after disassociation") logger.info("Checking keys in memory after disassociation")

View file

@ -1792,6 +1792,7 @@ def test_wpa2_psk_key_lifetime_in_memory(dev, apdev, params):
if tk in buf: if tk in buf:
raise Exception("TK found from memory") raise Exception("TK found from memory")
if gtk in buf: if gtk in buf:
get_key_locations(buf, gtk, "GTK")
raise Exception("GTK found from memory") raise Exception("GTK found from memory")
logger.info("Checking keys in memory after disassociation") logger.info("Checking keys in memory after disassociation")

View file

@ -313,6 +313,7 @@ def test_erp_key_lifetime_in_memory(dev, apdev, params):
if tk in buf: if tk in buf:
raise Exception("TK found from memory") raise Exception("TK found from memory")
if gtk in buf: if gtk in buf:
get_key_locations(buf, gtk, "GTK")
raise Exception("GTK found from memory") raise Exception("GTK found from memory")
logger.info("Checking keys in memory after disassociation") logger.info("Checking keys in memory after disassociation")

View file

@ -331,6 +331,7 @@ def test_sae_key_lifetime_in_memory(dev, apdev, params):
if tk in buf: if tk in buf:
raise Exception("TK found from memory") raise Exception("TK found from memory")
if gtk in buf: if gtk in buf:
get_key_locations(buf, gtk, "GTK")
raise Exception("GTK found from memory") raise Exception("GTK found from memory")
verify_not_present(buf, sae_k, fname, "SAE(k)") verify_not_present(buf, sae_k, fname, "SAE(k)")
verify_not_present(buf, sae_keyseed, fname, "SAE(keyseed)") verify_not_present(buf, sae_keyseed, fname, "SAE(keyseed)")