aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-07-08 13:13:05 (GMT)
committerJouni Malinen <j@w1.fi>2017-07-08 13:14:03 (GMT)
commite4e99927bf6b92ed096c3e5d121633e5b5004180 (patch)
treefcf3f3bce2dbab20b60c52fa903efbba7a02bef9 /tests
parent96e595a9f126399e8a87bc012646487239664004 (diff)
downloadhostap-e4e99927bf6b92ed096c3e5d121633e5b5004180.zip
hostap-e4e99927bf6b92ed096c3e5d121633e5b5004180.tar.gz
hostap-e4e99927bf6b92ed096c3e5d121633e5b5004180.tar.bz2
tests: Additional LEAP error path
This is a regression test for a memory leak on an error path. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_eap_proto.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/hwsim/test_eap_proto.py b/tests/hwsim/test_eap_proto.py
index 6ebfbe9..0ca9c9c 100644
--- a/tests/hwsim/test_eap_proto.py
+++ b/tests/hwsim/test_eap_proto.py
@@ -1218,6 +1218,14 @@ def test_eap_proto_leap_errors(dev, apdev):
0x28, 0x48, 0xf8, 0x53, 0x82, 0x50, 0x00, 0x04,
0x93, 0x50, 0x30, 0xd7, 0x25, 0xea, 0x5f, 0x66)
+ idx += 1
+ if ctx['num'] == idx:
+ logger.info("Test: Valid challenge")
+ return struct.pack(">BBHBBBBLL", EAP_CODE_REQUEST, ctx['id'],
+ 4 + 1 + 3 + 8,
+ EAP_TYPE_LEAP,
+ 1, 0, 8, 0, 0)
+
return struct.pack(">BBH", EAP_CODE_FAILURE, ctx['id'], 4)
srv = start_radius_server(leap_handler2)
@@ -1316,6 +1324,15 @@ def test_eap_proto_leap_errors(dev, apdev):
wait_fail_trigger(dev[0], "GET_FAIL")
dev[0].request("REMOVE_NETWORK all")
dev[0].wait_disconnected()
+
+ with fail_test(dev[0], 1,
+ "nt_challenge_response;eap_leap_process_request"):
+ dev[0].connect("eap-test", key_mgmt="WPA-EAP", scan_freq="2412",
+ eap="LEAP", identity="user", password="password",
+ wait_connect=False)
+ wait_fail_trigger(dev[0], "GET_FAIL")
+ dev[0].request("REMOVE_NETWORK all")
+ dev[0].wait_disconnected()
finally:
stop_radius_server(srv)